extract_variables {LearnVizLMM} | R Documentation |
extract_variables()
returns a data frame of information of the variables in
a nlme::lme()
or lme4::lmer()
model. The columns of the data frame
include: Effect
(whether the effect is random or fixed), Group
(group or
grouping factor associated with random effects), Term
(notation used to
include the variable in the model), Description
(description of the Term
),
and Parameter
(parameter estimated when the model is fit).
extract_variables(model, cat_vars = NULL, cat_vars_nlevels = NULL)
model |
Code for fitting a |
cat_vars |
Optional character vector of the names of categorical
predictor variables included in the |
cat_vars_nlevels |
Optional numeric vector of the number of levels (i.e.
categories) for each variable in |
A data frame.
# lme()
extract_variables(model = "lme(Score~type,random=list(School=pdDiag(~1+type),Class=~1))",
cat_vars = "type",
cat_vars_nlevels = 2)
extract_variables(model = "lme(weight~1+Time+I(Time^2),random=~Time+I(Time^2)|ID)")
# lmer()
extract_variables(model = "lmer(Strength ~ 1 + (1|Machine) + (1|Worker))")
extract_variables(model = "lmer(score ~ age*treat + (age|subject))",
cat_vars = "treat",
cat_vars_nlevels = 3)