dtsurvey | R Documentation |
Construct a dtsurvey object
dtsurvey(DT, psu = NULL, strata = NULL, weight = NULL, nest = TRUE)
DT |
data.table. A data.table containing the survey results |
psu |
character. Name of the variable(s) containing the psu information. NULL indicates no PSUs (e.g. each observation gets its own) |
strata |
character. Name of the variable(s) containing the strata information. Null indicates no strata (e.g. all obs belong to the same one) |
weight |
character. Name of the variables containing the pweight information. If NULL, then weights default to 1 (and what even is the point then) |
nest |
logical. If true, will re-nest PSUs within strata. If false, PSUs will be accepted as is and will throw an error when PSUs belong to multiple strata |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.