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.
Arguments
- x
lm
object with weights containing aWeightedStudySpecification
, or an offset fromcov_adj()
.- specification
Optional, explicitly specify the
StudySpecification
to be used. If theStudySpecification
is specified elsewhere inx
(e.g. passed as an argument to any ofate()
,ett()
,cov_adj()
orassigned()
) it will be found automatically and does not need to be passed here as well. (If differentStudySpecification
objects are passed (either through thelm
in weights or covariance adjustment, or through this argument), an error will be produced.)
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()
.