lmmixed | R Documentation |
finalfit
model wrapperUsing finalfit
conventions, produces mixed effects linear regression
models for a set of explanatory variables against a continuous dependent.
lmmixed(.data, dependent, explanatory, random_effect, ...)
.data |
Dataframe. |
dependent |
Character vector of length 1, name of depdendent variable (must be continuous vector). |
explanatory |
Character vector of any length: name(s) of explanatory variables. |
random_effect |
Character vector of length 1, either, (1) name of random
intercept variable, e.g. "var1", (automatically convered to "(1 | var1)");
or, (2) the full |
... |
Other arguments to pass to |
Uses lme4::lmer
with finalfit
modelling
conventions. Output can be passed to fit2df
. This is only
currently set-up to take a single random effect as a random intercept. Can be
updated in future to allow multiple random intercepts, random gradients and
interactions on random effects if there is a need.
A list of multivariable lme4::lmer
fitted model
outputs. Output is of class lmerMod
.
fit2df
Other finalfit model wrappers:
coxphmulti()
,
coxphuni()
,
crrmulti()
,
crruni()
,
glmmixed()
,
glmmulti_boot()
,
glmmulti()
,
glmuni()
,
lmmulti()
,
lmuni()
,
svyglmmulti()
,
svyglmuni()
library(finalfit)
library(dplyr)
explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
random_effect = "hospital"
dependent = "nodes"
colon_s %>%
lmmixed(dependent, explanatory, random_effect) %>%
fit2df(estimate_suffix=" (multilevel")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.