Estimate means, totals, and supported survey-weighted models in DuckDB.
Arguments
- .data
A lazy DuckDB query from
nis_open().- weights
A data-masked SQL-translatable expression for the analysis weights. The default uses discharge weights without annualization.
Details
Use dplyr::filter() on the design to define a domain while
retaining the original sample for variance. Invalid design fields are
excluded when defining the sample.
Use survey::svymean(), survey::svytotal(), and survey::svyby() for
summaries. survey::svyglm() supports additive Gaussian identity,
binomial and quasibinomial logit, and Poisson and quasipoisson log
models. Use nis_design() for interactions, offsets, survey quantiles,
chi-square tests, or gtsummary::tbl_svysummary().
The design supports the "fail" and "adjust" settings of
survey.lonely.psu and honors survey.adjust.domain.lonely.
See also
Analyze the whole sample in DuckDB
Other survey-design:
nis_annual_totals(),
nis_design(),
nis_design_report(),
nis_reweight()