dtsurvey: Construct a dtsurvey object

View source: R/dtsurvey.R

dtsurveyR Documentation

Construct a dtsurvey object

Description

Construct a dtsurvey object

Usage

dtsurvey(DT, psu = NULL, strata = NULL, weight = NULL, nest = TRUE)

Arguments

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


dcaseykc/dtsurvey documentation built on March 9, 2024, 1:09 p.m.