Skip to contents

Converts the output of lm() into a teeMod object, for standard errors that account for block and cluster information carried with the lm's weights, and/or an offset incorporating predictions of the outcome from a separate model.

Usage

as.lmitt(x, specification = NULL)

as.teeMod(x, specification = NULL)

Arguments

x

lm object with weights containing a WeightedStudySpecification, or an offset from cov_adj().

specification

Optional, explicitly specify the StudySpecification to be used. If the StudySpecification is specified elsewhere in x (e.g. passed as an argument to any of ate(), ett(), cov_adj() or assigned()) it will be found automatically and does not need to be passed here as well. (If different StudySpecification objects are passed (either through the lm in weights or covariance adjustment, or through this argument), an error will be produced.)

Value

teeMod object

Details

The formula with which x was created must include a treatment identifier (e.g. assigned()). If a model-based offset is incorportated, the model's predictions would have to have been extracted using cov_adj() (as opposed to predict{} in order for teeMod standard error calculations to reflect propagation of error from these predictions. This mechanism only supports treatment main effects: to estimate interactions of treatment assignment with a moderator variable, use lmitt() instead of lm() and as.lmitt().