.expand.model.frame_teeMod | R Documentation |
teeMod
objectA variation of expand.model.frame which works for teeMod
objects
.expand.model.frame_teeMod(
model,
extras,
envir = environment(formula(model)),
na.expand = FALSE
)
model |
A |
extras |
one-sided formula or vector of character strings describing new variables to be added |
envir |
an environment to evaluate things in |
na.expand |
logical; see |
When building a teeMod
object inside lmitt()
, we do a lot of
manipulation of the variables involved in the model such that by the time
the teeMod
is produced, neither the outcome nor predictors actually
fit in the model exist in the data
passed into the call.
(E.g. to be specific, if a user calls myda <- lmitt(y ~ 1, data =
mydata)
, then model.frame(myda)
would contain column names not found
in mydata
.)
This is a clone of stats::expand.model.frame()
which has one addition
after extracting the model$call$data
from model
, it adds
columns from model.frame(model)
to the object. This ensures that the
additional variables created during lmitt()
can be found.
Trivial modifications from stats::expand.model.frame()
include
ensuring model
is a teeMod
object, and using the ::
syntax as appropriate.
A data.frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.