Skip to content

Add requested variables and contingency tables #986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 19, 2021

Conversation

davidkretch
Copy link
Contributor

@davidkretch davidkretch commented Apr 5, 2021

Description

Add the requested v0.2 variables and contingency tables from the new contingency tables requirements document.

I have compared the results of this version with the version on main and the vaccinated and concerned_sideeffects (now worried_vaccine_sideeffects) match exactly. I compared results for survey responses submitted 3/21-3/27 at the state/age (now agefull) level.

One issue I noticed: the pct_cli and pct_ili metrics, which use compute_numeric, do not receive standard errors.

Changelog

  • In contingency_variables.R, add v0.2 grouping and indicator variables and new names/categories. Reorganize all variables to match the order in the requirements spreadsheet for easy checking.

  • In contingency_indicators.R, add all requested contingency tables by region and group (e.g. nation, state, age, gender, etc.) and all requested indicators, e.g. vaccinated, hesitant, etc.

@krivard krivard requested a review from nmdefries April 5, 2021 20:28
@davidkretch
Copy link
Contributor Author

Hello, we realized that some of the codings in this need to be updated, e.g. hcw should be "Healthcare worker" rather than 1, etc. We will update asap.

@davidkretch davidkretch marked this pull request as draft April 6, 2021 22:19
@davidkretch davidkretch marked this pull request as ready for review April 8, 2021 14:48
@davidkretch davidkretch marked this pull request as draft April 8, 2021 14:50
@davidkretch davidkretch changed the base branch from main to contingency-tables-fb-sandbox April 8, 2021 14:50
@davidkretch davidkretch changed the base branch from contingency-tables-fb-sandbox to main April 8, 2021 14:51
Copy link
Contributor

@nmdefries nmdefries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just from an initial look-through; I haven't checked all the variable definitions in detail.

I was hoping that you'd base this off the contingency-tables-fb-sandbox branch, which already has a lot of these variables defined. Please take a look there to verify your definitions, especially the "hesitant and" ones. The race-based variables are there as well.

I believe Alex sent an email about this, but race is stripped from the microdata because of privacy concerns. To get race, you'll need to use the raw data.

Did you get a chance to run this and compare the output to existing tables?

we realized that some of the codings in this need to be updated, e.g. hcw should be "Healthcare worker" rather than 1

I think hcw is supposed to be boolean, so it seems fine.

@nmdefries
Copy link
Contributor

@davidkretch Hold off on rebasing/merging this into the contingency-table-fb-sandbox branch, I'm sending an email with more info.

@davidkretch davidkretch closed this Apr 8, 2021
@davidkretch davidkretch reopened this Apr 9, 2021
@davidkretch davidkretch force-pushed the p1_variables branch 4 times, most recently from bfb22c8 to 1b358be Compare April 12, 2021 17:41
* Add v0.2 grouping and indicator variables

In contingency_variables.R, add all v0.2 grouping and indicator
variables, and reorganize the variables to be in the same order as
they appear in the requirements spreadsheet for easy checking.

* Add v0.2 contingency tables

In contingency_indicators.R, add definitions for all v0.2 indicators
for the requested contingency tables, e.g. nation, nation/age, etc.
@davidkretch
Copy link
Contributor Author

This has now been updated with the changes discussed over the last week.

@davidkretch davidkretch requested a review from nmdefries April 12, 2021 19:49
@nmdefries nmdefries marked this pull request as ready for review April 12, 2021 19:51
Copy link
Contributor

@nmdefries nmdefries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some definitional issues and some items defined here already exist in variables.R. We should just rename those items to save computational effort. There are a couple things I want to check in with Sarah about and I'll follow up when possible.

Copy link
Contributor

@nmdefries nmdefries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some variable + comment clean-up.

@davidkretch
Copy link
Contributor Author

I've made the requested updates and verified that the updated version's output matches the previous version with the exception of the contingency table for grouping variable eligiblepregsmokeobese.

@nmdefries
Copy link
Contributor

nmdefries commented Apr 14, 2021

This is looking great!! I'm just going to run this on my own machine and compare to previous table output.

Copy link
Contributor

@nmdefries nmdefries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple details and then this is good to go! All calculations except pct_vaccinated matched tables produced by my current code 👍

@nmdefries nmdefries self-requested a review April 15, 2021 18:31
@nmdefries
Copy link
Contributor

@capnrefsmmat Could you merge this as well?

@capnrefsmmat capnrefsmmat merged commit 45ea5f1 into cmu-delphi:main Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants