Proper estimation of mixed-effects GVAR models. This is an alternative
fitting procedure to that provided by the mlGVAR
function. The
key differences are that this function can take significantly longer to fit,
and it may fail when trying to fit especially large models.
lmerVAR(
data,
m = NULL,
temporal = "default",
contemp = "default",
idvar = "ID",
intvars = NULL,
center = TRUE,
scale = TRUE,
centerWithin = TRUE,
scaleWithin = FALSE,
exogenous = TRUE,
covariates = NULL,
fix = NULL,
verbose = TRUE,
beepno = NULL,
dayno = NULL,
deleteMissing = TRUE
)
n x k
dataframe or matrix.
Character vector or numeric vector indicating the moderator(s), if
any. Can also specify "all"
to make every variable serve as a
moderator, or 0
to indicate that there are no moderators. If the
length of m
is k - 1
or longer, then it will not be possible
to have the moderators as exogenous variables. Thus, exogenous
will
automatically become FALSE
.
Only affects the model for the temporal network and
between-subjects network (which is derived from the temporal network).
Options are "default", "correlated", "orthogonal", "fixed",
"intfixed"
. "correlated"
makes it so that all random-effect terms
are correlated, and "orthogonal"
makes it so they are not.
"fixed"
makes it so that there is only a random intercept, but no
other random-effect terms related to the individual predictors.
"intfixed"
essentially mimics "orthogonal"
, with the
exception that no interaction terms have random slopes. "default"
will automatically set the value to "correlated"
if there are 6 or
fewer nodes in the network, and "orthogonal"
otherwise. The reason
for this is that models with correlated random effects take substantially
longer to fit than those with orthogonal effects. The "default"
option is designed to strike a balance between comprehensiveness and
efficiency for the average user. It is recommended to set this value
manually in order to produce results according to one's individual
specifications.
Options are "default", "correlated", "orthogonal"
.
"correlated"
makes it so that random-effect terms are correlated,
and "orthogonal"
makes it so they are not. "default"
will
automatically set the value to "correlated"
if there are 6 or fewer
nodes in the network, and "orthogonal"
otherwise. The reason for
this is that models with correlated random effects take substantially
longer to fit than those with orthogonal effects. The "default"
option is designed to strike a balance between comprehensiveness and
efficiency for the average user. It is recommended to set this value
manually in order to produce results according to one's individual
specifications.
Character string to indicate which variable contains the participant identification numbers.
Character vector to indicate which interaction terms to include in the model. Not necessary, but useful to add significant customization and explicitly state which interactions to include in the model.
Logical. Determines whether to mean-center the variables.
Logical. Determines whether to standardize the variables.
Following the application of center
and
scale
, this determines whether to center variables within individual
subjects to create subject-centered values.
Following the application of center
and
scale
, this determines whether to scale variables within individual
subjects to create subject-standardized values.
Logical. Indicates whether moderator variables should be
treated as exogenous or not. If they are exogenous, they will not be
modeled as outcomes/nodes in the network. If the number of moderators
reaches k - 1
or k
, then exogenous
will automatically
be FALSE
.
See corresponding argument in fitNetwork
function. Can supply a numeric value or vector to indicate which variables
are covariates, or can supply a list containing the individual covariates
separately from the dataset.
Character vector to indicate which variables to only create fixed effects terms for.
Logical. Determines whether to output progress bars and messages in the console during the fitting process.
Character string or numeric value to indicate which variable
(if any) encodes the survey number within a single day. Must be used in
conjunction with dayno
argument.
Character string or numeric value to indicate which variable (if
any) encodes the survey number within a single day. Must be used in
conjunction with beepno
argument.
Logical. Determines whether to automatically perform listwise deletion if there are any missing values in the dataset.
A lmerVAR
mixed-effects model with corresponding networks.
In the process of adding further documentation. More details to come. The method is referred to as the "two-step multilevel VAR" (Epskamp et al., 2018).
Epskamp, S., Waldorp, L. J., Mottus, R., & Borsboom, B. (2018). The gaussian graphical model in cross-sectional and time-series data. Multivariate Behavioral Research. 53, 453-580.
# NOT RUN {
# The options were chosen so that the function would take less time to run
x <- lmerVAR(mlgvarDat, 'M', temporal = "fixed", contemp = "orthogonal")
# }
Run the code above in your browser using DataLab