mlts_model {mlts} | R Documentation |
Build a multilevel latent time series model
Description
Build a multilevel latent time series model
Usage
mlts_model(
class = c("VAR"),
q,
p = NULL,
max_lag = c(1, 2, 3),
btw_factor = TRUE,
btw_model = NULL,
fix_dynamics = FALSE,
fix_inno_vars = FALSE,
fix_inno_covs = TRUE,
inno_covs_zero = FALSE,
inno_covs_dir = NULL,
fixef_zero = NULL,
ranef_zero = NULL,
ranef_pred = NULL,
out_pred = NULL,
out_pred_add_btw = NULL
)
Arguments
class |
Character. Indicating the model type to be specified. For now
restricted to |
q |
Integer. The number of time-varying constructs. |
p |
Integer. For multiple-indicator models, specify a vector of length
|
max_lag |
Integer. The maximum lag of the autoregressive effect to be included in the model. The maximum is 3. Defaults to 1. |
btw_factor |
Logical. If |
btw_model |
A list to indicate for which manifest indicator variables a common between-level factor should be modeled (see Details for detailed instructions). At this point restricted to one factor per latent construct. |
fix_dynamics |
Logical. Fix all random effect variances of autoregressive and cross-lagged effects to zero (constraining parameters to be equal across clusters). |
fix_inno_vars |
Logical. Fix all random effect variances of innovation variances to zero (constraining parameters to be equal across clusters). |
fix_inno_covs |
Logical. Fix all random effect variances of innovation covariances to zero (constraining parameters to be equal across clusters). |
inno_covs_zero |
Logical. Set to |
inno_covs_dir |
For bivariate VAR models with person-specific innovation covariances,
a latent variable approach is applied (for a detailed description, see Hamaker et al., 2018).
by specifying an additional factor that loads onto the contemporaneous innovations of both constructs,
capturing the shared variance of innovations, that is not predicted by the previous time points.
The loading parameters of this latent factor, however, have to be restricted in accordance with
researchers assumptions about the sign of the association between innovations across construct.
Hence, if innovations at time $t$ are assumed to be positively correlated across clusters, set the
argument to |
fixef_zero |
Character. A character vector to index which fixed effects
(referring to the parameter labels in |
ranef_zero |
Character. A character vector to index which random effect variances
(referring to the parameter labels in |
ranef_pred |
A character vector or a named list. Include between-level covariate(s)
as predictor(s) of all random effects in |
out_pred |
A character vector or a named list. Include between-level outcome(s)
to be regressed on all random effects in |
out_pred_add_btw |
A character vector. If |
Value
An object of class data.frame
with the following columns:
Model |
Indicates if the parameter in the respective row is part of the structural, or the measurement model (if multiple indicators per construct are provided) |
Level |
Parameter on the between- or within-level. |
Type |
Describes the parameter type. |
Param |
Parameter names to be referred to in arguments of |
Param_Label |
Parameter labels (additional option to address specific parameters). |
isRandom |
Indicates which within-level parameters are modeled as random (1) or a constant across clusters (0). |
Constraint |
Optional. Included if multiple-indicators per construct (p > 1) are provided.
Constraints on measurement model parameters can be changed by overwriting the respective value
in |
prior_type |
Contains the parameters' prior distribution used in |
prior_location |
Location values of the parameters' prior distribution used
in |
prior_scale |
Scale values of the parameters' prior distribution used
in |
References
Hamaker, E. L., Asparouhov, T., Brose, A., Schmiedek, F., & Muthén, B. (2018). At the frontiers of modeling intensive longitudinal data: Dynamic structural equation models for the affective measurements from the COGITO study. Multivariate behavioral research, 53(6), 820-841. doi:10.1080/00273171.2018.1446819
Examples
# To illustrate the general model building procedure, starting with a simple
# two-level AR(1) model with person-specific individual means, AR effects,
# and innovation variances (the default option when using mlts_model() and q = 1).
model <- mlts_model(q = 1)
# All model parameters (with their labels stored in model$Param) can be inspected by calling:
model
# Possible model extensions/restrictions:
# 1. Introducing additional parameter constraints, such as fixing specific
# parameters to a constant value by setting the respective random effect
# variances to zero, such as e.g. (log) innovation variances
model <- mlts_model(q = 1, ranef_zero = "ln.sigma2_1")
# Note that setting the argument `fix_inno_vars` to `TRUE` provides
# a shortcut to fixing the innovation variances of all constructs
# (if q >= 1) to a constant.
# 2. Including a multiple indicator model, where the construct is measured by
# multiple indicators (here, p = 3 indicators)
model <- mlts_model(
q = 1, # the number of time-varying constructs
p = 3, # the number of manifest indicators
# assuming a common between-level factor (the default)
btw_factor = TRUE
)
# 3. Incorporating between-level variables. For example, inclusion of
# an additional between-level variable ("cov1") as predictor of all
# (ranef_pred = "cov1") or a specific set of random effects
# (ranef_pred = list("phi(1)_11") = "cov1"), an external outcome (e.g., "out1")
# to be predicted by all (out_pred = "out1") or specific random effects
# (out_pred = list("out1" = c("etaB_1", "phi(1)_11")), using the latent
# between-level factor trait scores (etaB_1) and individual first-order
# autoregressive effects (phi(1)_11) as joint predictors of outcome "out1".
model <- mlts_model(
q = 1,
p = 3,
fix_inno_vars = TRUE,
ranef_pred = "cov1",
out_pred = list("out1" = c("etaB_1", "phi(1)_11"))
)
# Note that the names of the random effect parameters must match the
# parameter labels provided in model$Param, the result of the
# mlts_model()-functions.