Create a new variable which is true if any of the variables in a list of variables are true.
Examples
set_survey(namcs2019sv)
#> Survey info {NAMCS 2019 PUF}
#> ┌───────────┬──────────────┬────────────────────────────────────────────────┐
#> │ Variables │ Observations │ Design │
#> ├───────────┼──────────────┼────────────────────────────────────────────────┤
#> │ 33 │ 8,250 │ Stratified 1 - level Cluster Sampling design │
#> │ │ │ (with replacement) │
#> │ │ │ With (398) clusters. │
#> │ │ │ namcs2019sv = survey::svydesign(ids = ~CPSUM, │
#> │ │ │ strata = ~CSTRATM, weights = ~PATWT │
#> │ │ │ , data = namcs2019sv_df) │
#> └───────────┴──────────────┴────────────────────────────────────────────────┘
#>
var_any("Imaging services"
, c("ANYIMAGE", "BONEDENS", "CATSCAN", "ECHOCARD", "OTHULTRA"
, "MAMMO", "MRI", "XRAY", "OTHIMAGE"))
tab("Imaging services")
#> Imaging services (knowns only) {NAMCS 2019 PUF}
#> ┌───────┬───────┬─────────────┬──────────┬──────────┬──────────┬─────────┬─────┬──────┬──────┐
#> │ Level │ n │ Number │ SE (000) │ LL (000) │ UL (000) │ Percent │ SE │ LL │ UL │
#> │ │ │ (000) │ │ │ │ │ │ │ │
#> ├───────┼───────┼─────────────┼──────────┼──────────┼──────────┼─────────┼─────┼──────┼──────┤
#> │ FALSE │ 7,148 │ 901,115 │ 43,298 │ 820,085 │ 990,151 │ 86.9 │ 1.1 │ 84.6 │ 89.1 │
#> ├───────┼───────┼─────────────┼──────────┼──────────┼──────────┼─────────┼─────┼──────┼──────┤
#> │ TRUE │ 1,102 │ 135,369 │ 13,574 │ 111,134 │ 164,890 │ 13.1 │ 1.1 │ 10.9 │ 15.4 │
#> └───────┴───────┴─────────────┴──────────┴──────────┴──────────┴─────────┴─────┴──────┴──────┘
#> N = 8250. Checked NCHS presentation standards. Nothing to
#> report.
#>