data: A data.frame containing the data to be used in the model.
outcome: Character, the name of the outcome variable in data.
group: Character, the name of the group variable in data.
covariates: Character vector containing the name of any additional covariates to be included in the model as well as any interaction terms.
weights: Character, either "counterfactual" (default), "equal", "proportional_em" or "proportional". Specifies the weighting strategy to be used when calculating the lsmeans. See the weighting section for more details.
Details
group must be a factor variable with only 2 levels.
outcome must be a continuous numeric variable.
Weighting
Counterfactual
For weights = "counterfactual" (the default) the lsmeans are obtained by taking the average of the predicted values for each patient after assigning all patients to each arm in turn. This approach is equivalent to standardization or g-computation. In comparison to emmeans this approach is equivalent to:
For weights = "proportional_em" the lsmeans are obtained as per weights = "equal"
except instead of weighting each observation equally they are weighted by the proportion in which the given combination of categorical values occurred in the data. In comparison to emmeans this approach is equivalent to: