Skip to content

Conversation

@nmdefries
Copy link
Contributor

@nmdefries nmdefries commented Jun 10, 2022

Description

This only includes non-demographic indicators from the new indicators doc.

Support percentile fields for numeric metrics.

Changelog

  • contingency_indicators.R
  • contingency_variables.R
  • contingency_calculate.R
  • variables.R

@nmdefries nmdefries force-pushed the ndefries/archival-new-inds branch from 7516797 to 0df4d15 Compare June 14, 2022 16:06
@nmdefries nmdefries marked this pull request as ready for review June 15, 2022 20:02
@nmdefries nmdefries requested a review from capnrefsmmat June 15, 2022 20:02
Copy link
Contributor

@capnrefsmmat capnrefsmmat left a 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"],
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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)) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@nmdefries nmdefries requested a review from capnrefsmmat July 13, 2022 23:37
…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
@nmdefries
Copy link
Contributor Author

@krivard This is ready to merge.

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.

4 participants