mcm_lmer {MCM} | R Documentation |
Estimate and Test Inter-generational Mobility Effect with Longitudinal Data
Description
This function fits a multilevel mobility contrast model to estimate and test inter-generational mobility effect on an outcome in longitudinal data.
Usage
mcm_lmer(
formula,
data = NULL,
REML = TRUE,
control = lme4::lmerControl(),
start = NULL,
verbose = 0L,
subset,
weights,
na.action,
offset,
contrasts = NULL,
devFunOnly = FALSE,
origin = NULL,
destination = NULL,
time = NULL,
displayresult = TRUE,
...
)
Arguments
formula |
Inherit the function form from |
data |
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which the function is called. |
REML |
logical. Should the estimates be chosen be optimize the restricted log-likelihood (REML) criterial (as opposed to the log-likelihood)? |
control |
Inherit from |
start |
Inherit from |
verbose |
Inherit from |
subset |
optional expression selecting the subset of the rows of data to fit the model. |
weights |
an optional vector of ‘prior weights’ to be used in the fitting process. Should be NULL or a numeric vector. |
na.action |
a function which indicates what should
happen when the data contain NAs.The default is set by the
|
offset |
Inherit from |
contrasts |
an optional list. The default is set as sum-to-zero contrast. |
devFunOnly |
logical - return only the deviance evaluation function. |
origin |
a character indicating the column name of origin. |
destination |
a character indicating the column name of destination. |
time |
a character indicating the time when individual was observed |
displayresult |
logical. Should model results be displayed
after estimation. The default is |
... |
additional arguments to be passed to the function. |
Value
A list containing:
model |
Fitted generalized models of outcome on predictors.
See more on function |
estimates |
Estimated mobility effects. |
se |
Standard errors of the estimated mobility effects. |
significance |
Statistical significance of the the estimated mobility effects. |
esti_3way |
Estimated mobility effects conditional on specific age. |
se_3way |
Standard errors of the estimated mobility effects conditional specific age. |
sig_3way |
Statistical significance of the the estimated mobility effects conditional on age. |
Examples
library(MCM)
library(lme4)
data("sim_datlmer")
fit_mcm_lmer <- mcm_lmer(yij ~ origin*destination*age +
(1|id), data = sim_datlmer,
origin = "origin",
destination = "destination",
time = "age")