- formula
A formula for the outcome mean model, including covariates.
- data
A data frame where categorical variables should already be converted to dummy variables.
- cluster
A string representing the column name of the cluster ID in the data frame.
- trt
A string representing the column name of the treatment assignment per cluster (0=control, 1=treatment).
- trtprob
A vector of treatment probabilities per cluster (for each individual), conditional on covariates. Default is rep(0.5,nrow(data))
- method
A string specifying the outcome mean model. Possible values are:
- 'GLM': generalized linear model on cluster-level means (binary/continuous outcome).
- 'LMM': linear mixed model on individual-level observations (continuous outcome).
- 'GEE': marginal models fitted by generalized estimating equations.
- 'GLMM': generalized linear mixed model.
- family
The link function for the outcome. Can be one of the following:
- `gaussian(link = "identity")`: for continuous outcomes. Default is gaussian("identity").
- `binomial(link = "logit")`: for binary outcomes.
- `poisson(link = "log")`: for count outcomes.
- `gaussian(link = "logit")`: for binary outcomes with logit link to model the genealized linear model.
- corstr
A string specifying the correlation structure for GEE models (e.g., "exchangeable", "independence").
- scale
A string specifying the risk measure of interest. Can be 'RD' (risk difference), 'RR' (relative risk), or 'OR' (odds ratio).
- jack
A numeric value (1, 2, or 3) specifying the type of jackknife standard error estimate. Type 1 is the standard jackknife, and type 3 is recommended for small numbers of clusters. Default is 1.
- alpha
A numeric value for the type-I error rate. Default is 0.05.