Skip to contents

Returns a survey::svydesign object when survey is available; otherwise returns a lightweight list with the same fields the morie helpers consume.

Usage

morie_survey_design(
  data,
  weights_col,
  strata_col = NULL,
  cluster_col = NULL,
  fpc_col = NULL,
  nest = FALSE
)

Arguments

data

data.frame.

weights_col

Column name of analytic/probability weights.

strata_col

Optional strata column.

cluster_col

Optional PSU/cluster column.

fpc_col

Optional finite-population-correction column.

nest

If TRUE, treat cluster IDs as nested within strata.