-
Notifications
You must be signed in to change notification settings - Fork 16
[CTIS] New indicators to round out contingency tables before archival #1635
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
Conversation
7516797 to
0df4d15
Compare
make postprocessing multinomial
Co-authored-by: Alex Reinhart <alex@refsmmat.com>
capnrefsmmat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments. Admittedly I did not check literally every change, but I skimmed through and most coding looks good
| val = as.data.frame(svymean(~response, na.rm = TRUE, design = design))[,"mean"], | ||
| se = NA_real_, | ||
| sd = as.data.frame(sqrt(svyvar(~response, na.rm = TRUE, design = design)))[,"variance"], | ||
| p25 = as.data.frame(oldsvyquantile(~response, na.rm = TRUE, design = design, quantiles = 0.25))[,"0.25"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, why are we using oldsvyquantile instead of svyquantile? I don't know the details of what changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incidentally you might like srvyr, which provides a tidy interface to the survey package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
svyquantile doesn't work for older versions of R, so Esther switched her code to use the old version of the function. Context. Looks like the old one is slower and less flexible.
The approach I implemented here is just a simplified version of Esther's code, since we already have sample size filters, e.g., elsewhere.
| input_data$t_unusual_symptom_hospital <- NA | ||
| } | ||
|
|
||
| if ("B7" %in% names(input_data)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the issue with B7 I raised on Slack, maybe we need to throw out Wave 10 or add some logic to correct the aggregates of it; worth raising with Adrianne maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Told Adrianne about the issue.
What corrective logic are you thinking of? If B7 is being shown to only those who didn't respond at all to B2, then even if we filter it using other questions, we're not going to be able to extract any responses we're interested in (where someone answered both B2 and B2c with symptoms).
It seems to me that the only option is to drop all Wave 10 responses to B7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adrianne says dropping Wave 10 sounds fine.
Co-authored-by: Alex Reinhart <alex@refsmmat.com>
Add county info to contingency tables
…hreshold Lower contingency table threshold and round sample sizes
…-filter Filter out gender self-described responses from contingency tables
[CTIS contingency] Make themed and demographic tables
|
@krivard This is ready to merge. |
Description
This only includes non-demographic indicators from the new indicators doc.
Support percentile fields for numeric metrics.
Changelog
contingency_indicators.Rcontingency_variables.Rcontingency_calculate.Rvariables.R