powRICLPM_Mplus {powRICLPM} | R Documentation |
Create Mplus syntax for RI-CLPM power analysis
Description
powRICLPM_Mplus()
creates and saves (a) syntax file(s) for performing a Monte Carlo power analysis for the random intercept cross-lagged panel model (RI-CLPM) in Mplus. Mplus model syntax can be created across multiple experimental conditions simultaneously. Conditions are defined in terms of sample size, number of time points, and proportion of between-unit variance (ICC). See "Details" for information on a) the naming conventions of parameters, and b) the various constraints that can be imposed on the model.
Usage
powRICLPM_Mplus(
search_lower = NULL,
search_upper = NULL,
search_step = 20,
sample_size = NULL,
time_points,
ICC,
RI_cor,
Phi,
within_cor,
reps = 1000,
seed = NA,
save_path = getwd(),
constraints = "none"
)
Arguments
search_lower |
A positive integer, denoting the lower bound of a range of sample sizes. |
search_upper |
A positive integer, denoting the upper bound of a range of sample sizes. |
search_step |
A positive integer, denoting an increment in sample size. |
sample_size |
(optional) An integer (vector), indicating specific sample sizes at which to evaluate power, rather than specifying a range using the |
time_points |
An integer (vector) with elements at least larger than 3, indicating number of time points. |
ICC |
A |
RI_cor |
A |
Phi |
A matrix, with standardized autoregressive effects (on the diagonal) and cross-lagged effects (off-diagonal) in the population. Columns represent predictors and rows represent outcomes. |
within_cor |
A |
reps |
A positive |
seed |
An |
save_path |
A |
constraints |
(optional) A character string, specifying the type of constraints that should be imposed on the estimation model (see "Details"). |
Details
Syntax generation
Mplus model syntax is created in multiple steps: First, the MODEL POPULATION
command syntax is created in which parameters are constrained to population values. Second, the MODEL
command syntax is created for model estimation. Optionally, syntax for constraints on the estimation model, in the MODEL CONSTRAINTS
command, is created next. Ultimately, the parameter tables are combined to form character vectors containing the Mplus syntax to be exported (see "Details" of powRICLPM
for more information on the constraints
options).
Naming conventions
Details on the naming conventions can be found in the "Details" section of powRICLPM
.
Value
No return value, called for side effects.
Examples
# Define population parameters for lagged effects
Phi <- matrix(c(.4, .1, .2, .3), ncol = 2, byrow = TRUE)
# Create and save Mplus model syntax
powRICLPM_Mplus(
sample_size = c(400, 500),
time_points = 3,
ICC = 0.5,
RI_cor = 0.3,
Phi = Phi,
within_cor = 0.3,
reps = 10000,
seed = 1234,
save_path = tempdir()
)