Skip to contents

Complex-survey GLM constructor (single-shot wrapper that builds a design and fits a svyglm in one call). Cluster-robust SEs via the design.

Usage

morie_survey_complex_glm(
  df,
  formula,
  weight_col,
  family = "gaussian",
  cluster_col = NULL,
  strata_col = NULL
)

Arguments

df

A data.frame holding the (unit-level) sample data plus any weight/strata/cluster/domain columns referenced by name.

formula

A formula (e.g. y ~ x1 + x2) for survey-weighted regression / GLM.

weight_col

Character; column name of the design weight variable in df.

family

A family object (e.g. stats::binomial()) passed to the survey-weighted GLM.

cluster_col

Character; column name of the cluster identifier in df.

strata_col

Character; column name of the stratum identifier in df.