# required packages:
# for the latest release of mlts run:
# devtools::install_github("https://github.com/munchfab/mlts")
library(mlts)
library(MplusAutomation)
library(ggplot2)
library(flextable)
library(dplyr)
library(tidyr)
# global settings for model estimation using mlts
n_iter = 2500
n_cores = 4
n_chains = 4
# load custom helper functions to extract and summarize the results
source("mlts_mplus_compare.R")Comparing Specification and Estimation of Dynamic Structural Equation Models Using mlts and Mplus
1 Two-level AR(1)
fit <- mlts_fit(
model = model,
data = simData,
ts = "Y1",
cores = n_cores,
chains = n_chains,
iter = n_iter,
seed = mod.id,
monitor_person_pars = T)Model estimation ended after 0.64 minutes.
summary(fit, digits = 2)Time series variables as indicated by parameter subscripts:
1 --> Y1
Data: 7500 observations in 75 IDs
Model convergence criteria:
Maximum Potential Scale Reduction Factor (PSR; Rhat): 1.005 (should be < 1.01)
Minimum Bulk ESS: 1467 (should be > 400, 100 per chain)
Minimum Tail ESS: 2521 (should be > 400, 100 per chain)
Number of divergent transitions: 0 (should be 0)
Posterior Summary Statistics
Fixed Effects:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1 0.84 0.13 0.58 1.09 1 9438 3843
phi(1)_11 0.18 0.02 0.14 0.22 1 5138 3863
ln.sigma2_1 -0.30 0.04 -0.38 -0.24 1 6359 3774
Random Effects SDs:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
sigma_mu_1 1.16 0.10 0.98 1.36 1 10691 4099
sigma_phi(1)_11 0.14 0.02 0.11 0.18 1 3047 3704
sigma_ln.sigma2_1 0.28 0.03 0.22 0.34 1 4295 3880
Random Effects Correlations:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1.phi(1)_11 -0.14 0.14 -0.40 0.14 1 5620 4263
mu_1.ln.sigma2_1 0.05 0.13 -0.20 0.31 1 7203 4141
phi(1)_11.ln.sigma2_1 -0.42 0.14 -0.67 -0.11 1 2848 3123
Samples were drawn using NUTS on Wed Dec 10 21:43:07 2025.
For each parameter, Bulk_ESS and Tail_ESS are measures of effective
sample size, and Rhat is the potential scale reduction factor
on split chains (at convergence, Rhat = 1).
Code
# save data for Mplus
mplus = simData$data
colnames(mplus) <- NULL
write.table(mplus, file = paste0("Mplus/",mod.id,"_data.dat"), row.names = F)
file = paste0("Mplus/",mod.id,"_mplus_model.inp")
if(refit.mplus == T){
# run mplus model
runModels(target = file, showOutput = T, quiet = F)
}
# load results
mplus = readModels(target = paste0("Mplus/",mod.id,"_mplus_model.out"),
what = "parameters")
# full results
readLines(gsub(file,pattern=".inp",replacement=".out"))[1:214] [1] "Mplus VERSION 8.7"
[2] "MUTHEN & MUTHEN"
[3] "12/10/2025 9:43 PM"
[4] ""
[5] "INPUT INSTRUCTIONS"
[6] ""
[7] " DATA: file = 1_data.dat;"
[8] ""
[9] " VARIABLE:"
[10] " names = ID beep Y1;"
[11] " cluster = ID;"
[12] " usevar = Y1;"
[13] " missing = all(-99);"
[14] " lagged = Y1(1);"
[15] ""
[16] " ANALYSIS: TYPE = twolevel random;"
[17] " point = mean;"
[18] " estimator = bayes;"
[19] " proc = 2;"
[20] " Biterations = (10000);"
[21] " Bconvergence = .025;"
[22] " bseed = 12345;"
[23] " thin = 1;"
[24] ""
[25] " MODEL:"
[26] " %WITHIN%"
[27] " AR1 | Y1 on Y1&1;"
[28] ""
[29] " ! random residual variance by cluster"
[30] " logv1 | Y1;"
[31] ""
[32] " %BETWEEN%"
[33] " Y1 AR1 logv1 with Y1 AR1 logv1;"
[34] ""
[35] ""
[36] " OUTPUT: TECH1 TECH8 stdyx(cluster); ! fscomparison;"
[37] ""
[38] " PLOT: TYPE = PLOT3 PLOT2;"
[39] " ! FACTORS = ALL;"
[40] ""
[41] ""
[42] ""
[43] "INPUT READING TERMINATED NORMALLY"
[44] ""
[45] ""
[46] ""
[47] ""
[48] "SUMMARY OF ANALYSIS"
[49] ""
[50] "Number of groups 1"
[51] "Number of observations 7500"
[52] ""
[53] "Number of dependent variables 1"
[54] "Number of independent variables 1"
[55] "Number of continuous latent variables 2"
[56] ""
[57] "Observed dependent variables"
[58] ""
[59] " Continuous"
[60] " Y1"
[61] ""
[62] "Observed independent variables"
[63] " Y1&1"
[64] ""
[65] "Continuous latent variables"
[66] " AR1 LOGV1"
[67] ""
[68] "Variables with special functions"
[69] ""
[70] " Cluster variable ID"
[71] ""
[72] " Within variables"
[73] " Y1&1"
[74] ""
[75] ""
[76] "Estimator BAYES"
[77] "Specifications for Bayesian Estimation"
[78] " Point estimate MEAN"
[79] " Number of Markov chain Monte Carlo (MCMC) chains 2"
[80] " Random seed for the first chain 12345"
[81] " Starting value information UNPERTURBED"
[82] " Algorithm used for Markov chain Monte Carlo GIBBS(PX1)"
[83] " Convergence criterion 0.250D-01"
[84] " Maximum number of iterations 50000"
[85] " K-th iteration used for thinning 1"
[86] ""
[87] "Input data file(s)"
[88] " 1_data.dat"
[89] "Input data format FREE"
[90] ""
[91] ""
[92] "SUMMARY OF DATA"
[93] ""
[94] " Number of clusters 75"
[95] ""
[96] " Size (s) Cluster ID with Size s"
[97] ""
[98] " 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21"
[99] " 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39"
[100] " 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57"
[101] " 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75"
[102] ""
[103] ""
[104] ""
[105] "COVARIANCE COVERAGE OF DATA"
[106] ""
[107] "Minimum covariance coverage value 0.100"
[108] ""
[109] " Number of missing data patterns 2"
[110] ""
[111] ""
[112] " PROPORTION OF DATA PRESENT"
[113] ""
[114] ""
[115] " Covariance Coverage"
[116] " Y1"
[117] " ________"
[118] " Y1 1.000"
[119] ""
[120] ""
[121] ""
[122] "UNIVARIATE SAMPLE STATISTICS"
[123] ""
[124] ""
[125] " UNIVARIATE HIGHER-ORDER MOMENT DESCRIPTIVE STATISTICS"
[126] ""
[127] " Variable/ Mean/ Skewness/ Minimum/ % with Percentiles"
[128] " Sample Size Variance Kurtosis Maximum Min/Max 20%/60% 40%/80% Median"
[129] ""
[130] " Y1 0.844 0.141 -4.943 0.01% -0.333 0.442 0.796"
[131] " 7500.000 2.052 0.080 6.305 0.01% 1.143 2.032"
[132] ""
[133] ""
[134] "THE MODEL ESTIMATION TERMINATED NORMALLY"
[135] ""
[136] " USE THE FBITERATIONS OPTION TO INCREASE THE NUMBER OF ITERATIONS BY A FACTOR"
[137] " OF AT LEAST TWO TO CHECK CONVERGENCE AND THAT THE PSR VALUE DOES NOT INCREASE."
[138] ""
[139] ""
[140] ""
[141] "MODEL FIT INFORMATION"
[142] ""
[143] "Number of Free Parameters 9"
[144] ""
[145] "Information Criteria"
[146] ""
[147] " Deviance (DIC) 19191.417"
[148] " Estimated Number of Parameters (pD) 186.941"
[149] ""
[150] ""
[151] ""
[152] "MODEL RESULTS"
[153] ""
[154] " Posterior One-Tailed 95% C.I."
[155] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[156] ""
[157] "Within Level"
[158] ""
[159] "Between Level"
[160] ""
[161] " Y1 WITH"
[162] " AR1 -0.026 0.027 0.158 -0.081 0.025"
[163] " LOGV1 0.019 0.047 0.338 -0.074 0.114"
[164] ""
[165] " AR1 WITH"
[166] " LOGV1 -0.018 0.008 0.006 -0.034 -0.004 *"
[167] ""
[168] " Means"
[169] " Y1 0.845 0.138 0.000 0.576 1.117 *"
[170] " AR1 0.184 0.021 0.000 0.142 0.225 *"
[171] " LOGV1 -0.304 0.037 0.000 -0.375 -0.231 *"
[172] ""
[173] " Variances"
[174] " Y1 1.418 0.250 0.000 1.006 1.975 *"
[175] " AR1 0.023 0.006 0.000 0.014 0.036 *"
[176] " LOGV1 0.082 0.018 0.000 0.052 0.123 *"
[177] ""
[178] ""
[179] "STANDARDIZED MODEL RESULTS"
[180] ""
[181] ""
[182] "STDYX Standardization"
[183] ""
[184] " Posterior One-Tailed 95% C.I."
[185] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[186] ""
[187] "Within-Level Standardized Estimates Averaged Over Clusters"
[188] ""
[189] " AR1 | Y1 ON"
[190] " Y1&1 0.184 0.011 0.000 0.161 0.206 *"
[191] ""
[192] " LOGV1 |"
[193] " Y1 0.946 0.005 0.000 0.935 0.956 *"
[194] ""
[195] "Between Level"
[196] ""
[197] " Y1 WITH"
[198] " AR1 -0.147 0.143 0.158 -0.414 0.138"
[199] " LOGV1 0.056 0.134 0.338 -0.212 0.313"
[200] ""
[201] " AR1 WITH"
[202] " LOGV1 -0.415 0.150 0.006 -0.684 -0.095 *"
[203] ""
[204] " Means"
[205] " Y1 0.717 0.132 0.000 0.463 0.979 *"
[206] " AR1 1.243 0.215 0.000 0.846 1.686 *"
[207] " LOGV1 -1.081 0.173 0.000 -1.435 -0.745 *"
[208] ""
[209] " Variances"
[210] " Y1 1.000 0.000 0.000 1.000 1.000"
[211] " AR1 1.000 0.000 0.000 1.000 1.000"
[212] " LOGV1 1.000 0.000 0.000 1.000 1.000"
[213] ""
[214] ""
Code
comp <- mplus_mlts_compare(mplus = mplus, mlts = fit, fe_rows = c(4:6),
re_rows = c(7:9))
comp_tab(comp)Type | Param | True | mlts | Mplus | ||||
|---|---|---|---|---|---|---|---|---|
Est | 95% CI | CI Width | Est | 95% CI | CI Width | |||
Fixed effect | mu_1 | 0.80 | 0.84 | [0.58, 1.09] | 0.51 | 0.84 | [0.58, 1.12] | 0.54 |
phi(1)_11 | 0.15 | 0.18 | [0.14, 0.22] | 0.08 | 0.18 | [0.14, 0.22] | 0.08 | |
ln.sigma2_1 | -0.30 | -0.30 | [-0.38, -0.23] | 0.14 | -0.30 | [-0.38, -0.23] | 0.14 | |
Random effect SD | sigma_mu_1 | 1.10 | 1.16 | [0.98, 1.36] | 0.38 | 1.19 | [1.00, 1.41] | 0.40 |
sigma_phi(1)_11 | 0.15 | 0.14 | [0.11, 0.18] | 0.07 | 0.15 | [0.12, 0.19] | 0.07 | |
sigma_ln.sigma2_1 | 0.25 | 0.28 | [0.22, 0.34] | 0.12 | 0.29 | [0.23, 0.35] | 0.12 | |
RE correlation | r_mu_1.phi(1)_11 | -0.20 | -0.14 | [-0.40, 0.14] | 0.54 | -0.15 | [-0.41, 0.14] | 0.55 |
r_mu_1.ln.sigma2_1 | 0.05 | 0.05 | [-0.20, 0.31] | 0.50 | 0.06 | [-0.21, 0.31] | 0.52 | |
r_phi(1)_11.ln.sigma2_1 | -0.20 | -0.42 | [-0.68, -0.11] | 0.56 | -0.41 | [-0.68, -0.10] | 0.59 | |
Code
P <- mplus_mlts_comp_plot(comp)
P[[1]]
P[[2]]
P[[3]]Parameters with absolute posterior mean difference larger than 0.01:
Code
mplus_mlts_diff(comp, tol = 0.01)Param | True | mlts | Mplus | Diff |
|---|---|---|---|---|
Est | Est | |||
sigma_mu_1 | 1.10 | 1.16 | 1.19 | -0.04 |
sigma_ln.sigma2_1 | 0.25 | 0.28 | 0.29 | -0.01 |
sigma_phi(1)_11 | 0.15 | 0.14 | 0.15 | -0.01 |
Within-Level Standardized Effects
mplus$parameters$stdyx.standardized[c(1),c(1:4,6,7)] paramHeader param est posterior_sd lower_2.5ci upper_2.5ci
1 AR1|Y1.ON Y1&1 0.184 0.011 0.161 0.206
mlts_standardized(object = fit, what = "within")$`Within-level standardized effects averaged over clusters`
Type Param Std.Est SD 2.5% 97.5%
1 Fixed effect phi(1)_11 0.184 0.012 0.16 0.207
2 Two-level AR(2) with Covariates
mod.id = 2
# model specification
model <- mlts_model(
q = 1, # no. of time series variables
max_lag = 2, # include lagged effect(s) of second order
out_pred = "Out1", # outcome "Out1" regressed on all random model parameters
out_pred_add_btw = "Z1", # include "Z1" as predictor of "Out1"
ranef_pred = list(
"mu_1" = c("cov1", "cov2")) # cov1 and cov1 used as predictors of person-specific mean levels
)
# generate data
simData <- mlts_sim(model, N = 120, TP = 80, default = T,
btw.var.sds = c("cov1" = 1, "cov2" = 1, "Z1" = 1),
seed = mod.id, seed.true = 22
)
# path model
mlts_paths(model, asp_w_b = 0.66, scale_within = 0.2)fit = mlts_fit(
model = model,
data = simData,
ts = "Y1",
cores = n_cores,
chains = n_chains,
iter = n_iter,
seed = mod.id,
monitor_person_pars = T
)Model estimation ended after 1.77 minutes.
summary(fit, digits = 2)Time series variables as indicated by parameter subscripts:
1 --> Y1
Data: 9600 observations in 120 IDs
Model convergence criteria:
Maximum Potential Scale Reduction Factor (PSR; Rhat): 1.005 (should be < 1.01)
Minimum Bulk ESS: 1147 (should be > 400, 100 per chain)
Minimum Tail ESS: 1338 (should be > 400, 100 per chain)
Number of divergent transitions: 0 (should be 0)
Posterior Summary Statistics
Fixed Effects:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1 0.64 0.09 0.46 0.83 1 4887 4167
phi(1)_11 0.17 0.02 0.13 0.20 1 2900 3557
phi(2)_11 0.11 0.02 0.07 0.14 1 3123 3633
ln.sigma2_1 -0.27 0.03 -0.32 -0.22 1 3344 3485
Random Effects Regressed On:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1 ~ cov1 0.18 0.08 0.03 0.34 1 4936 3922
mu_1 ~ cov2 -0.13 0.09 -0.30 0.04 1 4126 3161
Outcome Prediction:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
Out1 ~ mu_1 0.00 0.06 -0.10 0.11 1 2720 3178
Out1 ~ phi(1)_11 -1.36 0.50 -2.46 -0.42 1 1242 1521
Out1 ~ phi(2)_11 -0.87 0.42 -1.71 -0.05 1 1614 2314
Out1 ~ ln.sigma2_1 0.31 0.34 -0.33 1.00 1 1391 1828
Out1 ~ Z1 0.38 0.05 0.29 0.47 1 4804 3648
Out1 ~ 1 0.10 0.17 -0.22 0.44 1 1326 1552
Residual SD Out1 0.47 0.04 0.41 0.55 1 2990 3225
Random Effects SDs:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
sigma_mu_1 1.01 0.07 0.89 1.15 1 4383 3688
sigma_phi(1)_11 0.16 0.02 0.13 0.19 1 1418 2028
sigma_phi(2)_11 0.18 0.02 0.15 0.22 1 2091 3027
sigma_ln.sigma2_1 0.23 0.02 0.19 0.28 1 2269 3115
Random Effects Correlations:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1.phi(1)_11 0.05 0.12 -0.18 0.28 1 2578 3071
mu_1.phi(2)_11 0.42 0.09 0.23 0.60 1 2534 2527
mu_1.ln.sigma2_1 0.10 0.11 -0.12 0.32 1 2411 2809
phi(1)_11.phi(2)_11 0.26 0.13 0.02 0.51 1 1729 2042
phi(1)_11.ln.sigma2_1 0.45 0.12 0.20 0.68 1 1306 1355
phi(2)_11.ln.sigma2_1 0.32 0.12 0.08 0.55 1 2044 2839
Samples were drawn using NUTS on Thu Dec 11 10:57:03 2025.
For each parameter, Bulk_ESS and Tail_ESS are measures of effective
sample size, and Rhat is the potential scale reduction factor
on split chains (at convergence, Rhat = 1).
Code
# save data for Mplus
mplus = simData$data
colnames(mplus) <- NULL
write.table(mplus, file = paste0("Mplus/",mod.id,"_data.dat"), row.names = F)
file = paste0("Mplus/",mod.id,"_mplus_model.inp")
if(refit.mplus == T){
# run mplus model
runModels(target = file, showOutput = T, quiet = F)
}
# load results
mplus = readModels(target = paste0("Mplus/",mod.id,"_mplus_model.out"),
what = "parameters")
# full results
readLines(gsub(file,pattern=".inp",replacement=".out"))[1:303] [1] "Mplus VERSION 8.7"
[2] "MUTHEN & MUTHEN"
[3] "12/11/2025 10:58 AM"
[4] ""
[5] "INPUT INSTRUCTIONS"
[6] ""
[7] " DATA: file = 2_data.dat;"
[8] ""
[9] " VARIABLE:"
[10] " names = ID beep Y1 cov1 cov2 Out1 Z1;"
[11] ""
[12] " cluster = ID;"
[13] " usevar = Y1 cov1 cov2 Out1 Z1;"
[14] " between = cov1 cov2 Out1 Z1;"
[15] " missing = all(-99);"
[16] " lagged = Y1(2);"
[17] ""
[18] " DEFINE: CENTER cov1 cov2 (GRANDMEAN);"
[19] ""
[20] " ANALYSIS: TYPE = twolevel random;"
[21] " point = mean;"
[22] " estimator = bayes;"
[23] " proc = 2;"
[24] " Biterations = (5000);"
[25] " Bconvergence = .025;"
[26] " bseed = 12345;"
[27] " thin = 1;"
[28] ""
[29] " MODEL:"
[30] " %WITHIN%"
[31] ""
[32] " AR1 | Y1 on Y1&1;"
[33] " AR2 | Y1 on Y1&2;"
[34] ""
[35] " ! random residual variance by cluster"
[36] " logv1 | Y1;"
[37] ""
[38] " %BETWEEN%"
[39] " Y1 AR1 AR2 logv1 with Y1 AR1 AR2 logv1;"
[40] " Y1 ON cov1 cov2;"
[41] " Out1 ON Y1 AR1 AR2 logv1 Z1;"
[42] ""
[43] ""
[44] " OUTPUT: TECH1 TECH8 stdyx(cluster); ! fscomparison;"
[45] ""
[46] " PLOT: TYPE = PLOT3 PLOT2;"
[47] " ! FACTORS = ALL;"
[48] ""
[49] ""
[50] ""
[51] "INPUT READING TERMINATED NORMALLY"
[52] ""
[53] ""
[54] ""
[55] ""
[56] "SUMMARY OF ANALYSIS"
[57] ""
[58] "Number of groups 1"
[59] "Number of observations 9600"
[60] ""
[61] "Number of dependent variables 2"
[62] "Number of independent variables 5"
[63] "Number of continuous latent variables 3"
[64] ""
[65] "Observed dependent variables"
[66] ""
[67] " Continuous"
[68] " OUT1 Y1"
[69] ""
[70] "Observed independent variables"
[71] " COV1 COV2 Z1 Y1&1 Y1&2"
[72] ""
[73] "Continuous latent variables"
[74] " AR1 AR2 LOGV1"
[75] ""
[76] "Variables with special functions"
[77] ""
[78] " Cluster variable ID"
[79] ""
[80] " Within variables"
[81] " Y1&1 Y1&2"
[82] ""
[83] " Between variables"
[84] " COV1 COV2 OUT1 Z1"
[85] ""
[86] " Centering (GRANDMEAN)"
[87] " COV1 COV2"
[88] ""
[89] ""
[90] "Estimator BAYES"
[91] "Specifications for Bayesian Estimation"
[92] " Point estimate MEAN"
[93] " Number of Markov chain Monte Carlo (MCMC) chains 2"
[94] " Random seed for the first chain 12345"
[95] " Starting value information UNPERTURBED"
[96] " Algorithm used for Markov chain Monte Carlo GIBBS(PX1)"
[97] " Convergence criterion 0.250D-01"
[98] " Maximum number of iterations 50000"
[99] " K-th iteration used for thinning 1"
[100] ""
[101] "Input data file(s)"
[102] " 2_data.dat"
[103] "Input data format FREE"
[104] ""
[105] ""
[106] "SUMMARY OF DATA"
[107] ""
[108] " Number of clusters 120"
[109] ""
[110] " Size (s) Cluster ID with Size s"
[111] ""
[112] " 80 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21"
[113] " 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39"
[114] " 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57"
[115] " 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75"
[116] " 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93"
[117] " 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108"
[118] " 109 110 111 112 113 114 115 116 117 118 119 120"
[119] ""
[120] ""
[121] ""
[122] "COVARIANCE COVERAGE OF DATA"
[123] ""
[124] "Minimum covariance coverage value 0.100"
[125] ""
[126] " Number of missing data patterns 3"
[127] ""
[128] ""
[129] " PROPORTION OF DATA PRESENT"
[130] ""
[131] ""
[132] " Covariance Coverage"
[133] " OUT1 Y1 COV1 COV2 Z1"
[134] " ________ ________ ________ ________ ________"
[135] " OUT1 1.000"
[136] " Y1 1.000 1.000"
[137] " COV1 1.000 1.000 1.000"
[138] " COV2 1.000 1.000 1.000 1.000"
[139] " Z1 1.000 1.000 1.000 1.000 1.000"
[140] ""
[141] ""
[142] ""
[143] "UNIVARIATE SAMPLE STATISTICS"
[144] ""
[145] ""
[146] " UNIVARIATE HIGHER-ORDER MOMENT DESCRIPTIVE STATISTICS"
[147] ""
[148] " Variable/ Mean/ Skewness/ Minimum/ % with Percentiles"
[149] " Sample Size Variance Kurtosis Maximum Min/Max 20%/60% 40%/80% Median"
[150] ""
[151] " OUT1 -0.313 0.076 -1.830 0.83% -0.860 -0.496 -0.303"
[152] " 120.000 0.438 -0.286 1.375 0.83% -0.193 0.270"
[153] " Y1 0.639 -0.038 -4.214 0.01% -0.536 0.270 0.635"
[154] " 9600.000 1.953 -0.113 5.302 0.01% 1.001 1.840"
[155] " COV1 0.000 0.073 -2.484 0.83% -0.935 -0.383 -0.118"
[156] " 120.000 1.270 -0.724 2.059 0.83% 0.258 1.042"
[157] " COV2 0.000 0.141 -2.109 0.83% -0.976 -0.360 0.081"
[158] " 120.000 1.043 -0.442 2.862 0.83% 0.383 0.812"
[159] " Z1 -0.037 0.131 -2.734 0.83% -0.955 -0.280 0.055"
[160] " 120.000 0.996 0.353 2.820 0.83% 0.273 0.737"
[161] ""
[162] ""
[163] " WARNING: PROBLEMS OCCURRED IN SEVERAL ITERATIONS IN THE COMPUTATION OF THE STANDARDIZED ESTIMATES FOR SEVERAL"
[164] " CLUSTERS. THIS IS MOST LIKELY DUE TO AR COEFFICIENTS GREATER THAN 1 OR PARAMETERS GIVING NON-STATIONARY MODELS."
[165] " SUCH POSTERIOR DRAWS ARE REMOVED. THE FOLLOWING CLUSTERS HAD SUCH PROBLEMS:"
[166] " 1 11 29 35 47 80 82 83 106"
[167] ""
[168] "THE MODEL ESTIMATION TERMINATED NORMALLY"
[169] ""
[170] " USE THE FBITERATIONS OPTION TO INCREASE THE NUMBER OF ITERATIONS BY A FACTOR"
[171] " OF AT LEAST TWO TO CHECK CONVERGENCE AND THAT THE PSR VALUE DOES NOT INCREASE."
[172] ""
[173] ""
[174] ""
[175] "MODEL FIT INFORMATION"
[176] ""
[177] "Number of Free Parameters 23"
[178] ""
[179] "Information Criteria"
[180] ""
[181] " Deviance (DIC) 25214.064"
[182] " Estimated Number of Parameters (pD) 373.683"
[183] ""
[184] ""
[185] ""
[186] "MODEL RESULTS"
[187] ""
[188] " Posterior One-Tailed 95% C.I."
[189] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[190] ""
[191] "Within Level"
[192] ""
[193] "Between Level"
[194] ""
[195] " OUT1 ON"
[196] " AR1 -1.330 0.471 0.002 -2.310 -0.450 *"
[197] " AR2 -0.843 0.390 0.018 -1.631 -0.059 *"
[198] " LOGV1 0.298 0.308 0.165 -0.297 0.923"
[199] ""
[200] " Y1 ON"
[201] " COV1 0.182 0.079 0.010 0.030 0.340 *"
[202] " COV2 -0.131 0.088 0.068 -0.304 0.039"
[203] ""
[204] " OUT1 ON"
[205] " Y1 -0.002 0.055 0.482 -0.113 0.105"
[206] " Z1 0.379 0.046 0.000 0.285 0.470 *"
[207] ""
[208] " Y1 WITH"
[209] " AR1 0.005 0.021 0.410 -0.036 0.047"
[210] " AR2 0.085 0.025 0.000 0.043 0.138 *"
[211] " LOGV1 0.024 0.031 0.215 -0.036 0.085"
[212] ""
[213] " AR1 WITH"
[214] " AR2 0.008 0.004 0.021 0.000 0.017 *"
[215] " LOGV1 0.019 0.006 0.000 0.008 0.033 *"
[216] ""
[217] " AR2 WITH"
[218] " LOGV1 0.016 0.006 0.005 0.004 0.029 *"
[219] ""
[220] " Means"
[221] " AR1 0.168 0.018 0.000 0.133 0.203 *"
[222] " AR2 0.103 0.020 0.000 0.064 0.142 *"
[223] " LOGV1 -0.267 0.027 0.000 -0.320 -0.214 *"
[224] ""
[225] " Intercepts"
[226] " OUT1 0.092 0.155 0.280 -0.201 0.406"
[227] " Y1 0.644 0.097 0.000 0.455 0.837 *"
[228] ""
[229] " Variances"
[230] " AR1 0.029 0.006 0.000 0.019 0.042 *"
[231] " AR2 0.035 0.007 0.000 0.025 0.050 *"
[232] " LOGV1 0.063 0.012 0.000 0.042 0.089 *"
[233] ""
[234] " Residual Variances"
[235] " OUT1 0.228 0.035 0.000 0.167 0.305 *"
[236] " Y1 1.084 0.155 0.000 0.820 1.429 *"
[237] ""
[238] ""
[239] "STANDARDIZED MODEL RESULTS"
[240] ""
[241] ""
[242] "STDYX Standardization"
[243] ""
[244] " Posterior One-Tailed 95% C.I."
[245] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[246] ""
[247] "Within-Level Standardized Estimates Averaged Over Clusters"
[248] ""
[249] " AR1 | Y1 ON"
[250] " Y1&1 0.169 0.010 0.000 0.149 0.188 *"
[251] ""
[252] " AR2 | Y1 ON"
[253] " Y1&2 0.103 0.011 0.000 0.083 0.124 *"
[254] ""
[255] " LOGV1 |"
[256] " Y1 0.878 0.008 0.000 0.862 0.892 *"
[257] ""
[258] "Between Level"
[259] ""
[260] " OUT1 ON"
[261] " AR1 -0.358 0.119 0.002 -0.591 -0.126 *"
[262] " AR2 -0.253 0.114 0.018 -0.472 -0.017 *"
[263] " LOGV1 0.119 0.123 0.165 -0.116 0.363"
[264] ""
[265] " Y1 ON"
[266] " COV1 0.137 0.058 0.010 0.023 0.251 *"
[267] " COV2 -0.090 0.060 0.068 -0.208 0.027"
[268] ""
[269] " OUT1 ON"
[270] " Y1 -0.003 0.093 0.482 -0.190 0.179"
[271] " Z1 0.431 0.050 0.000 0.325 0.523 *"
[272] ""
[273] " Y1 WITH"
[274] " AR1 0.027 0.116 0.410 -0.200 0.253"
[275] " AR2 0.435 0.098 0.000 0.237 0.615 *"
[276] " LOGV1 0.090 0.115 0.215 -0.138 0.312"
[277] ""
[278] " AR1 WITH"
[279] " AR2 0.260 0.127 0.021 0.007 0.501 *"
[280] " LOGV1 0.457 0.122 0.000 0.193 0.675 *"
[281] ""
[282] " AR2 WITH"
[283] " LOGV1 0.333 0.121 0.005 0.081 0.553 *"
[284] ""
[285] " Means"
[286] " AR1 1.008 0.147 0.000 0.731 1.319 *"
[287] " AR2 0.556 0.116 0.000 0.326 0.785 *"
[288] " LOGV1 -1.081 0.150 0.000 -1.384 -0.802 *"
[289] ""
[290] " Intercepts"
[291] " OUT1 0.145 0.247 0.280 -0.326 0.639"
[292] " Y1 0.612 0.100 0.000 0.419 0.811 *"
[293] ""
[294] " Variances"
[295] " AR1 1.000 0.000 0.000 1.000 1.000"
[296] " AR2 1.000 0.000 0.000 1.000 1.000"
[297] " LOGV1 1.000 0.000 0.000 1.000 1.000"
[298] ""
[299] " Residual Variances"
[300] " OUT1 0.590 0.069 0.000 0.451 0.723 *"
[301] " Y1 0.966 0.020 0.000 0.918 0.996 *"
[302] ""
[303] ""
Code
comp <- mplus_mlts_compare(mplus = mplus, mlts = fit, fe_rows = c(18,14:16),
re_rows = c(23,19:21),
re.pred = c(4:5), out.pred = c(6,1:3,7,17,22))
comp_tab(comp)Type | Param | True | mlts | Mplus | ||||
|---|---|---|---|---|---|---|---|---|
Est | 95% CI | CI Width | Est | 95% CI | CI Width | |||
Fixed effect | mu_1 | 0.50 | 0.64 | [0.46, 0.83] | 0.37 | 0.64 | [0.46, 0.84] | 0.38 |
phi(1)_11 | 0.15 | 0.17 | [0.13, 0.20] | 0.07 | 0.17 | [0.13, 0.20] | 0.07 | |
phi(2)_11 | 0.07 | 0.11 | [0.07, 0.14] | 0.07 | 0.10 | [0.06, 0.14] | 0.08 | |
ln.sigma2_1 | -0.30 | -0.27 | [-0.32, -0.22] | 0.11 | -0.27 | [-0.32, -0.21] | 0.11 | |
Random effect SD | sigma_mu_1 | 1.00 | 1.01 | [0.89, 1.15] | 0.26 | 1.04 | [0.91, 1.20] | 0.29 |
sigma_phi(1)_11 | 0.15 | 0.16 | [0.13, 0.19] | 0.07 | 0.17 | [0.14, 0.20] | 0.07 | |
sigma_phi(2)_11 | 0.15 | 0.18 | [0.15, 0.22] | 0.06 | 0.19 | [0.16, 0.22] | 0.07 | |
sigma_ln.sigma2_1 | 0.25 | 0.23 | [0.19, 0.28] | 0.09 | 0.25 | [0.20, 0.30] | 0.09 | |
RE correlation | r_mu_1.phi(1)_11 | 0.15 | 0.05 | [-0.18, 0.28] | 0.46 | 0.03 | [-0.20, 0.25] | 0.45 |
r_mu_1.phi(2)_11 | 0.20 | 0.42 | [0.23, 0.60] | 0.37 | 0.43 | [0.24, 0.62] | 0.38 | |
r_mu_1.ln.sigma2_1 | -0.05 | 0.10 | [-0.12, 0.32] | 0.44 | 0.09 | [-0.14, 0.31] | 0.45 | |
r_phi(1)_11.phi(2)_11 | 0.15 | 0.26 | [0.02, 0.51] | 0.49 | 0.26 | [0.01, 0.50] | 0.49 | |
r_phi(1)_11.ln.sigma2_1 | 0.15 | 0.45 | [0.20, 0.68] | 0.48 | 0.46 | [0.19, 0.68] | 0.48 | |
r_phi(2)_11.ln.sigma2_1 | 0.05 | 0.32 | [0.08, 0.55] | 0.47 | 0.33 | [0.08, 0.55] | 0.47 | |
RE prediction | b_mu_1.ON.cov1 | 0.15 | 0.18 | [0.03, 0.34] | 0.31 | 0.18 | [0.03, 0.34] | 0.31 |
b_mu_1.ON.cov2 | -0.20 | -0.14 | [-0.30, 0.04] | 0.34 | -0.13 | [-0.30, 0.04] | 0.34 | |
Outcome prediction | alpha_Out1 | 0.00 | 0.10 | [-0.22, 0.44] | 0.66 | 0.09 | [-0.20, 0.41] | 0.61 |
b_Out1.ON.mu_1 | 0.00 | 0.00 | [-0.10, 0.11] | 0.22 | -0.00 | [-0.11, 0.10] | 0.22 | |
b_Out1.ON.phi(1)_11 | -1.00 | -1.36 | [-2.46, -0.42] | 2.04 | -1.33 | [-2.31, -0.45] | 1.86 | |
b_Out1.ON.phi(2)_11 | -1.50 | -0.86 | [-1.71, -0.05] | 1.66 | -0.84 | [-1.63, -0.06] | 1.57 | |
b_Out1.ON.ln.sigma2_1 | 0.00 | 0.31 | [-0.33, 1.00] | 1.34 | 0.30 | [-0.30, 0.92] | 1.22 | |
b_Out1.ON.Z1 | 0.30 | 0.38 | [0.29, 0.47] | 0.18 | 0.38 | [0.28, 0.47] | 0.18 | |
sigma_Out1 | 0.50 | 0.47 | [0.41, 0.55] | 0.14 | 0.48 | [0.41, 0.55] | 0.14 | |
Code
P <- mplus_mlts_comp_plot(comp)
P[[1]]
P[[2]]
P[[3]]Parameters with absolute posterior mean difference larger than 0.01:
Code
mplus_mlts_diff(comp, tol = 0.01)Param | True | mlts | Mplus | Diff |
|---|---|---|---|---|
Est | Est | |||
sigma_mu_1 | 1.00 | 1.01 | 1.04 | -0.03 |
b_Out1.ON.phi(1)_11 | -1.00 | -1.36 | -1.33 | -0.03 |
b_Out1.ON.phi(2)_11 | -1.50 | -0.86 | -0.84 | -0.02 |
r_mu_1.phi(1)_11 | 0.15 | 0.05 | 0.03 | 0.02 |
sigma_ln.sigma2_1 | 0.25 | 0.23 | 0.25 | -0.02 |
r_phi(2)_11.ln.sigma2_1 | 0.05 | 0.32 | 0.33 | -0.01 |
b_Out1.ON.ln.sigma2_1 | 0.00 | 0.31 | 0.30 | 0.01 |
sigma_phi(1)_11 | 0.15 | 0.16 | 0.17 | -0.01 |
r_mu_1.phi(2)_11 | 0.20 | 0.42 | 0.43 | -0.01 |
Between-Level Standardized
mplus$parameters$stdyx.standardized[c(7:8,9,4,5,6,10),c(1:4,6,7)] paramHeader param est posterior_sd lower_2.5ci upper_2.5ci
7 Y1.ON COV1 0.137 0.058 0.023 0.251
8 Y1.ON COV2 -0.090 0.060 -0.208 0.027
9 OUT1.ON Y1 -0.003 0.093 -0.190 0.179
4 OUT1.ON AR1 -0.358 0.119 -0.591 -0.126
5 OUT1.ON AR2 -0.253 0.114 -0.472 -0.017
6 OUT1.ON LOGV1 0.119 0.123 -0.116 0.363
10 OUT1.ON Z1 0.431 0.050 0.325 0.523
mlts_standardized(object = fit, what = "between")$`Between-level standardized`
Type Param Std.Est SD 2.5% 97.5%
1 RE prediction b_mu_1.ON.cov1 0.196 0.081 0.032 0.351
2 RE prediction b_mu_1.ON.cov2 -0.132 0.084 -0.288 0.037
3 Outcome prediction b_Out1.ON.mu_1 0.008 0.088 -0.164 0.178
4 Outcome prediction b_Out1.ON.phi(1)_11 -0.325 0.116 -0.560 -0.102
5 Outcome prediction b_Out1.ON.phi(2)_11 -0.234 0.112 -0.456 -0.013
6 Outcome prediction b_Out1.ON.ln.sigma2_1 0.109 0.118 -0.116 0.350
7 Outcome prediction b_Out1.ON.Z1 0.572 0.069 0.434 0.710
Within-Level Standardized
mplus$parameters$stdyx.standardized[1:2,c(1:4,6,7)] paramHeader param est posterior_sd lower_2.5ci upper_2.5ci
1 AR1|Y1.ON Y1&1 0.169 0.010 0.149 0.188
2 AR2|Y1.ON Y1&2 0.103 0.011 0.083 0.124
mlts_standardized(object = fit, what = "within")$`Within-level standardized effects averaged over clusters`
Type Param Std.Est SD 2.5% 97.5%
1 Fixed effect phi(1)_11 0.166 0.010 0.146 0.186
2 Fixed effect phi(2)_11 0.106 0.011 0.085 0.127
3 Three-Indicator AR(1)
3.1 Common Between Factor
fit = mlts_fit(
model = model,
data = simData,
ts = c("Y1.1","Y1.2","Y1.3"),
cores = n_cores,
chains = n_chains,
iter = n_iter,
seed = mod.id,
monitor_person_pars = T,
get_SD_latent = TRUE
)Model estimation ended after 23.94 minutes.
summary(fit, digits = 2)Time series variables as indicated by parameter subscripts:
1 --> Y1.1 + Y1.2 + Y1.3
Data: 10000 observations in 100 IDs
Model convergence criteria:
Maximum Potential Scale Reduction Factor (PSR; Rhat): 1.037 (should be < 1.01)
Minimum Bulk ESS: 142 (should be > 400, 100 per chain)
Minimum Tail ESS: 124 (should be > 400, 100 per chain)
Number of divergent transitions: 0 (should be 0)
Posterior Summary Statistics
Fixed Effects:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
etaB_1 0.70 0.08 0.55 0.85 1 6022 3437
phi(1)_11 0.22 0.02 0.18 0.26 1 5559 4076
ln.sigma2_1 -0.29 0.03 -0.35 -0.23 1 5267 3974
Random Effects SDs:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
sigma_etaB_1 0.77 0.06 0.67 0.89 1 3956 3467
sigma_phi(1)_11 0.15 0.02 0.12 0.18 1 3001 3562
sigma_ln.sigma2_1 0.26 0.02 0.21 0.31 1 3997 4354
Random Effects Correlations:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
etaB_1.phi(1)_11 -0.20 0.12 -0.43 0.03 1 3562 4294
etaB_1.ln.sigma2_1 0.00 0.12 -0.24 0.23 1 4704 4202
phi(1)_11.ln.sigma2_1 -0.05 0.14 -0.33 0.22 1 3341 3612
Measurement Model Parameters:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
alpha_1.1 0.00 0.00 0.00 0.00 1 5000 5000
alpha_1.2 0.45 0.03 0.39 0.50 1 5469 3797
alpha_1.3 1.04 0.02 1.00 1.08 1 5949 3240
lambdaB_1.1 1.00 0.00 1.00 1.00 1 5000 5000
lambdaB_1.2 0.81 0.03 0.76 0.86 1 4596 3673
lambdaB_1.3 0.77 0.02 0.72 0.81 1 4785 3156
lambdaW_1.1 1.00 0.00 1.00 1.00 1 5000 5000
lambdaW_1.2 0.85 0.00 0.84 0.86 1 3616 3860
lambdaW_1.3 0.85 0.00 0.84 0.86 1 3761 3886
sigmaB_1.1 0.00 0.00 0.00 0.00 1 5000 5000
sigmaB_1.2 0.20 0.02 0.17 0.23 1 9262 2794
sigmaB_1.3 0.14 0.01 0.12 0.17 1 7680 3106
sigmaW_1.1 0.26 0.00 0.26 0.27 1 1611 2403
sigmaW_1.2 0.29 0.00 0.29 0.30 1 4150 4196
sigmaW_1.3 0.30 0.00 0.29 0.31 1 4240 3831
Samples were drawn using NUTS on Wed Dec 10 22:34:10 2025.
For each parameter, Bulk_ESS and Tail_ESS are measures of effective
sample size, and Rhat is the potential scale reduction factor
on split chains (at convergence, Rhat = 1).
Code
# save data for Mplus
mplus = simData$data
colnames(mplus) <- NULL
write.table(mplus, file = paste0("Mplus/",mod.id,"_data.dat"), row.names = F)
file = paste0("Mplus/",mod.id,"_mplus_model.inp")
if(refit.mplus == T){
# run mplus model
runModels(target = file, showOutput = T, quiet = F)
}
# load results
mplus = readModels(target = paste0("Mplus/",mod.id,"_mplus_model.out"),
what = "parameters")
# full results
readLines(gsub(file,pattern=".inp",replacement=".out"))[1:269] [1] "Mplus VERSION 8.7"
[2] "MUTHEN & MUTHEN"
[3] "12/10/2025 10:34 PM"
[4] ""
[5] "INPUT INSTRUCTIONS"
[6] ""
[7] " DATA: file = 3.1_data.dat;"
[8] ""
[9] " VARIABLE:"
[10] " names = ID beep Y1_1 Y1_2 Y1_3;"
[11] " usevar = Y1_1 Y1_2 Y1_3;"
[12] " cluster = ID;"
[13] " missing = all(-99);"
[14] ""
[15] " ANALYSIS: TYPE = twolevel random;"
[16] " point = mean;"
[17] " estimator = bayes;"
[18] " proc = 2;"
[19] " Biterations = (20000);"
[20] " Bconvergence = .025;"
[21] " bseed = 12345;"
[22] " thin = 1;"
[23] ""
[24] " MODEL:"
[25] " %WITHIN%"
[26] " F BY Y1_1 Y1_2 Y1_3 (&1);"
[27] " AR1 | F on F&1;"
[28] ""
[29] " ! random residual variance by cluster"
[30] " logv1 | F;"
[31] ""
[32] " %BETWEEN%"
[33] " Fb by Y1_1 Y1_2 Y1_3;"
[34] " [Fb*];"
[35] " Y1_1@0;"
[36] " [Y1_1@0];"
[37] " Fb AR1 logv1 with Fb AR1 logv1;"
[38] ""
[39] ""
[40] " OUTPUT: TECH1 TECH8 stdyx(cluster); ! fscomparison;"
[41] ""
[42] " PLOT: TYPE = PLOT3 PLOT2;"
[43] " ! FACTORS = ALL;"
[44] ""
[45] ""
[46] ""
[47] "INPUT READING TERMINATED NORMALLY"
[48] ""
[49] ""
[50] ""
[51] ""
[52] "SUMMARY OF ANALYSIS"
[53] ""
[54] "Number of groups 1"
[55] "Number of observations 10000"
[56] ""
[57] "Number of dependent variables 3"
[58] "Number of independent variables 0"
[59] "Number of continuous latent variables 5"
[60] ""
[61] "Observed dependent variables"
[62] ""
[63] " Continuous"
[64] " Y1_1 Y1_2 Y1_3"
[65] ""
[66] "Continuous latent variables"
[67] " F F&1 FB AR1 LOGV1"
[68] ""
[69] "Variables with special functions"
[70] ""
[71] " Cluster variable ID"
[72] ""
[73] "Estimator BAYES"
[74] "Specifications for Bayesian Estimation"
[75] " Point estimate MEAN"
[76] " Number of Markov chain Monte Carlo (MCMC) chains 2"
[77] " Random seed for the first chain 12345"
[78] " Starting value information UNPERTURBED"
[79] " Algorithm used for Markov chain Monte Carlo GIBBS(PX1)"
[80] " Convergence criterion 0.250D-01"
[81] " Maximum number of iterations 50000"
[82] " K-th iteration used for thinning 1"
[83] ""
[84] "Input data file(s)"
[85] " 3.1_data.dat"
[86] "Input data format FREE"
[87] ""
[88] ""
[89] "SUMMARY OF DATA"
[90] ""
[91] " Number of clusters 100"
[92] ""
[93] " Size (s) Cluster ID with Size s"
[94] ""
[95] " 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21"
[96] " 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39"
[97] " 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57"
[98] " 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75"
[99] " 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93"
[100] " 94 95 96 97 98 99 100"
[101] ""
[102] ""
[103] ""
[104] "COVARIANCE COVERAGE OF DATA"
[105] ""
[106] "Minimum covariance coverage value 0.100"
[107] ""
[108] " Number of missing data patterns 1"
[109] ""
[110] ""
[111] " PROPORTION OF DATA PRESENT"
[112] ""
[113] ""
[114] " Covariance Coverage"
[115] " Y1_1 Y1_2 Y1_3"
[116] " ________ ________ ________"
[117] " Y1_1 1.000"
[118] " Y1_2 1.000 1.000"
[119] " Y1_3 1.000 1.000 1.000"
[120] ""
[121] ""
[122] ""
[123] "UNIVARIATE SAMPLE STATISTICS"
[124] ""
[125] ""
[126] " UNIVARIATE HIGHER-ORDER MOMENT DESCRIPTIVE STATISTICS"
[127] ""
[128] " Variable/ Mean/ Skewness/ Minimum/ % with Percentiles"
[129] " Sample Size Variance Kurtosis Maximum Min/Max 20%/60% 40%/80% Median"
[130] ""
[131] " Y1_1 0.699 0.018 -3.773 0.01% -0.326 0.400 0.702"
[132] " 10000.000 1.458 -0.043 5.122 0.01% 1.003 1.710"
[133] " Y1_2 1.014 -0.005 -2.886 0.01% 0.126 0.764 1.018"
[134] " 10000.000 1.089 -0.057 5.015 0.01% 1.280 1.896"
[135] " Y1_3 1.576 0.018 -1.984 0.01% 0.731 1.319 1.576"
[136] " 10000.000 1.040 0.079 5.782 0.01% 1.835 2.429"
[137] ""
[138] ""
[139] "THE MODEL ESTIMATION TERMINATED NORMALLY"
[140] ""
[141] " USE THE FBITERATIONS OPTION TO INCREASE THE NUMBER OF ITERATIONS BY A FACTOR"
[142] " OF AT LEAST TWO TO CHECK CONVERGENCE AND THAT THE PSR VALUE DOES NOT INCREASE."
[143] ""
[144] ""
[145] ""
[146] "MODEL FIT INFORMATION"
[147] ""
[148] "Number of Free Parameters 20"
[149] ""
[150] "Information Criteria"
[151] ""
[152] " Deviance (DIC) 19595.627"
[153] " Estimated Number of Parameters (pD) 9741.410"
[154] ""
[155] ""
[156] ""
[157] "MODEL RESULTS"
[158] ""
[159] " Posterior One-Tailed 95% C.I."
[160] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[161] ""
[162] "Within Level"
[163] ""
[164] " F BY"
[165] " Y1_1 1.000 0.000 0.000 1.000 1.000"
[166] " Y1_2 0.850 0.004 0.000 0.841 0.858 *"
[167] " Y1_3 0.854 0.004 0.000 0.845 0.862 *"
[168] ""
[169] " Residual Variances"
[170] " Y1_1 0.070 0.002 0.000 0.066 0.074 *"
[171] " Y1_2 0.086 0.002 0.000 0.083 0.090 *"
[172] " Y1_3 0.089 0.002 0.000 0.086 0.093 *"
[173] ""
[174] "Between Level"
[175] ""
[176] " FB BY"
[177] " Y1_1 1.000 0.000 0.000 1.000 1.000"
[178] " Y1_2 0.809 0.028 0.000 0.754 0.864 *"
[179] " Y1_3 0.765 0.020 0.000 0.726 0.805 *"
[180] ""
[181] " FB WITH"
[182] " AR1 -0.025 0.016 0.048 -0.058 0.005"
[183] " LOGV1 0.000 0.026 0.495 -0.050 0.051"
[184] ""
[185] " AR1 WITH"
[186] " LOGV1 -0.002 0.006 0.375 -0.014 0.010"
[187] ""
[188] " Means"
[189] " FB 0.700 0.079 0.000 0.544 0.854 *"
[190] " AR1 0.220 0.019 0.000 0.183 0.257 *"
[191] " LOGV1 -0.294 0.032 0.000 -0.356 -0.232 *"
[192] ""
[193] " Intercepts"
[194] " Y1_1 0.000 0.000 1.000 0.000 0.000"
[195] " Y1_2 0.449 0.029 0.000 0.392 0.505 *"
[196] " Y1_3 1.042 0.021 0.000 1.001 1.082 *"
[197] ""
[198] " Variances"
[199] " FB 0.610 0.094 0.000 0.452 0.819 *"
[200] " AR1 0.024 0.005 0.000 0.016 0.036 *"
[201] " LOGV1 0.072 0.014 0.000 0.048 0.104 *"
[202] ""
[203] " Residual Variances"
[204] " Y1_1 0.001 0.000 0.000 0.001 0.001"
[205] " Y1_2 0.040 0.006 0.000 0.030 0.054 *"
[206] " Y1_3 0.021 0.003 0.000 0.015 0.028 *"
[207] ""
[208] ""
[209] "STANDARDIZED MODEL RESULTS"
[210] ""
[211] ""
[212] "STDYX Standardization"
[213] ""
[214] " Posterior One-Tailed 95% C.I."
[215] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[216] ""
[217] "Within-Level Standardized Estimates Averaged Over Clusters"
[218] ""
[219] " F BY"
[220] " Y1_1 0.958 0.001 0.000 0.955 0.960 *"
[221] " Y1_2 0.931 0.002 0.000 0.928 0.935 *"
[222] " Y1_3 0.930 0.002 0.000 0.926 0.933 *"
[223] ""
[224] " AR1 | F ON"
[225] " F&1 0.219 0.011 0.000 0.199 0.241 *"
[226] ""
[227] " LOGV1 |"
[228] " F 0.930 0.006 0.000 0.918 0.940 *"
[229] ""
[230] " Residual Variances"
[231] " Y1_1 0.082 0.003 0.000 0.077 0.087 *"
[232] " Y1_2 0.132 0.003 0.000 0.126 0.139 *"
[233] " Y1_3 0.135 0.003 0.000 0.129 0.141 *"
[234] ""
[235] "Between Level"
[236] ""
[237] " FB BY"
[238] " Y1_1 1.000 0.000 0.000 1.000 1.000"
[239] " Y1_2 0.952 0.010 0.000 0.929 0.969 *"
[240] " Y1_3 0.972 0.006 0.000 0.958 0.982 *"
[241] ""
[242] " FB WITH"
[243] " AR1 -0.206 0.121 0.048 -0.438 0.039"
[244] " LOGV1 -0.001 0.120 0.495 -0.232 0.233"
[245] ""
[246] " AR1 WITH"
[247] " LOGV1 -0.044 0.141 0.375 -0.320 0.231"
[248] ""
[249] " Means"
[250] " FB 0.904 0.123 0.000 0.666 1.148 *"
[251] " AR1 1.435 0.197 0.000 1.074 1.845 *"
[252] " LOGV1 -1.108 0.158 0.000 -1.430 -0.810 *"
[253] ""
[254] " Intercepts"
[255] " Y1_1 0.000 0.000 1.000 0.000 0.000"
[256] " Y1_2 0.683 0.077 0.000 0.541 0.843 *"
[257] " Y1_3 1.709 0.142 0.000 1.443 2.000 *"
[258] ""
[259] " Variances"
[260] " FB 1.000 0.000 0.000 1.000 1.000"
[261] " AR1 1.000 0.000 0.000 1.000 1.000"
[262] " LOGV1 1.000 0.000 0.000 1.000 1.000"
[263] ""
[264] " Residual Variances"
[265] " Y1_1 0.000 0.000 1.000 0.000 0.000"
[266] " Y1_2 0.093 0.019 0.000 0.061 0.136 *"
[267] " Y1_3 0.056 0.012 0.000 0.036 0.083 *"
[268] ""
[269] ""
Code
comp <- mplus_mlts_compare(
mplus = mplus, mlts = fit,
fe_rows = c(13:15), re_rows = c(19:21),
mm.ints = c(16:18), mm.loads = c(7:9,1:3),
mm.sigma = c(22:24,4:6))
comp_tab(comp)Type | Param | True | mlts | Mplus | ||||
|---|---|---|---|---|---|---|---|---|
Est | 95% CI | CI Width | Est | 95% CI | CI Width | |||
Fixed effect | etaB_1 | 0.70 | 0.70 | [0.55, 0.85] | 0.30 | 0.70 | [0.54, 0.85] | 0.31 |
phi(1)_11 | 0.20 | 0.22 | [0.18, 0.26] | 0.07 | 0.22 | [0.18, 0.26] | 0.07 | |
ln.sigma2_1 | -0.30 | -0.29 | [-0.36, -0.23] | 0.12 | -0.29 | [-0.36, -0.23] | 0.12 | |
Random effect SD | sigma_etaB_1 | 0.70 | 0.77 | [0.67, 0.89] | 0.23 | 0.78 | [0.67, 0.90] | 0.23 |
sigma_phi(1)_11 | 0.15 | 0.15 | [0.12, 0.18] | 0.06 | 0.15 | [0.13, 0.19] | 0.06 | |
sigma_ln.sigma2_1 | 0.25 | 0.26 | [0.21, 0.31] | 0.10 | 0.27 | [0.22, 0.32] | 0.10 | |
RE correlation | r_etaB_1.phi(1)_11 | -0.15 | -0.20 | [-0.43, 0.03] | 0.46 | -0.21 | [-0.44, 0.04] | 0.48 |
r_etaB_1.ln.sigma2_1 | -0.15 | -0.00 | [-0.24, 0.23] | 0.46 | -0.00 | [-0.23, 0.23] | 0.47 | |
r_phi(1)_11.ln.sigma2_1 | -0.15 | -0.05 | [-0.33, 0.22] | 0.55 | -0.04 | [-0.32, 0.23] | 0.55 | |
Item intercepts | alpha_1.1 | 0.00 | 0.00 | [0.00, 0.00] | 0.00 | 0.00 | [0.00, 0.00] | 0.00 |
alpha_1.2 | 0.50 | 0.45 | [0.39, 0.50] | 0.11 | 0.45 | [0.39, 0.50] | 0.11 | |
alpha_1.3 | 1.00 | 1.04 | [1.00, 1.08] | 0.09 | 1.04 | [1.00, 1.08] | 0.08 | |
Loading | lambdaB_1.1 | 1.00 | 1.00 | [1.00, 1.00] | 0.00 | 1.00 | [1.00, 1.00] | 0.00 |
lambdaB_1.2 | 0.75 | 0.81 | [0.76, 0.86] | 0.11 | 0.81 | [0.75, 0.86] | 0.11 | |
lambdaB_1.3 | 0.80 | 0.77 | [0.72, 0.81] | 0.08 | 0.76 | [0.73, 0.80] | 0.08 | |
Measurement Error SD | sigmaB_1.1 | 0.00 | 0.00 | [0.00, 0.00] | 0.00 | 0.03 | [0.03, 0.03] | 0.00 |
sigmaB_1.2 | 0.20 | 0.20 | [0.17, 0.23] | 0.06 | 0.20 | [0.17, 0.23] | 0.06 | |
sigmaB_1.3 | 0.15 | 0.14 | [0.12, 0.17] | 0.04 | 0.14 | [0.12, 0.17] | 0.05 | |
Loading | lambdaW_1.1 | 1.00 | 1.00 | [1.00, 1.00] | 0.00 | 1.00 | [1.00, 1.00] | 0.00 |
lambdaW_1.2 | 0.85 | 0.85 | [0.84, 0.86] | 0.02 | 0.85 | [0.84, 0.86] | 0.02 | |
lambdaW_1.3 | 0.85 | 0.85 | [0.84, 0.86] | 0.02 | 0.85 | [0.84, 0.86] | 0.02 | |
Measurement Error SD | sigmaW_1.1 | 0.25 | 0.26 | [0.26, 0.27] | 0.02 | 0.26 | [0.26, 0.27] | 0.02 |
sigmaW_1.2 | 0.30 | 0.29 | [0.29, 0.30] | 0.01 | 0.29 | [0.29, 0.30] | 0.01 | |
sigmaW_1.3 | 0.30 | 0.30 | [0.29, 0.30] | 0.01 | 0.30 | [0.29, 0.30] | 0.01 | |
Code
P <- mplus_mlts_comp_plot(comp)
P[[1]]
P[[2]]
P[[3]]
P[[4]]
P[[5]]
P[[6]]Parameters with absolute posterior mean difference larger than 0.01:
Code
mplus_mlts_diff(comp, tol = 0.01)Param | True | mlts | Mplus | Diff |
|---|---|---|---|---|
Est | Est | |||
sigmaB_1.1 | 0.00 | 0.00 | 0.03 | -0.03 |
sigma_etaB_1 | 0.70 | 0.77 | 0.78 | -0.01 |
sigma_ln.sigma2_1 | 0.25 | 0.26 | 0.27 | -0.01 |
Within-Level Standardized Effects
mplus$parameters$stdyx.standardized[c(4),c(1:4,6,7)] paramHeader param est posterior_sd lower_2.5ci upper_2.5ci
4 AR1|F.ON F&1 0.219 0.011 0.199 0.241
mlts_standardized(object = fit, what = "within")$`Within-level standardized effects averaged over clusters`
Type Param Std.Est SD 2.5% 97.5%
1 Fixed effect phi(1)_11 0.219 0.011 0.199 0.24
3.2 Indicator-Specific Traits
fit = mlts_fit(
model = model,
data = simData,
ts = c("Y1.1","Y1.2","Y1.3"),
cores = n_cores,
chains = n_chains,
iter = n_iter,
seed = mod.id,
monitor_person_pars = T,
get_SD_latent = TRUE
)Model estimation ended after 18.54 minutes.
summary(fit, digits = 2)Time series variables as indicated by parameter subscripts:
1 --> Y1.1 + Y1.2 + Y1.3
Data: 9000 observations in 150 IDs
Model convergence criteria:
Maximum Potential Scale Reduction Factor (PSR; Rhat): 1.07 (should be < 1.01)
Minimum Bulk ESS: 47 (should be > 400, 100 per chain)
Minimum Tail ESS: 78 (should be > 400, 100 per chain)
Number of divergent transitions: 0 (should be 0)
Posterior Summary Statistics
Fixed Effects:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1.1 0.81 0.09 0.63 0.99 1 4330 3812
mu_1.2 0.65 0.07 0.50 0.79 1 4553 3452
mu_1.3 0.93 0.08 0.78 1.07 1 5403 3078
phi(1)_11 0.32 0.02 0.29 0.35 1 2550 3312
ln.sigma2_1 -0.23 0.03 -0.29 -0.18 1 2705 3705
Random Effects SDs:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
sigma_mu_1.1 1.15 0.07 1.02 1.30 1 2224 3467
sigma_mu_1.2 0.90 0.05 0.81 1.02 1 2557 2985
sigma_mu_1.3 0.91 0.06 0.81 1.03 1 2826 3140
sigma_phi(1)_11 0.15 0.02 0.12 0.18 1 1165 1905
sigma_ln.sigma2_1 0.25 0.02 0.21 0.30 1 1840 2726
Random Effects Correlations:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1.1.mu_1.2 -0.20 0.08 -0.36 -0.04 1 1635 3314
mu_1.1.mu_1.3 -0.13 0.08 -0.28 0.03 1 3717 3525
mu_1.1.phi(1)_11 -0.18 0.11 -0.38 0.03 1 1729 3606
mu_1.1.ln.sigma2_1 -0.10 0.10 -0.29 0.11 1 2465 2925
mu_1.2.mu_1.3 -0.16 0.08 -0.31 0.01 1 2493 3152
mu_1.2.phi(1)_11 -0.25 0.10 -0.44 -0.03 1 1902 3667
mu_1.2.ln.sigma2_1 0.16 0.10 -0.04 0.36 1 2444 3469
mu_1.3.phi(1)_11 0.15 0.11 -0.05 0.35 1 2859 3144
mu_1.3.ln.sigma2_1 -0.17 0.10 -0.36 0.02 1 2832 4021
phi(1)_11.ln.sigma2_1 -0.07 0.14 -0.34 0.19 1 1449 2239
Measurement Model Parameters:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
lambdaW_1.1 1.00 0 1.00 1.00 1 5000 5000
lambdaW_1.2 0.90 0 0.89 0.91 1 1589 3240
lambdaW_1.3 0.75 0 0.74 0.75 1 2662 3587
sigmaW_1.1 0.31 0 0.30 0.31 1 2088 3530
sigmaW_1.2 0.25 0 0.24 0.26 1 1623 2538
sigmaW_1.3 0.30 0 0.29 0.30 1 4843 3752
Samples were drawn using NUTS on Wed Dec 10 22:57:47 2025.
For each parameter, Bulk_ESS and Tail_ESS are measures of effective
sample size, and Rhat is the potential scale reduction factor
on split chains (at convergence, Rhat = 1).
Code
# save data for Mplus
mplus = simData$data
colnames(mplus) <- NULL
write.table(mplus, file = paste0("Mplus/",mod.id,"_data.dat"), row.names = F)
file = paste0("Mplus/",mod.id,"_mplus_model.inp")
if(refit.mplus == T){
# run mplus model
runModels(target = file, showOutput = T, quiet = F)
}
# load results
mplus = readModels(target = paste0("Mplus/",mod.id,"_mplus_model.out"),
what = "parameters")
# full results
readLines(gsub(file,pattern=".inp",replacement=".out"))[1:277] [1] "Mplus VERSION 8.7"
[2] "MUTHEN & MUTHEN"
[3] "12/10/2025 10:59 PM"
[4] ""
[5] "INPUT INSTRUCTIONS"
[6] ""
[7] " DATA: file = 3.2_data.dat;"
[8] ""
[9] " VARIABLE:"
[10] " names = ID beep Y1_1 Y1_2 Y1_3;"
[11] " usevar = Y1_1 Y1_2 Y1_3;"
[12] " cluster = ID;"
[13] " missing = all(-99);"
[14] ""
[15] " ANALYSIS: TYPE = twolevel random;"
[16] " point = mean;"
[17] " estimator = bayes;"
[18] " proc = 2;"
[19] " Biterations = (20000);"
[20] " Bconvergence = .025;"
[21] " bseed = 12345;"
[22] " thin = 1;"
[23] ""
[24] " MODEL:"
[25] " %WITHIN%"
[26] " F BY Y1_1 Y1_2 Y1_3 (&1);"
[27] " AR1 | F on F&1;"
[28] ""
[29] " ! random residual variance by cluster"
[30] " logv1 | F;"
[31] ""
[32] " %BETWEEN%"
[33] " Y1_1 Y1_2 Y1_3 AR1 logv1 with Y1_1 Y1_2 Y1_3 AR1 logv1;"
[34] ""
[35] ""
[36] " OUTPUT: TECH1 TECH8 stdyx(cluster); ! fscomparison;"
[37] ""
[38] " PLOT: TYPE = PLOT3 PLOT2;"
[39] " ! FACTORS = ALL;"
[40] ""
[41] ""
[42] ""
[43] "INPUT READING TERMINATED NORMALLY"
[44] ""
[45] ""
[46] ""
[47] ""
[48] "SUMMARY OF ANALYSIS"
[49] ""
[50] "Number of groups 1"
[51] "Number of observations 9000"
[52] ""
[53] "Number of dependent variables 3"
[54] "Number of independent variables 0"
[55] "Number of continuous latent variables 4"
[56] ""
[57] "Observed dependent variables"
[58] ""
[59] " Continuous"
[60] " Y1_1 Y1_2 Y1_3"
[61] ""
[62] "Continuous latent variables"
[63] " F F&1 AR1 LOGV1"
[64] ""
[65] "Variables with special functions"
[66] ""
[67] " Cluster variable ID"
[68] ""
[69] "Estimator BAYES"
[70] "Specifications for Bayesian Estimation"
[71] " Point estimate MEAN"
[72] " Number of Markov chain Monte Carlo (MCMC) chains 2"
[73] " Random seed for the first chain 12345"
[74] " Starting value information UNPERTURBED"
[75] " Algorithm used for Markov chain Monte Carlo GIBBS(PX1)"
[76] " Convergence criterion 0.250D-01"
[77] " Maximum number of iterations 50000"
[78] " K-th iteration used for thinning 1"
[79] ""
[80] "Input data file(s)"
[81] " 3.2_data.dat"
[82] "Input data format FREE"
[83] ""
[84] ""
[85] "SUMMARY OF DATA"
[86] ""
[87] " Number of clusters 150"
[88] ""
[89] " Size (s) Cluster ID with Size s"
[90] ""
[91] " 60 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21"
[92] " 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39"
[93] " 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57"
[94] " 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75"
[95] " 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93"
[96] " 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108"
[97] " 109 110 111 112 113 114 115 116 117 118 119 120 121"
[98] " 122 123 124 125 126 127 128 129 130 131 132 133 134"
[99] " 135 136 137 138 139 140 141 142 143 144 145 146 147"
[100] " 148 149 150"
[101] ""
[102] ""
[103] ""
[104] "COVARIANCE COVERAGE OF DATA"
[105] ""
[106] "Minimum covariance coverage value 0.100"
[107] ""
[108] " Number of missing data patterns 1"
[109] ""
[110] ""
[111] " PROPORTION OF DATA PRESENT"
[112] ""
[113] ""
[114] " Covariance Coverage"
[115] " Y1_1 Y1_2 Y1_3"
[116] " ________ ________ ________"
[117] " Y1_1 1.000"
[118] " Y1_2 1.000 1.000"
[119] " Y1_3 1.000 1.000 1.000"
[120] ""
[121] ""
[122] ""
[123] "UNIVARIATE SAMPLE STATISTICS"
[124] ""
[125] ""
[126] " UNIVARIATE HIGHER-ORDER MOMENT DESCRIPTIVE STATISTICS"
[127] ""
[128] " Variable/ Mean/ Skewness/ Minimum/ % with Percentiles"
[129] " Sample Size Variance Kurtosis Maximum Min/Max 20%/60% 40%/80% Median"
[130] ""
[131] " Y1_1 0.807 0.010 -5.629 0.01% -0.457 0.420 0.816"
[132] " 9000.000 2.295 0.094 6.673 0.01% 1.203 2.069"
[133] " Y1_2 0.644 0.063 -3.777 0.01% -0.427 0.317 0.637"
[134] " 9000.000 1.611 -0.025 5.680 0.01% 0.954 1.708"
[135] " Y1_3 0.928 -0.115 -3.324 0.01% -0.083 0.654 0.958"
[136] " 9000.000 1.419 0.009 5.383 0.01% 1.248 1.932"
[137] ""
[138] ""
[139] "THE MODEL ESTIMATION TERMINATED NORMALLY"
[140] ""
[141] " USE THE FBITERATIONS OPTION TO INCREASE THE NUMBER OF ITERATIONS BY A FACTOR"
[142] " OF AT LEAST TWO TO CHECK CONVERGENCE AND THAT THE PSR VALUE DOES NOT INCREASE."
[143] ""
[144] ""
[145] ""
[146] "MODEL FIT INFORMATION"
[147] ""
[148] "Number of Free Parameters 25"
[149] ""
[150] "Information Criteria"
[151] ""
[152] " Deviance (DIC) 17326.216"
[153] " Estimated Number of Parameters (pD) 8906.059"
[154] ""
[155] ""
[156] ""
[157] "MODEL RESULTS"
[158] ""
[159] " Posterior One-Tailed 95% C.I."
[160] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[161] ""
[162] "Within Level"
[163] ""
[164] " F BY"
[165] " Y1_1 1.000 0.000 0.000 1.000 1.000"
[166] " Y1_2 0.899 0.004 0.000 0.890 0.908 *"
[167] " Y1_3 0.747 0.004 0.000 0.739 0.756 *"
[168] ""
[169] " Residual Variances"
[170] " Y1_1 0.094 0.002 0.000 0.089 0.098 *"
[171] " Y1_2 0.061 0.002 0.000 0.058 0.065 *"
[172] " Y1_3 0.089 0.002 0.000 0.086 0.093 *"
[173] ""
[174] "Between Level"
[175] ""
[176] " Y1_1 WITH"
[177] " AR1 -0.035 0.022 0.047 -0.080 0.006"
[178] " LOGV1 -0.029 0.034 0.196 -0.098 0.038"
[179] ""
[180] " Y1_2 WITH"
[181] " AR1 -0.038 0.017 0.010 -0.074 -0.006 *"
[182] " LOGV1 0.039 0.028 0.072 -0.015 0.095"
[183] ""
[184] " Y1_3 WITH"
[185] " AR1 0.022 0.017 0.091 -0.011 0.057"
[186] " LOGV1 -0.045 0.027 0.044 -0.101 0.007"
[187] ""
[188] " AR1 WITH"
[189] " LOGV1 -0.003 0.006 0.329 -0.015 0.009"
[190] ""
[191] " Y1_1 WITH"
[192] " Y1_2 -0.215 0.098 0.012 -0.413 -0.029 *"
[193] " Y1_3 -0.145 0.098 0.065 -0.343 0.041"
[194] ""
[195] " Y1_2 WITH"
[196] " Y1_3 -0.137 0.078 0.035 -0.295 0.012"
[197] ""
[198] " Means"
[199] " Y1_1 0.808 0.098 0.000 0.616 0.999 *"
[200] " Y1_2 0.645 0.077 0.000 0.492 0.796 *"
[201] " Y1_3 0.929 0.078 0.000 0.777 1.082 *"
[202] " AR1 0.318 0.017 0.000 0.285 0.352 *"
[203] " LOGV1 -0.240 0.028 0.000 -0.295 -0.185 *"
[204] ""
[205] " Variances"
[206] " Y1_1 1.392 0.173 0.000 1.092 1.771 *"
[207] " Y1_2 0.866 0.108 0.000 0.677 1.098 *"
[208] " Y1_3 0.881 0.109 0.000 0.693 1.120 *"
[209] " AR1 0.026 0.005 0.000 0.017 0.037 *"
[210] " LOGV1 0.072 0.013 0.000 0.049 0.100 *"
[211] ""
[212] ""
[213] "STANDARDIZED MODEL RESULTS"
[214] ""
[215] ""
[216] "STDYX Standardization"
[217] ""
[218] " Posterior One-Tailed 95% C.I."
[219] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[220] ""
[221] "Within-Level Standardized Estimates Averaged Over Clusters"
[222] ""
[223] " F BY"
[224] " Y1_1 0.951 0.002 0.000 0.948 0.954 *"
[225] " Y1_2 0.959 0.001 0.000 0.956 0.962 *"
[226] " Y1_3 0.920 0.002 0.000 0.916 0.924 *"
[227] ""
[228] " AR1 | F ON"
[229] " F&1 0.317 0.011 0.000 0.296 0.338 *"
[230] ""
[231] " LOGV1 |"
[232] " F 0.876 0.007 0.000 0.861 0.889 *"
[233] ""
[234] " Residual Variances"
[235] " Y1_1 0.096 0.003 0.000 0.090 0.102 *"
[236] " Y1_2 0.079 0.003 0.000 0.074 0.085 *"
[237] " Y1_3 0.153 0.004 0.000 0.146 0.160 *"
[238] ""
[239] "Between Level"
[240] ""
[241] " Y1_1 WITH"
[242] " AR1 -0.186 0.108 0.047 -0.393 0.033"
[243] " LOGV1 -0.090 0.106 0.196 -0.296 0.120"
[244] ""
[245] " Y1_2 WITH"
[246] " AR1 -0.257 0.107 0.010 -0.459 -0.040 *"
[247] " LOGV1 0.156 0.107 0.072 -0.060 0.360"
[248] ""
[249] " Y1_3 WITH"
[250] " AR1 0.149 0.109 0.091 -0.071 0.357"
[251] " LOGV1 -0.179 0.103 0.044 -0.376 0.027"
[252] ""
[253] " AR1 WITH"
[254] " LOGV1 -0.060 0.139 0.329 -0.331 0.214"
[255] ""
[256] " Y1_1 WITH"
[257] " Y1_2 -0.195 0.084 0.012 -0.355 -0.027 *"
[258] " Y1_3 -0.131 0.085 0.065 -0.295 0.037"
[259] ""
[260] " Y1_2 WITH"
[261] " Y1_3 -0.157 0.086 0.035 -0.322 0.014"
[262] ""
[263] " Means"
[264] " Y1_1 0.689 0.093 0.000 0.507 0.871 *"
[265] " Y1_2 0.697 0.093 0.000 0.516 0.879 *"
[266] " Y1_3 0.996 0.102 0.000 0.797 1.197 *"
[267] " AR1 2.004 0.230 0.000 1.586 2.491 *"
[268] " LOGV1 -0.907 0.132 0.000 -1.178 -0.658 *"
[269] ""
[270] " Variances"
[271] " Y1_1 1.000 0.000 0.000 1.000 1.000"
[272] " Y1_2 1.000 0.000 0.000 1.000 1.000"
[273] " Y1_3 1.000 0.000 0.000 1.000 1.000"
[274] " AR1 1.000 0.000 0.000 1.000 1.000"
[275] " LOGV1 1.000 0.000 0.000 1.000 1.000"
[276] ""
[277] ""
Code
comp <- mplus_mlts_compare(
mplus = mplus, mlts = fit,
fe_rows = c(17:21),re_rows = c(22:26),
mm.loads = c(1:3), mm.sigma = c(4:6))
comp_tab(comp)Type | Param | True | mlts | Mplus | ||||
|---|---|---|---|---|---|---|---|---|
Est | 95% CI | CI Width | Est | 95% CI | CI Width | |||
Fixed effect | mu_1.1 | 0.90 | 0.81 | [0.63, 0.99] | 0.36 | 0.81 | [0.62, 1.00] | 0.38 |
mu_1.2 | 0.70 | 0.64 | [0.50, 0.79] | 0.29 | 0.64 | [0.49, 0.80] | 0.30 | |
mu_1.3 | 1.00 | 0.93 | [0.78, 1.07] | 0.29 | 0.93 | [0.78, 1.08] | 0.31 | |
phi(1)_11 | 0.30 | 0.32 | [0.29, 0.35] | 0.06 | 0.32 | [0.28, 0.35] | 0.07 | |
ln.sigma2_1 | -0.30 | -0.23 | [-0.29, -0.18] | 0.11 | -0.24 | [-0.30, -0.18] | 0.11 | |
Random effect SD | sigma_mu_1.1 | 1.10 | 1.15 | [1.02, 1.30] | 0.28 | 1.18 | [1.04, 1.33] | 0.29 |
sigma_mu_1.2 | 0.90 | 0.90 | [0.81, 1.02] | 0.21 | 0.93 | [0.82, 1.05] | 0.23 | |
sigma_mu_1.3 | 1.00 | 0.91 | [0.81, 1.03] | 0.22 | 0.94 | [0.83, 1.06] | 0.23 | |
sigma_phi(1)_11 | 0.15 | 0.15 | [0.12, 0.18] | 0.06 | 0.16 | [0.13, 0.19] | 0.06 | |
sigma_ln.sigma2_1 | 0.25 | 0.25 | [0.21, 0.30] | 0.09 | 0.27 | [0.22, 0.32] | 0.10 | |
RE correlation | r_mu_1.1.mu_1.2 | -0.15 | -0.20 | [-0.36, -0.04] | 0.32 | -0.20 | [-0.36, -0.03] | 0.33 |
r_mu_1.1.mu_1.3 | -0.15 | -0.13 | [-0.28, 0.03] | 0.31 | -0.13 | [-0.30, 0.04] | 0.33 | |
r_mu_1.1.phi(1)_11 | -0.15 | -0.18 | [-0.38, 0.03] | 0.41 | -0.19 | [-0.39, 0.03] | 0.43 | |
r_mu_1.1.ln.sigma2_1 | -0.15 | -0.10 | [-0.30, 0.11] | 0.41 | -0.09 | [-0.30, 0.12] | 0.42 | |
r_mu_1.2.mu_1.3 | -0.20 | -0.16 | [-0.31, 0.00] | 0.32 | -0.16 | [-0.32, 0.01] | 0.34 | |
r_mu_1.2.phi(1)_11 | 0.00 | -0.25 | [-0.44, -0.04] | 0.41 | -0.26 | [-0.46, -0.04] | 0.42 | |
r_mu_1.2.ln.sigma2_1 | 0.05 | 0.16 | [-0.04, 0.36] | 0.40 | 0.16 | [-0.06, 0.36] | 0.42 | |
r_mu_1.3.phi(1)_11 | 0.10 | 0.15 | [-0.05, 0.35] | 0.40 | 0.15 | [-0.07, 0.36] | 0.43 | |
r_mu_1.3.ln.sigma2_1 | -0.15 | -0.17 | [-0.36, 0.02] | 0.39 | -0.18 | [-0.38, 0.03] | 0.40 | |
r_phi(1)_11.ln.sigma2_1 | 0.00 | -0.07 | [-0.34, 0.19] | 0.53 | -0.06 | [-0.33, 0.21] | 0.54 | |
Loading | lambdaW_1.1 | 1.00 | 1.00 | [1.00, 1.00] | 0.00 | 1.00 | [1.00, 1.00] | 0.00 |
lambdaW_1.2 | 0.90 | 0.90 | [0.89, 0.91] | 0.02 | 0.90 | [0.89, 0.91] | 0.02 | |
lambdaW_1.3 | 0.75 | 0.75 | [0.74, 0.75] | 0.02 | 0.75 | [0.74, 0.76] | 0.02 | |
Measurement Error SD | sigmaW_1.1 | 0.30 | 0.30 | [0.30, 0.31] | 0.02 | 0.31 | [0.30, 0.31] | 0.02 |
sigmaW_1.2 | 0.25 | 0.25 | [0.24, 0.26] | 0.01 | 0.25 | [0.24, 0.26] | 0.01 | |
sigmaW_1.3 | 0.30 | 0.30 | [0.29, 0.30] | 0.01 | 0.30 | [0.29, 0.30] | 0.01 | |
Code
P <- mplus_mlts_comp_plot(comp)
P[[1]]
P[[2]]
P[[3]]
P[[4]]
P[[5]]Parameters with absolute posterior mean difference larger than 0.01:
Code
mplus_mlts_diff(comp, tol = 0.01)Param | True | mlts | Mplus | Diff |
|---|---|---|---|---|
Est | Est | |||
sigma_mu_1.2 | 0.90 | 0.90 | 0.93 | -0.03 |
sigma_mu_1.1 | 1.10 | 1.15 | 1.18 | -0.03 |
sigma_mu_1.3 | 1.00 | 0.91 | 0.94 | -0.03 |
sigma_ln.sigma2_1 | 0.25 | 0.25 | 0.27 | -0.01 |
r_phi(1)_11.ln.sigma2_1 | 0.00 | -0.07 | -0.06 | -0.01 |
r_mu_1.2.phi(1)_11 | 0.00 | -0.25 | -0.26 | 0.01 |
Within-Level Standardized Effects
mplus$parameters$stdyx.standardized[c(4),c(1:4,6,7)] paramHeader param est posterior_sd lower_2.5ci upper_2.5ci
4 AR1|F.ON F&1 0.317 0.011 0.296 0.338
mlts_standardized(object = fit, what = "within")$`Within-level standardized effects averaged over clusters`
Type Param Std.Est SD 2.5% 97.5%
1 Fixed effect phi(1)_11 0.32 0.011 0.298 0.342
4 VAR(1) - independent innovations
mod.id = 5
# model specification
model <- mlts_model(
q = 2, # no. of time series variables
inno_covs_zero = TRUE # assume innovations to be iid
)
# generate data
simData <- mlts_sim(
model, N = 100, TP = 75,
default = T, seed = mod.id, seed.true = mod.id)
# path model
mlts_paths(model, remove_lag_lab = T)fit = mlts_fit(
model,
data = simData,
ts = c("Y1","Y2"),
cores = n_cores,
chains = n_chains,
iter = n_iter,
seed = mod.id,
monitor_person_pars = T
)Model estimation ended after 4.04 minutes.
summary(fit, digits = 2)Time series variables as indicated by parameter subscripts:
1 --> Y1
2 --> Y2
Data: 7500 observations in 100 IDs
Model convergence criteria:
Maximum Potential Scale Reduction Factor (PSR; Rhat): 1.005 (should be < 1.01)
Minimum Bulk ESS: 925 (should be > 400, 100 per chain)
Minimum Tail ESS: 1418 (should be > 400, 100 per chain)
Number of divergent transitions: 0 (should be 0)
Posterior Summary Statistics
Fixed Effects:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1 0.02 0.12 -0.21 0.25 1 8891 4092
mu_2 1.09 0.10 0.91 1.28 1 7320 4035
phi(1)_11 0.34 0.02 0.30 0.37 1 4901 3976
phi(1)_12 0.08 0.02 0.03 0.12 1 5973 4449
phi(1)_21 -0.06 0.02 -0.10 -0.02 1 6238 4226
phi(1)_22 0.16 0.02 0.12 0.19 1 5886 4376
ln.sigma2_1 -0.26 0.03 -0.32 -0.20 1 6323 3956
ln.sigma2_2 -0.28 0.03 -0.34 -0.23 1 4845 4176
Random Effects SDs:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
sigma_mu_1 1.19 0.09 1.03 1.38 1 9050 3588
sigma_mu_2 0.95 0.07 0.82 1.10 1 8645 3711
sigma_phi(1)_11 0.15 0.02 0.12 0.18 1 2401 2955
sigma_phi(1)_12 0.18 0.02 0.14 0.22 1 3630 3778
sigma_phi(1)_21 0.17 0.02 0.14 0.21 1 3337 4047
sigma_phi(1)_22 0.16 0.02 0.12 0.19 1 2653 3174
sigma_ln.sigma2_1 0.26 0.03 0.21 0.32 1 3302 3860
sigma_ln.sigma2_2 0.21 0.03 0.16 0.26 1 2289 2543
Random Effects Correlations:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1.mu_2 0.15 0.10 -0.04 0.34 1 8869 3909
mu_1.phi(1)_11 0.34 0.12 0.10 0.56 1 4708 3764
mu_1.phi(1)_12 0.20 0.12 -0.04 0.42 1 5476 3812
mu_1.phi(1)_21 0.00 0.12 -0.24 0.22 1 6191 4323
mu_1.phi(1)_22 0.11 0.12 -0.13 0.34 1 5775 3711
mu_1.ln.sigma2_1 -0.23 0.11 -0.44 -0.01 1 6038 4077
mu_1.ln.sigma2_2 0.09 0.12 -0.16 0.33 1 5025 3610
mu_2.phi(1)_11 -0.03 0.12 -0.27 0.22 1 5281 4050
mu_2.phi(1)_12 0.20 0.12 -0.04 0.41 1 5915 4271
mu_2.phi(1)_21 -0.09 0.12 -0.31 0.15 1 6067 3797
mu_2.phi(1)_22 0.20 0.12 -0.03 0.43 1 5394 4550
mu_2.ln.sigma2_1 -0.18 0.11 -0.40 0.04 1 6411 4101
mu_2.ln.sigma2_2 -0.32 0.12 -0.54 -0.08 1 4825 4094
phi(1)_11.phi(1)_12 0.25 0.14 -0.03 0.51 1 3337 3777
phi(1)_11.phi(1)_21 0.07 0.14 -0.22 0.34 1 3196 4205
phi(1)_11.phi(1)_22 0.17 0.15 -0.13 0.44 1 2374 3152
phi(1)_11.ln.sigma2_1 0.05 0.14 -0.23 0.32 1 3681 3809
phi(1)_11.ln.sigma2_2 -0.18 0.15 -0.46 0.11 1 2311 3452
phi(1)_12.phi(1)_21 -0.13 0.13 -0.39 0.14 1 3955 4216
phi(1)_12.phi(1)_22 0.10 0.14 -0.17 0.37 1 2866 3556
phi(1)_12.ln.sigma2_1 0.05 0.14 -0.21 0.31 1 3678 4269
phi(1)_12.ln.sigma2_2 -0.35 0.14 -0.61 -0.06 1 2456 3635
phi(1)_21.phi(1)_22 -0.30 0.14 -0.56 -0.02 1 2707 3423
phi(1)_21.ln.sigma2_1 0.06 0.14 -0.21 0.32 1 3707 4077
phi(1)_21.ln.sigma2_2 0.05 0.14 -0.23 0.33 1 3513 4326
phi(1)_22.ln.sigma2_1 0.16 0.14 -0.12 0.42 1 3139 3892
phi(1)_22.ln.sigma2_2 0.15 0.15 -0.16 0.43 1 2370 3783
ln.sigma2_1.ln.sigma2_2 0.15 0.15 -0.14 0.43 1 2552 3016
Samples were drawn using NUTS on Thu Dec 11 10:38:30 2025.
For each parameter, Bulk_ESS and Tail_ESS are measures of effective
sample size, and Rhat is the potential scale reduction factor
on split chains (at convergence, Rhat = 1).
Code
# save data for Mplus
mplus = simData$data
colnames(mplus) <- NULL
write.table(mplus, file = paste0("Mplus/",mod.id,"_data.dat"), row.names = F)
file = paste0("Mplus/",mod.id,"_mplus_model.inp")
if(refit.mplus == T){
# run mplus model
runModels(target = file, showOutput = T, quiet = F)
}
# load results
mplus = readModels(target = paste0("Mplus/",mod.id,"_mplus_model.out"),
what = "parameters")
# full results
readLines(gsub(file,pattern=".inp",replacement=".out"))[1:334] [1] "Mplus VERSION 8.7"
[2] "MUTHEN & MUTHEN"
[3] "12/11/2025 10:44 AM"
[4] ""
[5] "INPUT INSTRUCTIONS"
[6] ""
[7] " DATA: file = 5_data.dat;"
[8] ""
[9] " VARIABLE:"
[10] " names = ID time Y1 Y2;"
[11] " cluster = ID;"
[12] " usevar = Y1 Y2;"
[13] " missing = all(-99);"
[14] " lagged = Y1(1) Y2(1);"
[15] ""
[16] ""
[17] " ANALYSIS: TYPE = twolevel random;"
[18] " point = mean;"
[19] " estimator = bayes;"
[20] " proc = 2;"
[21] " Biterations = (10000);"
[22] " Bconvergence = .025;"
[23] " bseed = 12345;"
[24] " thin = 1;"
[25] ""
[26] " MODEL:"
[27] ""
[28] " %WITHIN%"
[29] ""
[30] " AR1 | Y1 on Y1&1;"
[31] " CL12 | Y1 on Y2&1;"
[32] " CL21 | Y2 on Y1&1;"
[33] " AR2 | Y2 on Y2&1;"
[34] ""
[35] " logv1 | Y1;"
[36] " logv2 | Y2;"
[37] ""
[38] " %BETWEEN%"
[39] ""
[40] " Y1 Y2 AR1 AR2 CL12 CL21 logv1 logv2 with"
[41] " Y1 Y2 AR1 AR2 CL12 CL21 logv1 logv2 ;"
[42] ""
[43] ""
[44] " OUTPUT: TECH1 TECH8 stdyx(cluster);"
[45] ""
[46] ""
[47] ""
[48] "INPUT READING TERMINATED NORMALLY"
[49] ""
[50] ""
[51] ""
[52] ""
[53] "SUMMARY OF ANALYSIS"
[54] ""
[55] "Number of groups 1"
[56] "Number of observations 7500"
[57] ""
[58] "Number of dependent variables 2"
[59] "Number of independent variables 2"
[60] "Number of continuous latent variables 6"
[61] ""
[62] "Observed dependent variables"
[63] ""
[64] " Continuous"
[65] " Y1 Y2"
[66] ""
[67] "Observed independent variables"
[68] " Y1&1 Y2&1"
[69] ""
[70] "Continuous latent variables"
[71] " AR1 CL12 CL21 AR2 LOGV1 LOGV2"
[72] ""
[73] "Variables with special functions"
[74] ""
[75] " Cluster variable ID"
[76] ""
[77] " Within variables"
[78] " Y1&1 Y2&1"
[79] ""
[80] ""
[81] "Estimator BAYES"
[82] "Specifications for Bayesian Estimation"
[83] " Point estimate MEAN"
[84] " Number of Markov chain Monte Carlo (MCMC) chains 2"
[85] " Random seed for the first chain 12345"
[86] " Starting value information UNPERTURBED"
[87] " Algorithm used for Markov chain Monte Carlo GIBBS(PX1)"
[88] " Convergence criterion 0.250D-01"
[89] " Maximum number of iterations 50000"
[90] " K-th iteration used for thinning 1"
[91] ""
[92] "Input data file(s)"
[93] " 5_data.dat"
[94] "Input data format FREE"
[95] ""
[96] ""
[97] "SUMMARY OF DATA"
[98] ""
[99] " Number of clusters 100"
[100] ""
[101] " Size (s) Cluster ID with Size s"
[102] ""
[103] " 75 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21"
[104] " 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39"
[105] " 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57"
[106] " 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75"
[107] " 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93"
[108] " 94 95 96 97 98 99 100"
[109] ""
[110] ""
[111] ""
[112] "COVARIANCE COVERAGE OF DATA"
[113] ""
[114] "Minimum covariance coverage value 0.100"
[115] ""
[116] " Number of missing data patterns 2"
[117] ""
[118] ""
[119] " PROPORTION OF DATA PRESENT"
[120] ""
[121] ""
[122] " Covariance Coverage"
[123] " Y1 Y2"
[124] " ________ ________"
[125] " Y1 1.000"
[126] " Y2 1.000 1.000"
[127] ""
[128] ""
[129] ""
[130] "UNIVARIATE SAMPLE STATISTICS"
[131] ""
[132] ""
[133] " UNIVARIATE HIGHER-ORDER MOMENT DESCRIPTIVE STATISTICS"
[134] ""
[135] " Variable/ Mean/ Skewness/ Minimum/ % with Percentiles"
[136] " Sample Size Variance Kurtosis Maximum Min/Max 20%/60% 40%/80% Median"
[137] ""
[138] " Y1 0.015 0.075 -5.313 0.01% -1.226 -0.401 -0.033"
[139] " 7500.000 2.265 0.030 5.681 0.01% 0.357 1.283"
[140] " Y2 1.092 0.033 -3.496 0.01% 0.004 0.736 1.075"
[141] " 7500.000 1.673 -0.097 5.626 0.01% 1.405 2.193"
[142] ""
[143] ""
[144] " WARNING: PROBLEMS OCCURRED IN SEVERAL ITERATIONS IN THE COMPUTATION OF THE STANDARDIZED ESTIMATES FOR SEVERAL"
[145] " CLUSTERS. THIS IS MOST LIKELY DUE TO AR COEFFICIENTS GREATER THAN 1 OR PARAMETERS GIVING NON-STATIONARY MODELS."
[146] " SUCH POSTERIOR DRAWS ARE REMOVED. THE FOLLOWING CLUSTERS HAD SUCH PROBLEMS:"
[147] " 66"
[148] ""
[149] "THE MODEL ESTIMATION TERMINATED NORMALLY"
[150] ""
[151] " USE THE FBITERATIONS OPTION TO INCREASE THE NUMBER OF ITERATIONS BY A FACTOR"
[152] " OF AT LEAST TWO TO CHECK CONVERGENCE AND THAT THE PSR VALUE DOES NOT INCREASE."
[153] ""
[154] ""
[155] ""
[156] "MODEL FIT INFORMATION"
[157] ""
[158] "Number of Free Parameters 44"
[159] ""
[160] "Information Criteria"
[161] ""
[162] " Deviance (DIC) 39079.644"
[163] " Estimated Number of Parameters (pD) 619.354"
[164] ""
[165] ""
[166] ""
[167] "MODEL RESULTS"
[168] ""
[169] " Posterior One-Tailed 95% C.I."
[170] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[171] ""
[172] "Within Level"
[173] ""
[174] "Between Level"
[175] ""
[176] " Y1 WITH"
[177] " AR1 0.076 0.030 0.003 0.022 0.141 *"
[178] " AR2 0.027 0.031 0.185 -0.032 0.089"
[179] " CL12 0.055 0.033 0.040 -0.007 0.126"
[180] " CL21 -0.002 0.032 0.473 -0.066 0.059"
[181] " LOGV1 -0.089 0.050 0.031 -0.192 0.005"
[182] " LOGV2 0.021 0.043 0.310 -0.062 0.107"
[183] ""
[184] " Y2 WITH"
[185] " AR1 -0.002 0.023 0.475 -0.047 0.044"
[186] " AR2 0.038 0.025 0.056 -0.009 0.089"
[187] " CL12 0.045 0.027 0.040 -0.006 0.101"
[188] " CL21 -0.018 0.025 0.222 -0.069 0.031"
[189] " LOGV1 -0.056 0.040 0.070 -0.138 0.018"
[190] " LOGV2 -0.079 0.035 0.009 -0.151 -0.014 *"
[191] ""
[192] " AR1 WITH"
[193] " AR2 0.005 0.005 0.140 -0.004 0.015"
[194] " CL12 0.009 0.005 0.038 -0.001 0.020"
[195] " CL21 0.002 0.005 0.358 -0.008 0.011"
[196] " LOGV1 0.003 0.008 0.347 -0.012 0.018"
[197] " LOGV2 -0.007 0.007 0.143 -0.020 0.006"
[198] ""
[199] " AR2 WITH"
[200] " CL12 0.004 0.005 0.219 -0.006 0.015"
[201] " CL21 -0.010 0.005 0.022 -0.021 0.000 *"
[202] " LOGV1 0.009 0.008 0.129 -0.007 0.026"
[203] " LOGV2 0.006 0.007 0.174 -0.007 0.021"
[204] ""
[205] " CL12 WITH"
[206] " CL21 -0.005 0.006 0.159 -0.017 0.005"
[207] " LOGV1 0.004 0.009 0.345 -0.014 0.022"
[208] " LOGV2 -0.018 0.008 0.009 -0.035 -0.003 *"
[209] ""
[210] " CL21 WITH"
[211] " LOGV1 0.004 0.009 0.331 -0.013 0.021"
[212] " LOGV2 0.003 0.007 0.334 -0.011 0.017"
[213] ""
[214] " LOGV1 WITH"
[215] " LOGV2 0.011 0.011 0.158 -0.010 0.034"
[216] ""
[217] " Y1 WITH"
[218] " Y2 0.214 0.151 0.067 -0.074 0.522"
[219] ""
[220] " Means"
[221] " Y1 0.020 0.128 0.433 -0.230 0.270"
[222] " Y2 1.093 0.102 0.000 0.892 1.295 *"
[223] " AR1 0.334 0.020 0.000 0.295 0.372 *"
[224] " CL12 0.076 0.023 0.001 0.031 0.122 *"
[225] " CL21 -0.064 0.022 0.001 -0.107 -0.021 *"
[226] " AR2 0.157 0.021 0.000 0.115 0.197 *"
[227] " LOGV1 -0.264 0.034 0.000 -0.330 -0.197 *"
[228] " LOGV2 -0.284 0.030 0.000 -0.343 -0.226 *"
[229] ""
[230] " Variances"
[231] " Y1 1.616 0.261 0.000 1.180 2.205 *"
[232] " Y2 1.029 0.167 0.000 0.755 1.403 *"
[233] " AR1 0.027 0.006 0.000 0.017 0.041 *"
[234] " CL12 0.040 0.009 0.000 0.026 0.059 *"
[235] " CL21 0.035 0.008 0.000 0.023 0.052 *"
[236] " AR2 0.031 0.007 0.000 0.020 0.047 *"
[237] " LOGV1 0.087 0.018 0.000 0.056 0.127 *"
[238] " LOGV2 0.059 0.014 0.000 0.036 0.090 *"
[239] ""
[240] ""
[241] "STANDARDIZED MODEL RESULTS"
[242] ""
[243] ""
[244] "STDYX Standardization"
[245] ""
[246] " Posterior One-Tailed 95% C.I."
[247] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[248] ""
[249] "Within-Level Standardized Estimates Averaged Over Clusters"
[250] ""
[251] " AR1 | Y1 ON"
[252] " Y1&1 0.334 0.011 0.000 0.313 0.355 *"
[253] ""
[254] " CL12 | Y1 ON"
[255] " Y2&1 0.062 0.011 0.000 0.041 0.083 *"
[256] ""
[257] " CL21 | Y2 ON"
[258] " Y1&1 -0.063 0.011 0.000 -0.085 -0.041 *"
[259] ""
[260] " AR2 | Y2 ON"
[261] " Y2&1 0.156 0.012 0.000 0.133 0.179 *"
[262] ""
[263] " LOGV1 |"
[264] " Y1 0.834 0.008 0.000 0.817 0.850 *"
[265] ""
[266] " LOGV2 |"
[267] " Y2 0.912 0.007 0.000 0.899 0.924 *"
[268] ""
[269] "Between Level"
[270] ""
[271] " Y1 WITH"
[272] " AR1 0.362 0.121 0.003 0.112 0.583 *"
[273] " AR2 0.119 0.131 0.185 -0.143 0.369"
[274] " CL12 0.218 0.122 0.040 -0.029 0.444"
[275] " CL21 -0.009 0.129 0.473 -0.260 0.240"
[276] " LOGV1 -0.238 0.122 0.031 -0.462 0.013"
[277] " LOGV2 0.068 0.135 0.310 -0.199 0.329"
[278] ""
[279] " Y2 WITH"
[280] " AR1 -0.009 0.134 0.475 -0.272 0.252"
[281] " AR2 0.210 0.128 0.056 -0.050 0.450"
[282] " CL12 0.220 0.124 0.040 -0.028 0.451"
[283] " CL21 -0.097 0.127 0.222 -0.338 0.157"
[284] " LOGV1 -0.187 0.124 0.070 -0.420 0.064"
[285] " LOGV2 -0.320 0.125 0.009 -0.548 -0.060 *"
[286] ""
[287] " AR1 WITH"
[288] " AR2 0.173 0.157 0.140 -0.143 0.466"
[289] " CL12 0.271 0.145 0.038 -0.030 0.540"
[290] " CL21 0.054 0.150 0.358 -0.243 0.342"
[291] " LOGV1 0.060 0.153 0.347 -0.242 0.359"
[292] " LOGV2 -0.169 0.157 0.143 -0.471 0.147"
[293] ""
[294] " AR2 WITH"
[295] " CL12 0.115 0.149 0.219 -0.182 0.399"
[296] " CL21 -0.309 0.145 0.022 -0.569 -0.008 *"
[297] " LOGV1 0.173 0.150 0.129 -0.132 0.456"
[298] " LOGV2 0.151 0.158 0.174 -0.174 0.449"
[299] ""
[300] " CL12 WITH"
[301] " CL21 -0.142 0.141 0.159 -0.418 0.137"
[302] " LOGV1 0.060 0.150 0.345 -0.238 0.351"
[303] " LOGV2 -0.361 0.144 0.009 -0.622 -0.069 *"
[304] ""
[305] " CL21 WITH"
[306] " LOGV1 0.065 0.150 0.331 -0.232 0.355"
[307] " LOGV2 0.064 0.154 0.334 -0.238 0.362"
[308] ""
[309] " LOGV1 WITH"
[310] " LOGV2 0.155 0.150 0.158 -0.141 0.440"
[311] ""
[312] " Y1 WITH"
[313] " Y2 0.165 0.109 0.067 -0.058 0.374"
[314] ""
[315] " Means"
[316] " Y1 0.016 0.101 0.433 -0.180 0.212"
[317] " Y2 1.088 0.133 0.000 0.829 1.349 *"
[318] " AR1 2.053 0.267 0.000 1.571 2.628 *"
[319] " CL12 0.388 0.123 0.001 0.148 0.635 *"
[320] " CL21 -0.345 0.123 0.001 -0.592 -0.111 *"
[321] " AR2 0.904 0.157 0.000 0.609 1.226 *"
[322] " LOGV1 -0.913 0.151 0.000 -1.216 -0.631 *"
[323] " LOGV2 -1.195 0.185 0.000 -1.579 -0.848 *"
[324] ""
[325] " Variances"
[326] " Y1 1.000 0.000 0.000 1.000 1.000"
[327] " Y2 1.000 0.000 0.000 1.000 1.000"
[328] " AR1 1.000 0.000 0.000 1.000 1.000"
[329] " CL12 1.000 0.000 0.000 1.000 1.000"
[330] " CL21 1.000 0.000 0.000 1.000 1.000"
[331] " AR2 1.000 0.000 0.000 1.000 1.000"
[332] " LOGV1 1.000 0.000 0.000 1.000 1.000"
[333] " LOGV2 1.000 0.000 0.000 1.000 1.000"
[334] ""
Code
comp <- mplus_mlts_compare(mplus = mplus, mlts = fit,
fe_rows = c(29:36),
re_rows = c(37:44))
comp_tab(comp)Type | Param | True | mlts | Mplus | ||||
|---|---|---|---|---|---|---|---|---|
Est | 95% CI | CI Width | Est | 95% CI | CI Width | |||
Fixed effect | mu_1 | 0.10 | 0.02 | [-0.21, 0.25] | 0.46 | 0.02 | [-0.23, 0.27] | 0.50 |
mu_2 | 1.00 | 1.09 | [0.91, 1.28] | 0.37 | 1.09 | [0.89, 1.29] | 0.40 | |
phi(1)_11 | 0.30 | 0.34 | [0.30, 0.37] | 0.07 | 0.33 | [0.30, 0.37] | 0.08 | |
phi(1)_12 | 0.05 | 0.08 | [0.03, 0.12] | 0.08 | 0.08 | [0.03, 0.12] | 0.09 | |
phi(1)_21 | -0.05 | -0.06 | [-0.10, -0.02] | 0.08 | -0.06 | [-0.11, -0.02] | 0.09 | |
phi(1)_22 | 0.15 | 0.16 | [0.12, 0.20] | 0.08 | 0.16 | [0.12, 0.20] | 0.08 | |
ln.sigma2_1 | -0.30 | -0.26 | [-0.32, -0.20] | 0.12 | -0.26 | [-0.33, -0.20] | 0.13 | |
ln.sigma2_2 | -0.30 | -0.28 | [-0.34, -0.23] | 0.11 | -0.28 | [-0.34, -0.23] | 0.12 | |
Random effect SD | sigma_mu_1 | 1.00 | 1.19 | [1.03, 1.38] | 0.36 | 1.27 | [1.09, 1.49] | 0.40 |
sigma_mu_2 | 0.90 | 0.95 | [0.82, 1.10] | 0.27 | 1.01 | [0.87, 1.18] | 0.31 | |
sigma_phi(1)_11 | 0.15 | 0.15 | [0.12, 0.18] | 0.07 | 0.16 | [0.13, 0.20] | 0.07 | |
sigma_phi(1)_12 | 0.15 | 0.18 | [0.14, 0.22] | 0.07 | 0.20 | [0.16, 0.24] | 0.08 | |
sigma_phi(1)_21 | 0.15 | 0.17 | [0.14, 0.21] | 0.07 | 0.19 | [0.15, 0.23] | 0.08 | |
sigma_phi(1)_22 | 0.15 | 0.16 | [0.12, 0.19] | 0.07 | 0.18 | [0.14, 0.22] | 0.08 | |
sigma_ln.sigma2_1 | 0.25 | 0.26 | [0.21, 0.32] | 0.11 | 0.29 | [0.24, 0.36] | 0.12 | |
sigma_ln.sigma2_2 | 0.25 | 0.21 | [0.16, 0.26] | 0.10 | 0.24 | [0.19, 0.30] | 0.11 | |
RE correlation | r_mu_1.mu_2 | 0.20 | 0.15 | [-0.04, 0.34] | 0.38 | 0.16 | [-0.06, 0.37] | 0.43 |
r_mu_1.phi(1)_11 | 0.15 | 0.34 | [0.10, 0.56] | 0.46 | 0.36 | [0.11, 0.58] | 0.47 | |
r_mu_1.phi(1)_12 | 0.15 | 0.20 | [-0.04, 0.42] | 0.46 | 0.22 | [-0.03, 0.44] | 0.47 | |
r_mu_1.phi(1)_21 | -0.20 | -0.00 | [-0.24, 0.22] | 0.46 | -0.01 | [-0.26, 0.24] | 0.50 | |
r_mu_1.phi(1)_22 | 0.15 | 0.11 | [-0.13, 0.34] | 0.47 | 0.12 | [-0.14, 0.37] | 0.51 | |
r_mu_1.ln.sigma2_1 | -0.20 | -0.23 | [-0.44, -0.01] | 0.44 | -0.24 | [-0.46, 0.01] | 0.48 | |
r_mu_1.ln.sigma2_2 | 0.20 | 0.09 | [-0.16, 0.33] | 0.49 | 0.07 | [-0.20, 0.33] | 0.53 | |
r_mu_2.phi(1)_11 | -0.05 | -0.03 | [-0.27, 0.22] | 0.49 | -0.01 | [-0.27, 0.25] | 0.52 | |
r_mu_2.phi(1)_12 | 0.10 | 0.20 | [-0.04, 0.41] | 0.45 | 0.22 | [-0.03, 0.45] | 0.48 | |
r_mu_2.phi(1)_21 | -0.10 | -0.09 | [-0.31, 0.15] | 0.46 | -0.10 | [-0.34, 0.16] | 0.50 | |
r_mu_2.phi(1)_22 | 0.15 | 0.20 | [-0.03, 0.43] | 0.45 | 0.21 | [-0.05, 0.45] | 0.50 | |
r_mu_2.ln.sigma2_1 | -0.10 | -0.18 | [-0.40, 0.04] | 0.44 | -0.19 | [-0.42, 0.06] | 0.48 | |
r_mu_2.ln.sigma2_2 | -0.20 | -0.32 | [-0.54, -0.08] | 0.47 | -0.32 | [-0.55, -0.06] | 0.49 | |
r_phi(1)_11.phi(1)_12 | 0.15 | 0.25 | [-0.03, 0.51] | 0.54 | 0.27 | [-0.03, 0.54] | 0.57 | |
r_phi(1)_11.phi(1)_21 | -0.05 | 0.07 | [-0.22, 0.34] | 0.56 | 0.05 | [-0.24, 0.34] | 0.58 | |
r_phi(1)_11.phi(1)_22 | 0.00 | 0.17 | [-0.13, 0.44] | 0.57 | 0.17 | [-0.14, 0.47] | 0.61 | |
r_phi(1)_11.ln.sigma2_1 | -0.10 | 0.04 | [-0.23, 0.32] | 0.55 | 0.06 | [-0.24, 0.36] | 0.60 | |
r_phi(1)_11.ln.sigma2_2 | 0.00 | -0.18 | [-0.46, 0.11] | 0.58 | -0.17 | [-0.47, 0.15] | 0.62 | |
r_phi(1)_12.phi(1)_21 | -0.20 | -0.13 | [-0.39, 0.14] | 0.53 | -0.14 | [-0.42, 0.14] | 0.55 | |
r_phi(1)_12.phi(1)_22 | 0.05 | 0.10 | [-0.17, 0.37] | 0.54 | 0.12 | [-0.18, 0.40] | 0.58 | |
r_phi(1)_12.ln.sigma2_1 | 0.05 | 0.05 | [-0.21, 0.31] | 0.53 | 0.06 | [-0.24, 0.35] | 0.59 | |
r_phi(1)_12.ln.sigma2_2 | -0.20 | -0.35 | [-0.60, -0.06] | 0.54 | -0.36 | [-0.62, -0.07] | 0.55 | |
r_phi(1)_21.phi(1)_22 | -0.20 | -0.30 | [-0.56, -0.02] | 0.53 | -0.31 | [-0.57, -0.01] | 0.56 | |
r_phi(1)_21.ln.sigma2_1 | 0.05 | 0.06 | [-0.21, 0.32] | 0.53 | 0.06 | [-0.23, 0.36] | 0.59 | |
r_phi(1)_21.ln.sigma2_2 | -0.15 | 0.05 | [-0.22, 0.32] | 0.55 | 0.06 | [-0.24, 0.36] | 0.60 | |
r_phi(1)_22.ln.sigma2_1 | 0.15 | 0.16 | [-0.12, 0.42] | 0.54 | 0.17 | [-0.13, 0.46] | 0.59 | |
r_phi(1)_22.ln.sigma2_2 | 0.10 | 0.14 | [-0.16, 0.43] | 0.58 | 0.15 | [-0.17, 0.45] | 0.62 | |
r_ln.sigma2_1.ln.sigma2_2 | 0.20 | 0.15 | [-0.14, 0.43] | 0.57 | 0.15 | [-0.14, 0.44] | 0.58 | |
Code
P <- mplus_mlts_comp_plot(comp)
P[[1]]
P[[2]]
P[[3]]Parameters with absolute posterior mean difference larger than 0.01:
Code
mplus_mlts_diff(comp, tol = 0.01)Param | True | mlts | Mplus | Diff |
|---|---|---|---|---|
Est | Est | |||
sigma_mu_1 | 1.00 | 1.19 | 1.27 | -0.08 |
sigma_mu_2 | 0.90 | 0.95 | 1.01 | -0.07 |
sigma_ln.sigma2_1 | 0.25 | 0.26 | 0.29 | -0.03 |
sigma_ln.sigma2_2 | 0.25 | 0.21 | 0.24 | -0.03 |
r_phi(1)_11.phi(1)_12 | 0.15 | 0.25 | 0.27 | -0.02 |
r_mu_2.phi(1)_12 | 0.10 | 0.20 | 0.22 | -0.02 |
sigma_phi(1)_12 | 0.15 | 0.18 | 0.20 | -0.02 |
sigma_phi(1)_22 | 0.15 | 0.16 | 0.18 | -0.02 |
r_mu_1.phi(1)_12 | 0.15 | 0.20 | 0.22 | -0.02 |
r_mu_1.phi(1)_11 | 0.15 | 0.34 | 0.36 | -0.02 |
r_mu_2.phi(1)_11 | -0.05 | -0.03 | -0.01 | -0.02 |
sigma_phi(1)_21 | 0.15 | 0.17 | 0.19 | -0.02 |
sigma_phi(1)_11 | 0.15 | 0.15 | 0.16 | -0.02 |
r_mu_1.ln.sigma2_2 | 0.20 | 0.09 | 0.07 | 0.02 |
r_phi(1)_11.phi(1)_21 | -0.05 | 0.07 | 0.05 | 0.02 |
r_phi(1)_12.ln.sigma2_2 | -0.20 | -0.35 | -0.36 | 0.02 |
r_phi(1)_11.ln.sigma2_1 | -0.10 | 0.04 | 0.06 | -0.01 |
r_mu_1.mu_2 | 0.20 | 0.15 | 0.16 | -0.01 |
r_phi(1)_12.phi(1)_22 | 0.05 | 0.10 | 0.12 | -0.01 |
r_phi(1)_21.ln.sigma2_2 | -0.15 | 0.05 | 0.06 | -0.01 |
r_phi(1)_11.ln.sigma2_2 | 0.00 | -0.18 | -0.17 | -0.01 |
r_mu_2.phi(1)_21 | -0.10 | -0.09 | -0.10 | 0.01 |
Within-Level Standardized Effects
mplus$parameters$stdyx.standardized[c(1:4),c(1:4,6,7)] paramHeader param est posterior_sd lower_2.5ci upper_2.5ci
1 AR1|Y1.ON Y1&1 0.334 0.011 0.313 0.355
2 CL12|Y1.ON Y2&1 0.062 0.011 0.041 0.083
3 CL21|Y2.ON Y1&1 -0.063 0.011 -0.085 -0.041
4 AR2|Y2.ON Y2&1 0.156 0.012 0.133 0.179
mlts_standardized(object = fit, what = "within")$`Within-level standardized effects averaged over clusters`
Type Param Std.Est SD 2.5% 97.5%
1 Fixed effect phi(1)_11 0.336 0.011 0.315 0.357
2 Fixed effect phi(1)_12 0.064 0.011 0.044 0.086
3 Fixed effect phi(1)_21 -0.062 0.011 -0.085 -0.040
4 Fixed effect phi(1)_22 0.157 0.012 0.135 0.180
5 VAR(1) - random innovation covariance
mod.id = 6
# model specification
model <- mlts_model(
q = 2, # no. of time series variables
fix_inno_covs = F, # random innovation co-variance
inno_covs_dir = "pos" # assume positive innovation covariances / correlations
)
# generate data
simData <- mlts_sim(
model, N = 80, TP = 120,
default = T, seed = mod.id, seed.true = mod.id)
# path model
mlts_paths(model)fit = mlts_fit(
model,
data = simData,
ts = c("Y1","Y2"),
cores = n_cores,
chains = n_chains,
iter = n_iter,
seed = mod.id,
monitor_person_pars = T
)Model estimation ended after 13.27 minutes.
summary(fit, digits = 2)Time series variables as indicated by parameter subscripts:
1 --> Y1
2 --> Y2
Data: 9600 observations in 80 IDs
Model convergence criteria:
Maximum Potential Scale Reduction Factor (PSR; Rhat): 1.011 (should be < 1.01)
Minimum Bulk ESS: 497 (should be > 400, 100 per chain)
Minimum Tail ESS: 518 (should be > 400, 100 per chain)
Number of divergent transitions: 6 (should be 0)
Posterior Summary Statistics
Fixed Effects:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1 0.27 0.09 0.10 0.45 1 3977 3615
mu_2 1.05 0.14 0.78 1.32 1 4914 3534
phi(1)_11 0.30 0.02 0.27 0.34 1 1732 3075
phi(1)_12 0.05 0.02 0.02 0.09 1 2381 2762
phi(1)_21 0.00 0.02 -0.05 0.04 1 1866 2391
phi(1)_22 0.27 0.02 0.23 0.30 1 2270 2692
ln.sigma2_1 -0.32 0.03 -0.39 -0.26 1 1650 2904
ln.sigma2_2 -0.26 0.03 -0.33 -0.20 1 2210 2661
ln.sigma_12 -0.34 0.04 -0.41 -0.26 1 2207 3155
Random Effects SDs:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
sigma_mu_1 0.76 0.07 0.64 0.90 1 4581 3456
sigma_mu_2 1.22 0.10 1.05 1.44 1 5204 3841
sigma_phi(1)_11 0.13 0.02 0.10 0.17 1 1126 2208
sigma_phi(1)_12 0.14 0.02 0.11 0.18 1 1398 2395
sigma_phi(1)_21 0.18 0.02 0.15 0.23 1 1530 2708
sigma_phi(1)_22 0.14 0.02 0.11 0.17 1 1123 2350
sigma_ln.sigma2_1 0.20 0.04 0.13 0.28 1 497 518
sigma_ln.sigma2_2 0.22 0.04 0.15 0.30 1 793 1523
sigma_ln.sigma_12 0.28 0.04 0.22 0.36 1 1137 2253
Random Effects Correlations:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
mu_1.mu_2 -0.22 0.11 -0.42 0.00 1.00 4231 3726
mu_1.phi(1)_11 0.01 0.14 -0.26 0.28 1.00 2035 2678
mu_1.phi(1)_12 0.10 0.13 -0.17 0.36 1.00 2558 2968
mu_1.phi(1)_21 -0.18 0.12 -0.40 0.07 1.00 2878 3355
mu_1.phi(1)_22 0.15 0.14 -0.12 0.42 1.00 2469 3466
mu_1.ln.sigma2_1 0.19 0.15 -0.11 0.48 1.00 1983 2635
mu_1.ln.sigma2_2 -0.05 0.15 -0.33 0.25 1.00 2174 2314
mu_1.ln.sigma_12 0.11 0.13 -0.15 0.37 1.00 2074 3194
mu_2.phi(1)_11 -0.12 0.13 -0.37 0.14 1.00 2735 3135
mu_2.phi(1)_12 -0.23 0.13 -0.46 0.04 1.00 2728 3358
mu_2.phi(1)_21 -0.02 0.12 -0.26 0.23 1.00 3686 3891
mu_2.phi(1)_22 -0.07 0.14 -0.33 0.20 1.00 2758 2820
mu_2.ln.sigma2_1 -0.18 0.15 -0.47 0.11 1.00 1688 3205
mu_2.ln.sigma2_2 0.13 0.14 -0.16 0.41 1.00 2447 3171
mu_2.ln.sigma_12 0.16 0.13 -0.12 0.41 1.00 2707 3123
phi(1)_11.phi(1)_12 0.18 0.15 -0.12 0.48 1.00 1303 2300
phi(1)_11.phi(1)_21 0.08 0.15 -0.21 0.36 1.00 1682 2828
phi(1)_11.phi(1)_22 0.09 0.17 -0.23 0.41 1.00 925 1176
phi(1)_11.ln.sigma2_1 0.14 0.18 -0.20 0.49 1.00 1219 2321
phi(1)_11.ln.sigma2_2 -0.01 0.17 -0.34 0.33 1.01 1145 1565
phi(1)_11.ln.sigma_12 -0.32 0.15 -0.60 -0.01 1.00 1029 1468
phi(1)_12.phi(1)_21 0.39 0.13 0.10 0.63 1.01 1193 2426
phi(1)_12.phi(1)_22 -0.24 0.15 -0.52 0.06 1.00 1028 2450
phi(1)_12.ln.sigma2_1 -0.05 0.18 -0.39 0.31 1.01 784 1533
phi(1)_12.ln.sigma2_2 0.21 0.17 -0.14 0.52 1.00 967 1401
phi(1)_12.ln.sigma_12 -0.11 0.15 -0.40 0.19 1.00 1404 2749
phi(1)_21.phi(1)_22 0.17 0.14 -0.12 0.44 1.00 1474 2665
phi(1)_21.ln.sigma2_1 -0.18 0.16 -0.48 0.13 1.00 1434 3233
phi(1)_21.ln.sigma2_2 0.05 0.16 -0.27 0.36 1.00 1239 2508
phi(1)_21.ln.sigma_12 -0.44 0.13 -0.67 -0.16 1.01 949 1476
phi(1)_22.ln.sigma2_1 0.14 0.18 -0.22 0.49 1.01 855 1528
phi(1)_22.ln.sigma2_2 0.10 0.17 -0.23 0.42 1.00 1379 2865
phi(1)_22.ln.sigma_12 -0.22 0.16 -0.52 0.10 1.00 1526 2564
ln.sigma2_1.ln.sigma2_2 -0.01 0.19 -0.37 0.37 1.01 819 1102
ln.sigma2_1.ln.sigma_12 -0.34 0.17 -0.66 0.01 1.01 724 1335
ln.sigma2_2.ln.sigma_12 0.08 0.18 -0.28 0.41 1.01 704 1864
Samples were drawn using NUTS on Wed Dec 10 23:18:35 2025.
For each parameter, Bulk_ESS and Tail_ESS are measures of effective
sample size, and Rhat is the potential scale reduction factor
on split chains (at convergence, Rhat = 1).
Code
# save data for Mplus
mplus = simData$data
colnames(mplus) <- NULL
write.table(mplus, file = paste0("Mplus/",mod.id,"_data.dat"), row.names = F)
file = paste0("Mplus/",mod.id,"_mplus_model.inp")
if(refit.mplus == T){
# run mplus model
runModels(target = file, showOutput = T, quiet = F)
}
# load results
mplus = readModels(target = paste0("Mplus/",mod.id,"_mplus_model.out"),
what = "parameters")
# full results
readLines(gsub(file,pattern=".inp",replacement=".out"))[1:369] [1] "Mplus VERSION 8.7"
[2] "MUTHEN & MUTHEN"
[3] "12/10/2025 11:19 PM"
[4] ""
[5] "INPUT INSTRUCTIONS"
[6] ""
[7] " DATA: file = 6_data.dat;"
[8] ""
[9] " VARIABLE:"
[10] " names = ID time Y1 Y2;"
[11] " cluster = ID;"
[12] " usevar = Y1 Y2;"
[13] " missing = all(-99);"
[14] " lagged = Y1(1) Y2(1);"
[15] ""
[16] ""
[17] " ANALYSIS: TYPE = twolevel random;"
[18] " point = mean;"
[19] " estimator = bayes;"
[20] " proc = 2;"
[21] " Biterations = (10000);"
[22] " Bconvergence = .025;"
[23] " bseed = 12345;"
[24] " thin = 1;"
[25] ""
[26] " MODEL:"
[27] ""
[28] " %WITHIN%"
[29] ""
[30] " AR1 | Y1 on Y1&1;"
[31] " CL12 | Y1 on Y2&1;"
[32] ""
[33] " AR2 | Y2 on Y2&1;"
[34] " CL21 | Y2 on Y1&1;"
[35] ""
[36] " posc by Y1@1 Y2@1;"
[37] ""
[38] " logv1 | Y1;"
[39] " logv2 | Y2;"
[40] " logposc | posc;"
[41] ""
[42] " %BETWEEN%"
[43] ""
[44] " Y1 Y2 AR1 AR2 CL12 CL21 logv1 logv2 logposc with"
[45] " Y1 Y2 AR1 AR2 CL12 CL21 logv1 logv2 logposc;"
[46] ""
[47] ""
[48] " OUTPUT: TECH1 TECH8 stdyx(cluster);"
[49] ""
[50] ""
[51] ""
[52] "INPUT READING TERMINATED NORMALLY"
[53] ""
[54] ""
[55] ""
[56] ""
[57] "SUMMARY OF ANALYSIS"
[58] ""
[59] "Number of groups 1"
[60] "Number of observations 9600"
[61] ""
[62] "Number of dependent variables 2"
[63] "Number of independent variables 2"
[64] "Number of continuous latent variables 8"
[65] ""
[66] "Observed dependent variables"
[67] ""
[68] " Continuous"
[69] " Y1 Y2"
[70] ""
[71] "Observed independent variables"
[72] " Y1&1 Y2&1"
[73] ""
[74] "Continuous latent variables"
[75] " POSC AR1 CL12 AR2 CL21 LOGV1"
[76] " LOGV2 LOGPOSC"
[77] ""
[78] "Variables with special functions"
[79] ""
[80] " Cluster variable ID"
[81] ""
[82] " Within variables"
[83] " Y1&1 Y2&1"
[84] ""
[85] ""
[86] "Estimator BAYES"
[87] "Specifications for Bayesian Estimation"
[88] " Point estimate MEAN"
[89] " Number of Markov chain Monte Carlo (MCMC) chains 2"
[90] " Random seed for the first chain 12345"
[91] " Starting value information UNPERTURBED"
[92] " Algorithm used for Markov chain Monte Carlo GIBBS(PX1)"
[93] " Convergence criterion 0.250D-01"
[94] " Maximum number of iterations 50000"
[95] " K-th iteration used for thinning 1"
[96] ""
[97] "Input data file(s)"
[98] " 6_data.dat"
[99] "Input data format FREE"
[100] ""
[101] ""
[102] "SUMMARY OF DATA"
[103] ""
[104] " Number of clusters 80"
[105] ""
[106] " Size (s) Cluster ID with Size s"
[107] ""
[108] " 120 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21"
[109] " 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39"
[110] " 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57"
[111] " 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75"
[112] " 76 77 78 79 80"
[113] ""
[114] ""
[115] ""
[116] "COVARIANCE COVERAGE OF DATA"
[117] ""
[118] "Minimum covariance coverage value 0.100"
[119] ""
[120] " Number of missing data patterns 2"
[121] ""
[122] ""
[123] " PROPORTION OF DATA PRESENT"
[124] ""
[125] ""
[126] " Covariance Coverage"
[127] " Y1 Y2"
[128] " ________ ________"
[129] " Y1 1.000"
[130] " Y2 1.000 1.000"
[131] ""
[132] ""
[133] ""
[134] "UNIVARIATE SAMPLE STATISTICS"
[135] ""
[136] ""
[137] " UNIVARIATE HIGHER-ORDER MOMENT DESCRIPTIVE STATISTICS"
[138] ""
[139] " Variable/ Mean/ Skewness/ Minimum/ % with Percentiles"
[140] " Sample Size Variance Kurtosis Maximum Min/Max 20%/60% 40%/80% Median"
[141] ""
[142] " Y1 0.276 0.085 -4.951 0.01% -0.994 -0.138 0.246"
[143] " 9600.000 2.281 -0.019 6.534 0.01% 0.646 1.540"
[144] " Y2 1.056 -0.030 -5.722 0.01% -0.415 0.614 1.054"
[145] " 9600.000 3.106 0.024 8.482 0.01% 1.512 2.543"
[146] ""
[147] ""
[148] "THE MODEL ESTIMATION TERMINATED NORMALLY"
[149] ""
[150] " USE THE FBITERATIONS OPTION TO INCREASE THE NUMBER OF ITERATIONS BY A FACTOR"
[151] " OF AT LEAST TWO TO CHECK CONVERGENCE AND THAT THE PSR VALUE DOES NOT INCREASE."
[152] ""
[153] ""
[154] ""
[155] "MODEL FIT INFORMATION"
[156] ""
[157] "Number of Free Parameters 54"
[158] ""
[159] "Information Criteria"
[160] ""
[161] " Deviance (DIC) 55402.881"
[162] " Estimated Number of Parameters (pD) 6600.693"
[163] ""
[164] ""
[165] ""
[166] "MODEL RESULTS"
[167] ""
[168] " Posterior One-Tailed 95% C.I."
[169] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[170] ""
[171] "Within Level"
[172] ""
[173] " POSC BY"
[174] " Y1 1.000 0.000 0.000 1.000 1.000"
[175] " Y2 1.000 0.000 0.000 1.000 1.000"
[176] ""
[177] "Between Level"
[178] ""
[179] " Y1 WITH"
[180] " AR1 0.001 0.021 0.477 -0.041 0.043"
[181] " AR2 0.024 0.022 0.124 -0.017 0.069"
[182] " CL12 0.016 0.022 0.229 -0.027 0.061"
[183] " CL21 -0.036 0.027 0.079 -0.095 0.015"
[184] " LOGV1 0.042 0.041 0.144 -0.035 0.125"
[185] " LOGV2 -0.016 0.040 0.330 -0.096 0.060"
[186] " LOGPOSC 0.028 0.046 0.265 -0.060 0.122"
[187] ""
[188] " Y2 WITH"
[189] " AR1 -0.030 0.034 0.176 -0.101 0.036"
[190] " AR2 -0.018 0.034 0.296 -0.085 0.048"
[191] " CL12 -0.055 0.037 0.053 -0.134 0.012"
[192] " CL21 -0.007 0.043 0.432 -0.093 0.078"
[193] " LOGV1 -0.063 0.063 0.147 -0.193 0.058"
[194] " LOGV2 0.047 0.062 0.215 -0.072 0.177"
[195] " LOGPOSC 0.085 0.075 0.118 -0.056 0.239"
[196] ""
[197] " AR1 WITH"
[198] " AR2 0.002 0.005 0.325 -0.007 0.011"
[199] " CL12 0.004 0.005 0.187 -0.005 0.013"
[200] " CL21 0.005 0.006 0.176 -0.005 0.018"
[201] " LOGV1 0.007 0.009 0.199 -0.010 0.025"
[202] " LOGV2 0.000 0.008 0.499 -0.017 0.017"
[203] " LOGPOSC -0.020 0.010 0.022 -0.042 0.000 *"
[204] ""
[205] " AR2 WITH"
[206] " CL12 -0.005 0.005 0.116 -0.015 0.004"
[207] " CL21 0.004 0.006 0.201 -0.007 0.016"
[208] " LOGV1 0.006 0.009 0.227 -0.012 0.024"
[209] " LOGV2 0.005 0.009 0.267 -0.012 0.023"
[210] " LOGPOSC -0.013 0.010 0.090 -0.036 0.006"
[211] ""
[212] " CL12 WITH"
[213] " CL21 0.014 0.006 0.006 0.003 0.027 *"
[214] " LOGV1 -0.002 0.009 0.433 -0.020 0.015"
[215] " LOGV2 0.010 0.009 0.129 -0.007 0.029"
[216] " LOGPOSC -0.006 0.011 0.272 -0.028 0.014"
[217] ""
[218] " CL21 WITH"
[219] " LOGV1 -0.010 0.011 0.172 -0.033 0.010"
[220] " LOGV2 0.004 0.011 0.368 -0.017 0.026"
[221] " LOGPOSC -0.033 0.014 0.003 -0.062 -0.009 *"
[222] ""
[223] " LOGV1 WITH"
[224] " LOGV2 -0.004 0.016 0.404 -0.037 0.025"
[225] " LOGPOSC -0.039 0.020 0.015 -0.084 -0.004 *"
[226] ""
[227] " LOGV2 WITH"
[228] " LOGPOSC 0.003 0.019 0.422 -0.035 0.040"
[229] ""
[230] " Y1 WITH"
[231] " Y2 -0.282 0.159 0.029 -0.622 0.009"
[232] ""
[233] " Means"
[234] " Y1 0.273 0.097 0.003 0.078 0.463 *"
[235] " Y2 1.050 0.154 0.000 0.747 1.357 *"
[236] " AR1 0.303 0.021 0.000 0.261 0.345 *"
[237] " CL12 0.055 0.022 0.007 0.012 0.098 *"
[238] " AR2 0.266 0.021 0.000 0.223 0.307 *"
[239] " CL21 -0.004 0.026 0.440 -0.055 0.048"
[240] " LOGV1 -0.329 0.040 0.000 -0.408 -0.251 *"
[241] " LOGV2 -0.265 0.039 0.000 -0.342 -0.190 *"
[242] " LOGPOSC -0.345 0.048 0.000 -0.442 -0.255 *"
[243] ""
[244] " Variances"
[245] " Y1 0.708 0.139 0.000 0.484 1.022 *"
[246] " Y2 1.833 0.345 0.000 1.275 2.659 *"
[247] " AR1 0.025 0.006 0.000 0.015 0.039 *"
[248] " CL12 0.029 0.007 0.000 0.017 0.044 *"
[249] " AR2 0.025 0.006 0.000 0.015 0.039 *"
[250] " CL21 0.046 0.010 0.000 0.029 0.069 *"
[251] " LOGV1 0.079 0.023 0.000 0.042 0.132 *"
[252] " LOGV2 0.080 0.023 0.000 0.042 0.132 *"
[253] " LOGPOSC 0.123 0.032 0.000 0.073 0.198 *"
[254] ""
[255] ""
[256] "STANDARDIZED MODEL RESULTS"
[257] ""
[258] ""
[259] "STDYX Standardization"
[260] ""
[261] " Posterior One-Tailed 95% C.I."
[262] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[263] ""
[264] "Within-Level Standardized Estimates Averaged Over Clusters"
[265] ""
[266] " POSC BY"
[267] " Y1 0.643 0.007 0.000 0.630 0.656 *"
[268] " Y2 0.645 0.006 0.000 0.633 0.657 *"
[269] ""
[270] " AR1 | Y1 ON"
[271] " Y1&1 0.305 0.011 0.000 0.284 0.328 *"
[272] ""
[273] " CL12 | Y1 ON"
[274] " Y2&1 0.051 0.012 0.000 0.027 0.073 *"
[275] ""
[276] " AR2 | Y2 ON"
[277] " Y2&1 0.266 0.012 0.000 0.244 0.290 *"
[278] ""
[279] " CL21 | Y2 ON"
[280] " Y1&1 -0.006 0.012 0.315 -0.029 0.018"
[281] ""
[282] " LOGPOSC |"
[283] " POSC 1.000 0.000 0.000 1.000 1.000"
[284] ""
[285] " LOGV1 |"
[286] " Y1 0.422 0.009 0.000 0.405 0.440 *"
[287] ""
[288] " LOGV2 |"
[289] " Y2 0.450 0.009 0.000 0.432 0.467 *"
[290] ""
[291] "Between Level"
[292] ""
[293] " Y1 WITH"
[294] " AR1 0.008 0.156 0.477 -0.299 0.310"
[295] " AR2 0.182 0.153 0.124 -0.123 0.465"
[296] " CL12 0.111 0.149 0.229 -0.187 0.393"
[297] " CL21 -0.202 0.140 0.079 -0.466 0.085"
[298] " LOGV1 0.178 0.164 0.144 -0.147 0.483"
[299] " LOGV2 -0.069 0.160 0.330 -0.376 0.249"
[300] " LOGPOSC 0.096 0.150 0.265 -0.203 0.379"
[301] ""
[302] " Y2 WITH"
[303] " AR1 -0.140 0.150 0.176 -0.427 0.166"
[304] " AR2 -0.082 0.152 0.296 -0.375 0.213"
[305] " CL12 -0.240 0.145 0.053 -0.507 0.053"
[306] " CL21 -0.024 0.143 0.432 -0.301 0.254"
[307] " LOGV1 -0.167 0.157 0.147 -0.467 0.155"
[308] " LOGV2 0.122 0.155 0.215 -0.190 0.418"
[309] " LOGPOSC 0.178 0.148 0.118 -0.118 0.454"
[310] ""
[311] " AR1 WITH"
[312] " AR2 0.081 0.176 0.325 -0.266 0.422"
[313] " CL12 0.154 0.171 0.187 -0.187 0.476"
[314] " CL21 0.150 0.160 0.176 -0.175 0.448"
[315] " LOGV1 0.158 0.188 0.199 -0.220 0.518"
[316] " LOGV2 0.000 0.187 0.499 -0.358 0.365"
[317] " LOGPOSC -0.353 0.163 0.022 -0.640 -0.009 *"
[318] ""
[319] " AR2 WITH"
[320] " CL12 -0.206 0.172 0.116 -0.524 0.147"
[321] " CL21 0.138 0.163 0.201 -0.185 0.453"
[322] " LOGV1 0.143 0.193 0.227 -0.264 0.492"
[323] " LOGV2 0.115 0.185 0.267 -0.258 0.464"
[324] " LOGPOSC -0.235 0.171 0.090 -0.554 0.110"
[325] ""
[326] " CL12 WITH"
[327] " CL21 0.396 0.143 0.006 0.093 0.650 *"
[328] " LOGV1 -0.033 0.184 0.433 -0.390 0.320"
[329] " LOGV2 0.208 0.177 0.129 -0.148 0.532"
[330] " LOGPOSC -0.103 0.171 0.272 -0.427 0.238"
[331] ""
[332] " CL21 WITH"
[333] " LOGV1 -0.167 0.172 0.172 -0.492 0.174"
[334] " LOGV2 0.059 0.174 0.368 -0.276 0.398"
[335] " LOGPOSC -0.443 0.143 0.003 -0.697 -0.143 *"
[336] ""
[337] " LOGV1 WITH"
[338] " LOGV2 -0.048 0.190 0.404 -0.416 0.323"
[339] " LOGPOSC -0.395 0.168 0.015 -0.686 -0.044 *"
[340] ""
[341] " LOGV2 WITH"
[342] " LOGPOSC 0.037 0.188 0.422 -0.327 0.406"
[343] ""
[344] " Y1 WITH"
[345] " Y2 -0.246 0.123 0.029 -0.473 0.008"
[346] ""
[347] " Means"
[348] " Y1 0.328 0.119 0.003 0.091 0.563 *"
[349] " Y2 0.786 0.134 0.000 0.526 1.051 *"
[350] " AR1 1.969 0.287 0.000 1.451 2.569 *"
[351] " CL12 0.335 0.137 0.007 0.072 0.607 *"
[352] " AR2 1.720 0.263 0.000 1.233 2.271 *"
[353] " CL21 -0.018 0.124 0.440 -0.258 0.228"
[354] " LOGV1 -1.206 0.213 0.000 -1.663 -0.820 *"
[355] " LOGV2 -0.964 0.189 0.000 -1.360 -0.619 *"
[356] " LOGPOSC -1.006 0.174 0.000 -1.366 -0.678 *"
[357] ""
[358] " Variances"
[359] " Y1 1.000 0.000 0.000 1.000 1.000"
[360] " Y2 1.000 0.000 0.000 1.000 1.000"
[361] " AR1 1.000 0.000 0.000 1.000 1.000"
[362] " CL12 1.000 0.000 0.000 1.000 1.000"
[363] " AR2 1.000 0.000 0.000 1.000 1.000"
[364] " CL21 1.000 0.000 0.000 1.000 1.000"
[365] " LOGV1 1.000 0.000 0.000 1.000 1.000"
[366] " LOGV2 1.000 0.000 0.000 1.000 1.000"
[367] " LOGPOSC 1.000 0.000 0.000 1.000 1.000"
[368] ""
[369] ""
Code
comp <- mplus_mlts_compare(mplus = mplus, mlts = fit,
fe_rows = c(39:42,44,43,45:47),
re_rows = c(39:42,44,43,45:47)+9)
comp_tab(comp)Type | Param | True | mlts | Mplus | ||||
|---|---|---|---|---|---|---|---|---|
Est | 95% CI | CI Width | Est | 95% CI | CI Width | |||
Fixed effect | mu_1 | 0.40 | 0.27 | [0.10, 0.45] | 0.34 | 0.27 | [0.08, 0.46] | 0.38 |
mu_2 | 0.90 | 1.05 | [0.78, 1.32] | 0.54 | 1.05 | [0.75, 1.36] | 0.61 | |
phi(1)_11 | 0.25 | 0.30 | [0.27, 0.34] | 0.08 | 0.30 | [0.26, 0.34] | 0.08 | |
phi(1)_12 | 0.10 | 0.06 | [0.02, 0.09] | 0.07 | 0.06 | [0.01, 0.10] | 0.09 | |
phi(1)_21 | 0.00 | -0.00 | [-0.05, 0.04] | 0.09 | -0.00 | [-0.06, 0.05] | 0.10 | |
phi(1)_22 | 0.30 | 0.27 | [0.23, 0.30] | 0.07 | 0.27 | [0.22, 0.31] | 0.08 | |
ln.sigma2_1 | -0.30 | -0.32 | [-0.39, -0.26] | 0.13 | -0.33 | [-0.41, -0.25] | 0.16 | |
ln.sigma2_2 | -0.30 | -0.26 | [-0.33, -0.20] | 0.13 | -0.26 | [-0.34, -0.19] | 0.15 | |
ln.sigma_12 | -0.30 | -0.34 | [-0.41, -0.26] | 0.15 | -0.34 | [-0.44, -0.26] | 0.19 | |
Random effect SD | sigma_mu_1 | 0.70 | 0.76 | [0.64, 0.90] | 0.25 | 0.84 | [0.70, 1.01] | 0.31 |
sigma_mu_2 | 1.10 | 1.22 | [1.04, 1.44] | 0.40 | 1.35 | [1.13, 1.63] | 0.50 | |
sigma_phi(1)_11 | 0.15 | 0.13 | [0.10, 0.17] | 0.07 | 0.16 | [0.12, 0.20] | 0.08 | |
sigma_phi(1)_12 | 0.15 | 0.14 | [0.11, 0.18] | 0.07 | 0.17 | [0.13, 0.21] | 0.08 | |
sigma_phi(1)_21 | 0.15 | 0.18 | [0.15, 0.22] | 0.08 | 0.21 | [0.17, 0.26] | 0.09 | |
sigma_phi(1)_22 | 0.15 | 0.14 | [0.10, 0.17] | 0.07 | 0.16 | [0.12, 0.20] | 0.08 | |
sigma_ln.sigma2_1 | 0.25 | 0.20 | [0.13, 0.28] | 0.15 | 0.28 | [0.20, 0.36] | 0.16 | |
sigma_ln.sigma2_2 | 0.25 | 0.22 | [0.15, 0.30] | 0.14 | 0.28 | [0.20, 0.36] | 0.16 | |
sigma_ln.sigma_12 | 0.25 | 0.28 | [0.22, 0.36] | 0.14 | 0.35 | [0.27, 0.44] | 0.17 | |
RE correlation | r_mu_1.mu_2 | -0.10 | -0.21 | [-0.42, 0.00] | 0.42 | -0.25 | [-0.47, 0.01] | 0.48 |
r_mu_1.phi(1)_11 | 0.05 | 0.01 | [-0.26, 0.28] | 0.54 | 0.01 | [-0.30, 0.31] | 0.61 | |
r_mu_1.phi(1)_12 | 0.20 | 0.10 | [-0.17, 0.36] | 0.52 | 0.11 | [-0.19, 0.39] | 0.58 | |
r_mu_1.phi(1)_21 | -0.15 | -0.18 | [-0.41, 0.07] | 0.47 | -0.20 | [-0.47, 0.09] | 0.55 | |
r_mu_1.phi(1)_22 | 0.20 | 0.15 | [-0.12, 0.42] | 0.54 | 0.18 | [-0.12, 0.47] | 0.59 | |
r_mu_1.ln.sigma2_1 | 0.20 | 0.19 | [-0.11, 0.48] | 0.59 | 0.18 | [-0.15, 0.48] | 0.63 | |
r_mu_1.ln.sigma2_2 | 0.00 | -0.05 | [-0.33, 0.25] | 0.59 | -0.07 | [-0.38, 0.25] | 0.62 | |
r_mu_1.ln.sigma_12 | 0.15 | 0.11 | [-0.15, 0.37] | 0.52 | 0.10 | [-0.20, 0.38] | 0.58 | |
r_mu_2.phi(1)_11 | 0.00 | -0.12 | [-0.37, 0.14] | 0.51 | -0.14 | [-0.43, 0.17] | 0.59 | |
r_mu_2.phi(1)_12 | -0.10 | -0.23 | [-0.47, 0.04] | 0.50 | -0.24 | [-0.51, 0.05] | 0.56 | |
r_mu_2.phi(1)_21 | 0.05 | -0.01 | [-0.26, 0.22] | 0.48 | -0.02 | [-0.30, 0.25] | 0.55 | |
r_mu_2.phi(1)_22 | -0.10 | -0.07 | [-0.33, 0.20] | 0.53 | -0.08 | [-0.38, 0.21] | 0.59 | |
r_mu_2.ln.sigma2_1 | 0.15 | -0.18 | [-0.47, 0.12] | 0.59 | -0.17 | [-0.47, 0.16] | 0.62 | |
r_mu_2.ln.sigma2_2 | -0.05 | 0.13 | [-0.16, 0.41] | 0.57 | 0.12 | [-0.19, 0.42] | 0.61 | |
r_mu_2.ln.sigma_12 | 0.10 | 0.16 | [-0.12, 0.41] | 0.52 | 0.18 | [-0.12, 0.45] | 0.57 | |
r_phi(1)_11.phi(1)_12 | -0.20 | 0.18 | [-0.12, 0.48] | 0.60 | 0.15 | [-0.19, 0.48] | 0.66 | |
r_phi(1)_11.phi(1)_21 | 0.00 | 0.08 | [-0.21, 0.36] | 0.58 | 0.15 | [-0.17, 0.45] | 0.62 | |
r_phi(1)_11.phi(1)_22 | 0.00 | 0.09 | [-0.23, 0.41] | 0.64 | 0.08 | [-0.27, 0.42] | 0.69 | |
r_phi(1)_11.ln.sigma2_1 | 0.05 | 0.14 | [-0.20, 0.49] | 0.69 | 0.16 | [-0.22, 0.52] | 0.74 | |
r_phi(1)_11.ln.sigma2_2 | 0.00 | -0.01 | [-0.34, 0.33] | 0.67 | 0.00 | [-0.36, 0.36] | 0.72 | |
r_phi(1)_11.ln.sigma_12 | -0.15 | -0.32 | [-0.60, -0.01] | 0.59 | -0.35 | [-0.64, -0.01] | 0.63 | |
r_phi(1)_12.phi(1)_21 | 0.20 | 0.39 | [0.10, 0.63] | 0.53 | 0.40 | [0.09, 0.65] | 0.56 | |
r_phi(1)_12.phi(1)_22 | 0.05 | -0.24 | [-0.52, 0.06] | 0.58 | -0.21 | [-0.52, 0.15] | 0.67 | |
r_phi(1)_12.ln.sigma2_1 | -0.05 | -0.05 | [-0.39, 0.31] | 0.70 | -0.03 | [-0.39, 0.32] | 0.71 | |
r_phi(1)_12.ln.sigma2_2 | 0.05 | 0.21 | [-0.14, 0.52] | 0.66 | 0.21 | [-0.15, 0.53] | 0.68 | |
r_phi(1)_12.ln.sigma_12 | 0.00 | -0.11 | [-0.40, 0.19] | 0.59 | -0.10 | [-0.43, 0.24] | 0.66 | |
r_phi(1)_21.phi(1)_22 | 0.00 | 0.17 | [-0.12, 0.44] | 0.56 | 0.14 | [-0.18, 0.45] | 0.64 | |
r_phi(1)_21.ln.sigma2_1 | -0.05 | -0.18 | [-0.48, 0.13] | 0.62 | -0.17 | [-0.49, 0.17] | 0.67 | |
r_phi(1)_21.ln.sigma2_2 | -0.05 | 0.05 | [-0.27, 0.36] | 0.63 | 0.06 | [-0.28, 0.40] | 0.67 | |
r_phi(1)_21.ln.sigma_12 | -0.20 | -0.44 | [-0.68, -0.16] | 0.51 | -0.44 | [-0.70, -0.14] | 0.55 | |
r_phi(1)_22.ln.sigma2_1 | -0.15 | 0.14 | [-0.22, 0.49] | 0.71 | 0.14 | [-0.26, 0.49] | 0.76 | |
r_phi(1)_22.ln.sigma2_2 | 0.15 | 0.10 | [-0.23, 0.42] | 0.65 | 0.12 | [-0.26, 0.46] | 0.72 | |
r_phi(1)_22.ln.sigma_12 | -0.05 | -0.22 | [-0.52, 0.10] | 0.61 | -0.23 | [-0.55, 0.11] | 0.66 | |
r_ln.sigma2_1.ln.sigma2_2 | 0.05 | -0.01 | [-0.37, 0.37] | 0.74 | -0.05 | [-0.42, 0.32] | 0.74 | |
r_ln.sigma2_1.ln.sigma_12 | -0.10 | -0.34 | [-0.66, 0.01] | 0.67 | -0.40 | [-0.69, -0.04] | 0.64 | |
r_ln.sigma2_2.ln.sigma_12 | 0.05 | 0.08 | [-0.28, 0.41] | 0.70 | 0.04 | [-0.33, 0.41] | 0.73 | |
Code
P <- mplus_mlts_comp_plot(comp)
P[[1]]
P[[2]]
P[[3]]Parameters with absolute posterior mean difference larger than 0.01:
Code
mplus_mlts_diff(comp, tol = 0.01)Param | True | mlts | Mplus | Diff |
|---|---|---|---|---|
Est | Est | |||
sigma_mu_2 | 1.10 | 1.22 | 1.35 | -0.13 |
sigma_mu_1 | 0.70 | 0.76 | 0.84 | -0.08 |
sigma_ln.sigma2_1 | 0.25 | 0.20 | 0.28 | -0.08 |
sigma_ln.sigma_12 | 0.25 | 0.28 | 0.35 | -0.07 |
r_phi(1)_11.phi(1)_21 | 0.00 | 0.08 | 0.15 | -0.07 |
sigma_ln.sigma2_2 | 0.25 | 0.22 | 0.28 | -0.06 |
r_ln.sigma2_1.ln.sigma_12 | -0.10 | -0.34 | -0.40 | 0.05 |
r_ln.sigma2_2.ln.sigma_12 | 0.05 | 0.08 | 0.04 | 0.04 |
r_ln.sigma2_1.ln.sigma2_2 | 0.05 | -0.01 | -0.05 | 0.04 |
r_phi(1)_11.ln.sigma_12 | -0.15 | -0.32 | -0.35 | 0.04 |
r_phi(1)_12.phi(1)_22 | 0.05 | -0.24 | -0.21 | -0.04 |
r_mu_1.mu_2 | -0.10 | -0.21 | -0.25 | 0.03 |
sigma_phi(1)_21 | 0.15 | 0.18 | 0.21 | -0.03 |
r_phi(1)_21.phi(1)_22 | 0.00 | 0.17 | 0.14 | 0.03 |
r_mu_1.phi(1)_22 | 0.20 | 0.15 | 0.18 | -0.03 |
sigma_phi(1)_12 | 0.15 | 0.14 | 0.17 | -0.03 |
r_phi(1)_11.phi(1)_12 | -0.20 | 0.18 | 0.15 | 0.03 |
sigma_phi(1)_11 | 0.15 | 0.13 | 0.16 | -0.02 |
sigma_phi(1)_22 | 0.15 | 0.14 | 0.16 | -0.02 |
r_mu_2.ln.sigma_12 | 0.10 | 0.16 | 0.18 | -0.02 |
r_mu_1.phi(1)_21 | -0.15 | -0.18 | -0.20 | 0.02 |
r_phi(1)_22.ln.sigma2_2 | 0.15 | 0.10 | 0.12 | -0.02 |
r_phi(1)_12.ln.sigma2_1 | -0.05 | -0.05 | -0.03 | -0.02 |
r_mu_2.phi(1)_11 | 0.00 | -0.12 | -0.14 | 0.02 |
r_phi(1)_21.ln.sigma2_1 | -0.05 | -0.18 | -0.17 | -0.02 |
r_mu_1.ln.sigma2_2 | 0.00 | -0.05 | -0.07 | 0.02 |
r_phi(1)_11.ln.sigma2_1 | 0.05 | 0.14 | 0.16 | -0.01 |
r_mu_2.phi(1)_12 | -0.10 | -0.23 | -0.24 | 0.01 |
r_phi(1)_11.ln.sigma2_2 | 0.00 | -0.01 | 0.00 | -0.01 |
r_mu_1.ln.sigma_12 | 0.15 | 0.11 | 0.10 | 0.01 |
r_mu_2.phi(1)_22 | -0.10 | -0.07 | -0.08 | 0.01 |
r_phi(1)_22.ln.sigma_12 | -0.05 | -0.22 | -0.23 | 0.01 |
r_mu_2.ln.sigma2_1 | 0.15 | -0.18 | -0.17 | -0.01 |
r_mu_1.ln.sigma2_1 | 0.20 | 0.19 | 0.18 | 0.01 |
Within-Level Standardized Effects
mplus$parameters$stdyx.standardized[c(3,4,6,5),c(1:4,6,7)] paramHeader param est posterior_sd lower_2.5ci upper_2.5ci
3 AR1|Y1.ON Y1&1 0.305 0.011 0.284 0.328
4 CL12|Y1.ON Y2&1 0.051 0.012 0.027 0.073
6 CL21|Y2.ON Y1&1 -0.006 0.012 -0.029 0.018
5 AR2|Y2.ON Y2&1 0.266 0.012 0.244 0.290
mlts_standardized(object = fit, what = "within")$`Within-level standardized effects averaged over clusters`
Type Param Std.Est SD 2.5% 97.5%
1 Fixed effect phi(1)_11 0.304 0.011 0.283 0.326
2 Fixed effect phi(1)_12 0.052 0.011 0.031 0.073
3 Fixed effect phi(1)_21 -0.007 0.011 -0.029 0.015
4 Fixed effect phi(1)_22 0.268 0.011 0.246 0.290
6 Multiple-Indicator VAR(1) with random Innovation covariance
mod.id = 7
# model specification
model <- mlts_model(
q = 2, # no. of constructs
p = c(3,3), # no. of manifest indicators per construct
fix_inno_covs = F, # random innovation co-variance
inno_covs_dir = "pos" # assume positive innovation covariances / correlations
)
# generate data
simData <- mlts_sim(
model, N = 100, TP = 110,
default = T, seed = mod.id, seed.true = mod.id)
# path model
mlts_paths(model, asp_decomp = 0.45,remove_lag_lab = T)fit = mlts_fit(
model,
data = simData,
ts = c("Y1.1","Y1.2","Y1.3", "Y2.1","Y2.2","Y2.3"),
cores = n_cores,
chains = n_chains,
iter = n_iter,
seed = mod.id,
monitor_person_pars = T,
get_SD_latent = TRUE
)Model estimation ended after 79.1 minutes.
summary(fit, digits = 2)Time series variables as indicated by parameter subscripts:
1 --> Y1.1 + Y1.2 + Y1.3
2 --> Y2.1 + Y2.2 + Y2.3
Data: 11000 observations in 100 IDs
Model convergence criteria:
Maximum Potential Scale Reduction Factor (PSR; Rhat): 1.295 (should be < 1.01)
Minimum Bulk ESS: 11 (should be > 400, 100 per chain)
Minimum Tail ESS: 24 (should be > 400, 100 per chain)
Number of divergent transitions: 5 (should be 0)
Posterior Summary Statistics
Fixed Effects:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
etaB_1 1.14 0.09 0.97 1.31 1.00 2453 3043
etaB_2 0.39 0.09 0.21 0.57 1.01 1318 3406
phi(1)_11 0.18 0.02 0.15 0.22 1.00 1171 2465
phi(1)_12 0.04 0.02 0.00 0.07 1.00 1060 1461
phi(1)_21 -0.16 0.02 -0.20 -0.13 1.00 1316 1819
phi(1)_22 0.30 0.02 0.26 0.34 1.01 1371 3039
ln.sigma2_1 -0.31 0.03 -0.37 -0.25 1.00 817 1634
ln.sigma2_2 -0.33 0.04 -0.40 -0.26 1.00 1383 2682
ln.sigma_12 -0.25 0.03 -0.31 -0.19 1.00 1158 2287
Random Effects SDs:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
sigma_etaB_1 0.88 0.06 0.76 1.01 1.00 821 3415
sigma_etaB_2 0.87 0.07 0.75 1.01 1.02 234 2290
sigma_phi(1)_11 0.13 0.02 0.10 0.17 1.01 499 1244
sigma_phi(1)_12 0.12 0.02 0.10 0.16 1.01 675 1848
sigma_phi(1)_21 0.15 0.02 0.12 0.18 1.00 746 1395
sigma_phi(1)_22 0.15 0.02 0.12 0.19 1.00 1181 2281
sigma_ln.sigma2_1 0.20 0.03 0.13 0.27 1.01 383 832
sigma_ln.sigma2_2 0.26 0.03 0.20 0.34 1.01 671 1270
sigma_ln.sigma_12 0.22 0.03 0.16 0.29 1.00 521 1037
Random Effects Correlations:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
etaB_1.etaB_2 -0.09 0.10 -0.29 0.10 1.00 1228 2614
etaB_1.phi(1)_11 0.28 0.12 0.05 0.50 1.01 728 1651
etaB_1.phi(1)_12 0.03 0.13 -0.21 0.28 1.00 1228 2406
etaB_1.phi(1)_21 0.15 0.11 -0.08 0.37 1.01 1110 2165
etaB_1.phi(1)_22 0.08 0.12 -0.14 0.31 1.00 1591 2460
etaB_1.ln.sigma2_1 0.45 0.13 0.18 0.69 1.01 597 976
etaB_1.ln.sigma2_2 0.01 0.13 -0.23 0.26 1.00 1264 2489
etaB_1.ln.sigma_12 -0.12 0.13 -0.37 0.14 1.00 1345 2566
etaB_2.phi(1)_11 0.24 0.12 -0.01 0.46 1.01 671 728
etaB_2.phi(1)_12 -0.34 0.12 -0.56 -0.10 1.01 676 1922
etaB_2.phi(1)_21 0.24 0.12 0.00 0.46 1.01 816 2244
etaB_2.phi(1)_22 0.13 0.12 -0.11 0.37 1.02 297 2264
etaB_2.ln.sigma2_1 0.00 0.15 -0.29 0.29 1.01 827 1389
etaB_2.ln.sigma2_2 0.22 0.13 -0.03 0.47 1.00 902 1867
etaB_2.ln.sigma_12 0.00 0.13 -0.26 0.27 1.01 810 2017
phi(1)_11.phi(1)_12 0.01 0.16 -0.29 0.32 1.01 558 1596
phi(1)_11.phi(1)_21 0.19 0.14 -0.10 0.45 1.00 775 1691
phi(1)_11.phi(1)_22 -0.12 0.14 -0.39 0.16 1.00 978 2102
phi(1)_11.ln.sigma2_1 -0.05 0.17 -0.38 0.28 1.00 681 1581
phi(1)_11.ln.sigma2_2 -0.36 0.14 -0.63 -0.06 1.01 687 1597
phi(1)_11.ln.sigma_12 -0.16 0.16 -0.47 0.17 1.01 568 1239
phi(1)_12.phi(1)_21 0.18 0.14 -0.11 0.45 1.00 912 2310
phi(1)_12.phi(1)_22 -0.18 0.14 -0.46 0.10 1.00 843 1508
phi(1)_12.ln.sigma2_1 -0.30 0.17 -0.62 0.05 1.02 345 910
phi(1)_12.ln.sigma2_2 -0.23 0.16 -0.53 0.08 1.01 783 1103
phi(1)_12.ln.sigma_12 0.03 0.17 -0.33 0.35 1.01 382 869
phi(1)_21.phi(1)_22 0.33 0.14 0.05 0.58 1.01 753 1244
phi(1)_21.ln.sigma2_1 0.07 0.17 -0.26 0.39 1.00 752 1774
phi(1)_21.ln.sigma2_2 -0.32 0.14 -0.58 -0.02 1.01 723 1510
phi(1)_21.ln.sigma_12 -0.05 0.16 -0.36 0.26 1.01 891 2015
phi(1)_22.ln.sigma2_1 -0.07 0.16 -0.37 0.27 1.01 820 1386
phi(1)_22.ln.sigma2_2 0.17 0.15 -0.13 0.45 1.00 889 1770
phi(1)_22.ln.sigma_12 0.27 0.16 -0.04 0.57 1.01 628 911
ln.sigma2_1.ln.sigma2_2 0.09 0.18 -0.26 0.46 1.00 642 1318
ln.sigma2_1.ln.sigma_12 -0.02 0.20 -0.39 0.38 1.00 506 1055
ln.sigma2_2.ln.sigma_12 0.32 0.17 -0.03 0.66 1.01 451 1017
Measurement Model Parameters:
Mean SD 2.5% 97.5% Rhat Bulk_ESS Tail_ESS
alpha_1.1 0.00 0.00 0.00 0.00 1.00 5000 5000
alpha_1.2 0.96 0.03 0.90 1.03 1.00 1810 2681
alpha_1.3 1.49 0.03 1.44 1.55 1.00 2435 3089
alpha_2.1 0.00 0.00 0.00 0.00 1.00 5000 5000
alpha_2.2 1.50 0.02 1.47 1.54 1.00 3287 3228
alpha_2.3 1.96 0.02 1.92 2.01 1.00 3720 3265
lambdaB_1.1 1.00 0.00 1.00 1.00 1.00 5000 5000
lambdaB_1.2 0.78 0.02 0.73 0.82 1.00 1324 2942
lambdaB_1.3 0.87 0.02 0.83 0.91 1.00 2157 2784
lambdaB_2.1 1.00 0.00 1.00 1.00 1.00 5000 5000
lambdaB_2.2 0.79 0.02 0.75 0.82 1.00 2776 3047
lambdaB_2.3 0.84 0.03 0.79 0.89 1.00 1428 2651
lambdaW_1.1 1.00 0.00 1.00 1.00 1.00 5000 5000
lambdaW_1.2 0.75 0.00 0.75 0.76 1.00 1731 2792
lambdaW_1.3 0.75 0.00 0.75 0.76 1.00 2200 3169
lambdaW_2.1 1.00 0.00 1.00 1.00 1.00 5000 5000
lambdaW_2.2 0.80 0.00 0.80 0.80 1.00 1857 1605
lambdaW_2.3 0.80 0.00 0.80 0.81 1.00 3542 3403
sigmaB_1.1 0.00 0.00 0.00 0.00 1.00 5000 5000
sigmaB_1.2 0.18 0.01 0.16 0.21 1.00 4710 3465
sigmaB_1.3 0.16 0.01 0.14 0.18 1.00 3762 3081
sigmaB_2.1 0.00 0.00 0.00 0.00 1.00 5000 5000
sigmaB_2.2 0.16 0.01 0.14 0.19 1.00 3516 2880
sigmaB_2.3 0.21 0.02 0.18 0.24 1.00 4023 3831
sigmaW_1.1 0.30 0.00 0.29 0.31 1.00 1986 3050
sigmaW_1.2 0.19 0.00 0.19 0.20 1.00 1466 2726
sigmaW_1.3 0.25 0.00 0.25 0.26 1.00 2274 3384
sigmaW_2.1 0.25 0.00 0.25 0.26 1.00 1436 2758
sigmaW_2.2 0.20 0.00 0.19 0.20 1.01 1190 2327
sigmaW_2.3 0.30 0.00 0.29 0.30 1.00 3696 3615
Samples were drawn using NUTS on Thu Dec 11 00:43:42 2025.
For each parameter, Bulk_ESS and Tail_ESS are measures of effective
sample size, and Rhat is the potential scale reduction factor
on split chains (at convergence, Rhat = 1).
Code
# save data for Mplus
mplus = simData$data
colnames(mplus) <- NULL
write.table(mplus, file = paste0("Mplus/",mod.id,"_data.dat"), row.names = F)
file = paste0("Mplus/",mod.id,"_mplus_model.inp")
if(refit.mplus == T){
# run mplus model
runModels(target = file, showOutput = T, quiet = F)
}
# load results
mplus = readModels(target = paste0("Mplus/",mod.id,"_mplus_model.out"),
what = "parameters")
# full results
readLines(gsub(file,pattern=".inp",replacement=".out"))[1:369] [1] "Mplus VERSION 8.7"
[2] "MUTHEN & MUTHEN"
[3] "12/11/2025 12:45 AM"
[4] ""
[5] "INPUT INSTRUCTIONS"
[6] ""
[7] " DATA: file = 7_data.dat;"
[8] ""
[9] " VARIABLE:"
[10] " names = ID beep Y1 Y2 Y3 Y4 Y5 Y6;"
[11] " cluster = ID;"
[12] " usevar = Y1 Y2 Y3 Y4 Y5 Y6;"
[13] " missing = all(-99);"
[14] ""
[15] " ANALYSIS: TYPE = twolevel random;"
[16] " point = mean;"
[17] " estimator = bayes;"
[18] " proc = 2;"
[19] " Biterations = (15000);"
[20] " Bconvergence = .025;"
[21] " bseed = 12345;"
[22] " thin = 1;"
[23] ""
[24] " MODEL:"
[25] " %WITHIN%"
[26] ""
[27] " f1 by Y1@1 Y2 Y3 (&1);"
[28] " f2 by Y4@1 Y5 Y6 (&1);"
[29] ""
[30] " AR1 | f1 on f1&1;"
[31] " CL12 | f1 on f2&1;"
[32] " CL21 | f2 on f1&1;"
[33] " AR2 | f2 on f2&1;"
[34] ""
[35] " logv1 | f1;"
[36] " logv2 | f2;"
[37] " eta BY f1@1 f2@1;"
[38] " logv12 | eta;"
[39] ""
[40] " %BETWEEN%"
[41] ""
[42] " fb1 by Y1@1 Y2 Y3;"
[43] " fb2 by Y4@1 Y5 Y6;"
[44] " [fb1*];"
[45] " Y1@0;"
[46] " [Y1@0];"
[47] " [fb2*];"
[48] " Y4@0;"
[49] " [Y4@0];"
[50] ""
[51] " fb1 fb2 AR1 CL21 CL12 AR2 logv1 logv2 logv12 with"
[52] " fb1 fb2 AR1 CL21 CL12 AR2 logv1 logv2 logv12;"
[53] ""
[54] " OUTPUT: TECH1 TECH8 stdyx(cluster);"
[55] ""
[56] ""
[57] ""
[58] "INPUT READING TERMINATED NORMALLY"
[59] ""
[60] ""
[61] ""
[62] ""
[63] "SUMMARY OF ANALYSIS"
[64] ""
[65] "Number of groups 1"
[66] "Number of observations 11000"
[67] ""
[68] "Number of dependent variables 6"
[69] "Number of independent variables 0"
[70] "Number of continuous latent variables 15"
[71] ""
[72] "Observed dependent variables"
[73] ""
[74] " Continuous"
[75] " Y1 Y2 Y3 Y4 Y5 Y6"
[76] ""
[77] "Continuous latent variables"
[78] " F1 F2 ETA F1&1 F2&1 ETA&1"
[79] " FB1 FB2 AR1 CL12 CL21 AR2"
[80] " LOGV1 LOGV2 LOGV12"
[81] ""
[82] "Variables with special functions"
[83] ""
[84] " Cluster variable ID"
[85] ""
[86] "Estimator BAYES"
[87] "Specifications for Bayesian Estimation"
[88] " Point estimate MEAN"
[89] " Number of Markov chain Monte Carlo (MCMC) chains 2"
[90] " Random seed for the first chain 12345"
[91] " Starting value information UNPERTURBED"
[92] " Algorithm used for Markov chain Monte Carlo GIBBS(PX1)"
[93] " Convergence criterion 0.250D-01"
[94] " Maximum number of iterations 50000"
[95] " K-th iteration used for thinning 1"
[96] ""
[97] "Input data file(s)"
[98] " 7_data.dat"
[99] "Input data format FREE"
[100] ""
[101] ""
[102] "SUMMARY OF DATA"
[103] ""
[104] " Number of clusters 100"
[105] ""
[106] " Size (s) Cluster ID with Size s"
[107] ""
[108] " 110 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21"
[109] " 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39"
[110] " 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57"
[111] " 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75"
[112] " 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93"
[113] " 94 95 96 97 98 99 100"
[114] ""
[115] ""
[116] ""
[117] "COVARIANCE COVERAGE OF DATA"
[118] ""
[119] "Minimum covariance coverage value 0.100"
[120] ""
[121] " Number of missing data patterns 1"
[122] ""
[123] ""
[124] " PROPORTION OF DATA PRESENT"
[125] ""
[126] ""
[127] " Covariance Coverage"
[128] " Y1 Y2 Y3 Y4 Y5"
[129] " ________ ________ ________ ________ ________"
[130] " Y1 1.000"
[131] " Y2 1.000 1.000"
[132] " Y3 1.000 1.000 1.000"
[133] " Y4 1.000 1.000 1.000 1.000"
[134] " Y5 1.000 1.000 1.000 1.000 1.000"
[135] " Y6 1.000 1.000 1.000 1.000 1.000"
[136] ""
[137] ""
[138] " Covariance Coverage"
[139] " Y6"
[140] " ________"
[141] " Y6 1.000"
[142] ""
[143] ""
[144] ""
[145] "UNIVARIATE SAMPLE STATISTICS"
[146] ""
[147] ""
[148] " UNIVARIATE HIGHER-ORDER MOMENT DESCRIPTIVE STATISTICS"
[149] ""
[150] " Variable/ Mean/ Skewness/ Minimum/ % with Percentiles"
[151] " Sample Size Variance Kurtosis Maximum Min/Max 20%/60% 40%/80% Median"
[152] ""
[153] " Y1 1.136 0.035 -4.295 0.01% -0.172 0.716 1.124"
[154] " 11000.000 2.474 0.023 8.012 0.01% 1.518 2.439"
[155] " Y2 1.847 0.055 -2.389 0.01% 0.845 1.526 1.839"
[156] " 11000.000 1.450 0.105 7.546 0.01% 2.135 2.852"
[157] " Y3 2.479 0.076 -1.577 0.01% 1.433 2.148 2.457"
[158] " 11000.000 1.565 0.044 8.119 0.01% 2.781 3.522"
[159] " Y4 0.382 0.079 -5.804 0.01% -0.953 -0.033 0.366"
[160] " 11000.000 2.542 0.212 7.396 0.01% 0.763 1.697"
[161] " Y5 1.803 0.057 -3.166 0.01% 0.730 1.480 1.794"
[162] " 11000.000 1.636 0.189 7.664 0.01% 2.117 2.858"
[163] " Y6 2.283 0.078 -2.963 0.01% 1.162 1.938 2.267"
[164] " 11000.000 1.764 0.098 7.610 0.01% 2.602 3.394"
[165] ""
[166] ""
[167] "THE MODEL ESTIMATION TERMINATED NORMALLY"
[168] ""
[169] " USE THE FBITERATIONS OPTION TO INCREASE THE NUMBER OF ITERATIONS BY A FACTOR"
[170] " OF AT LEAST TWO TO CHECK CONVERGENCE AND THAT THE PSR VALUE DOES NOT INCREASE."
[171] ""
[172] ""
[173] ""
[174] "MODEL FIT INFORMATION"
[175] ""
[176] "Number of Free Parameters 76"
[177] ""
[178] "Information Criteria"
[179] ""
[180] " Deviance (DIC) 23810.876"
[181] " Estimated Number of Parameters (pD) 21813.095"
[182] ""
[183] ""
[184] ""
[185] "MODEL RESULTS"
[186] ""
[187] " Posterior One-Tailed 95% C.I."
[188] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[189] ""
[190] "Within Level"
[191] ""
[192] " F1 BY"
[193] " Y1 1.000 0.000 0.000 1.000 1.000"
[194] " Y2 0.754 0.002 0.000 0.750 0.759 *"
[195] " Y3 0.751 0.003 0.000 0.746 0.756 *"
[196] ""
[197] " F2 BY"
[198] " Y4 1.000 0.000 0.000 1.000 1.000"
[199] " Y5 0.801 0.002 0.000 0.797 0.805 *"
[200] " Y6 0.802 0.003 0.000 0.796 0.807 *"
[201] ""
[202] " ETA BY"
[203] " F1 1.000 0.000 0.000 1.000 1.000"
[204] " F2 1.000 0.000 0.000 1.000 1.000"
[205] ""
[206] " Residual Variances"
[207] " Y1 0.091 0.002 0.000 0.087 0.094 *"
[208] " Y2 0.038 0.001 0.000 0.036 0.040 *"
[209] " Y3 0.064 0.001 0.000 0.061 0.066 *"
[210] " Y4 0.064 0.002 0.000 0.061 0.067 *"
[211] " Y5 0.039 0.001 0.000 0.037 0.041 *"
[212] " Y6 0.089 0.001 0.000 0.086 0.092 *"
[213] ""
[214] "Between Level"
[215] ""
[216] " FB1 BY"
[217] " Y1 1.000 0.000 0.000 1.000 1.000"
[218] " Y2 0.777 0.023 0.000 0.732 0.821 *"
[219] " Y3 0.867 0.020 0.000 0.828 0.906 *"
[220] ""
[221] " FB2 BY"
[222] " Y4 1.000 0.000 0.000 1.000 1.000"
[223] " Y5 0.785 0.020 0.000 0.746 0.824 *"
[224] " Y6 0.842 0.026 0.000 0.791 0.893 *"
[225] ""
[226] " FB1 WITH"
[227] " FB2 -0.082 0.104 0.209 -0.292 0.119"
[228] " AR1 0.042 0.022 0.019 0.002 0.088 *"
[229] " CL21 0.027 0.022 0.105 -0.016 0.073"
[230] " CL12 0.004 0.020 0.427 -0.036 0.044"
[231] " AR2 0.011 0.022 0.305 -0.032 0.056"
[232] " LOGV1 0.106 0.040 0.001 0.035 0.191 *"
[233] " LOGV2 -0.005 0.042 0.445 -0.089 0.076"
[234] " LOGV12 -0.035 0.037 0.163 -0.112 0.036"
[235] ""
[236] " FB2 WITH"
[237] " AR1 0.037 0.021 0.032 -0.002 0.082"
[238] " CL21 0.041 0.022 0.027 -0.001 0.089"
[239] " CL12 -0.052 0.020 0.003 -0.096 -0.015 *"
[240] " AR2 0.023 0.022 0.147 -0.021 0.068"
[241] " LOGV1 -0.004 0.039 0.456 -0.081 0.074"
[242] " LOGV2 0.068 0.042 0.044 -0.011 0.156"
[243] " LOGV12 0.003 0.037 0.474 -0.070 0.074"
[244] ""
[245] " AR1 WITH"
[246] " CL21 0.007 0.005 0.035 -0.001 0.017"
[247] " CL12 -0.002 0.004 0.334 -0.010 0.006"
[248] " AR2 -0.004 0.004 0.163 -0.014 0.004"
[249] " LOGV1 0.000 0.008 0.476 -0.015 0.014"
[250] " LOGV2 -0.019 0.008 0.008 -0.036 -0.003 *"
[251] " LOGV12 -0.008 0.008 0.143 -0.023 0.007"
[252] ""
[253] " CL21 WITH"
[254] " CL12 0.003 0.004 0.213 -0.005 0.011"
[255] " AR2 0.008 0.005 0.039 -0.001 0.017"
[256] " LOGV1 0.005 0.008 0.281 -0.011 0.021"
[257] " LOGV2 -0.017 0.009 0.017 -0.036 -0.001 *"
[258] " LOGV12 -0.004 0.008 0.323 -0.020 0.013"
[259] ""
[260] " CL12 WITH"
[261] " AR2 -0.002 0.004 0.262 -0.010 0.005"
[262] " LOGV1 -0.011 0.007 0.059 -0.026 0.003"
[263] " LOGV2 -0.009 0.008 0.126 -0.025 0.006"
[264] " LOGV12 0.002 0.007 0.412 -0.012 0.016"
[265] ""
[266] " AR2 WITH"
[267] " LOGV1 -0.006 0.008 0.232 -0.022 0.010"
[268] " LOGV2 0.011 0.009 0.099 -0.006 0.029"
[269] " LOGV12 0.014 0.008 0.039 -0.001 0.031"
[270] ""
[271] " LOGV1 WITH"
[272] " LOGV2 0.001 0.015 0.446 -0.030 0.030"
[273] " LOGV12 -0.009 0.013 0.262 -0.036 0.016"
[274] ""
[275] " LOGV2 WITH"
[276] " LOGV12 0.024 0.015 0.048 -0.004 0.054"
[277] ""
[278] " Means"
[279] " FB1 1.133 0.095 0.000 0.948 1.321 *"
[280] " FB2 0.392 0.096 0.000 0.207 0.581 *"
[281] " AR1 0.179 0.019 0.000 0.141 0.217 *"
[282] " CL12 0.038 0.018 0.019 0.002 0.074 *"
[283] " CL21 -0.163 0.020 0.000 -0.203 -0.124 *"
[284] " AR2 0.301 0.020 0.000 0.261 0.340 *"
[285] " LOGV1 -0.318 0.036 0.000 -0.389 -0.250 *"
[286] " LOGV2 -0.329 0.039 0.000 -0.408 -0.254 *"
[287] " LOGV12 -0.250 0.035 0.000 -0.320 -0.181 *"
[288] ""
[289] " Intercepts"
[290] " Y1 0.000 0.000 1.000 0.000 0.000"
[291] " Y2 0.965 0.032 0.000 0.902 1.028 *"
[292] " Y3 1.494 0.028 0.000 1.439 1.549 *"
[293] " Y4 0.000 0.000 1.000 0.000 0.000"
[294] " Y5 1.503 0.018 0.000 1.468 1.539 *"
[295] " Y6 1.961 0.023 0.000 1.914 2.007 *"
[296] ""
[297] " Variances"
[298] " FB1 0.902 0.150 0.000 0.655 1.236 *"
[299] " FB2 0.885 0.147 0.000 0.640 1.214 *"
[300] " AR1 0.025 0.006 0.000 0.015 0.038 *"
[301] " CL12 0.021 0.005 0.000 0.013 0.033 *"
[302] " CL21 0.029 0.007 0.000 0.019 0.044 *"
[303] " AR2 0.030 0.006 0.000 0.019 0.044 *"
[304] " LOGV1 0.067 0.019 0.000 0.036 0.111 *"
[305] " LOGV2 0.095 0.023 0.000 0.056 0.147 *"
[306] " LOGV12 0.071 0.018 0.000 0.040 0.113 *"
[307] ""
[308] " Residual Variances"
[309] " Y1 0.001 0.000 0.000 0.001 0.001"
[310] " Y2 0.033 0.005 0.000 0.025 0.045 *"
[311] " Y3 0.025 0.004 0.000 0.018 0.034 *"
[312] " Y4 0.001 0.000 0.000 0.001 0.001"
[313] " Y5 0.026 0.004 0.000 0.019 0.035 *"
[314] " Y6 0.042 0.007 0.000 0.031 0.057 *"
[315] ""
[316] ""
[317] "STANDARDIZED MODEL RESULTS"
[318] ""
[319] ""
[320] "STDYX Standardization"
[321] ""
[322] " Posterior One-Tailed 95% C.I."
[323] " Estimate S.D. P-Value Lower 2.5% Upper 2.5% Significance"
[324] ""
[325] "Within-Level Standardized Estimates Averaged Over Clusters"
[326] ""
[327] " F1 BY"
[328] " Y1 0.974 0.001 0.000 0.972 0.975 *"
[329] " Y2 0.980 0.001 0.000 0.979 0.981 *"
[330] " Y3 0.967 0.001 0.000 0.966 0.969 *"
[331] ""
[332] " F2 BY"
[333] " Y4 0.982 0.001 0.000 0.980 0.983 *"
[334] " Y5 0.982 0.001 0.000 0.981 0.983 *"
[335] " Y6 0.961 0.001 0.000 0.960 0.963 *"
[336] ""
[337] " ETA BY"
[338] " F1 0.687 0.007 0.000 0.673 0.699 *"
[339] " F2 0.672 0.006 0.000 0.660 0.683 *"
[340] ""
[341] " AR1 | F1 ON"
[342] " F1&1 0.180 0.011 0.000 0.158 0.202 *"
[343] ""
[344] " CL12 | F1 ON"
[345] " F2&1 0.037 0.011 0.002 0.015 0.057 *"
[346] ""
[347] " CL21 | F2 ON"
[348] " F1&1 -0.155 0.010 0.000 -0.175 -0.136 *"
[349] ""
[350] " AR2 | F2 ON"
[351] " F2&1 0.301 0.011 0.000 0.280 0.321 *"
[352] ""
[353] " LOGV1 |"
[354] " F1 0.446 0.009 0.000 0.429 0.464 *"
[355] ""
[356] " LOGV2 |"
[357] " F2 0.421 0.008 0.000 0.406 0.437 *"
[358] ""
[359] " LOGV12 |"
[360] " ETA 1.000 0.000 0.000 1.000 1.000"
[361] ""
[362] " Residual Variances"
[363] " Y1 0.052 0.001 0.000 0.050 0.055 *"
[364] " Y2 0.039 0.001 0.000 0.037 0.041 *"
[365] " Y3 0.064 0.001 0.000 0.061 0.067 *"
[366] " Y4 0.036 0.001 0.000 0.034 0.039 *"
[367] " Y5 0.035 0.001 0.000 0.033 0.037 *"
[368] " Y6 0.075 0.002 0.000 0.072 0.079 *"
[369] ""
Code
comp <- mplus_mlts_compare(
mplus = mplus, mlts = fit,
fe_rows = c(57:65),
re_rows = c(72:80),
mm.ints = 66:71,
mm.sigma = c(81:86,9:14),
mm.loads = c(15:20,1:6))
comp_tab(comp)Type | Param | True | mlts | Mplus | ||||
|---|---|---|---|---|---|---|---|---|
Est | 95% CI | CI Width | Est | 95% CI | CI Width | |||
Fixed effect | etaB_1 | 1.00 | 1.14 | [0.97, 1.31] | 0.34 | 1.13 | [0.95, 1.32] | 0.37 |
etaB_2 | 0.50 | 0.39 | [0.21, 0.56] | 0.35 | 0.39 | [0.21, 0.58] | 0.37 | |
phi(1)_11 | 0.20 | 0.18 | [0.15, 0.22] | 0.07 | 0.18 | [0.14, 0.22] | 0.08 | |
phi(1)_12 | 0.00 | 0.04 | [0.00, 0.07] | 0.07 | 0.04 | [0.00, 0.07] | 0.07 | |
phi(1)_21 | -0.15 | -0.16 | [-0.20, -0.13] | 0.07 | -0.16 | [-0.20, -0.12] | 0.08 | |
phi(1)_22 | 0.30 | 0.30 | [0.26, 0.34] | 0.07 | 0.30 | [0.26, 0.34] | 0.08 | |
ln.sigma2_1 | -0.30 | -0.31 | [-0.37, -0.25] | 0.12 | -0.32 | [-0.39, -0.25] | 0.14 | |
ln.sigma2_2 | -0.30 | -0.33 | [-0.40, -0.26] | 0.14 | -0.33 | [-0.41, -0.25] | 0.15 | |
ln.sigma_12 | -0.30 | -0.25 | [-0.31, -0.19] | 0.12 | -0.25 | [-0.32, -0.18] | 0.14 | |
Random effect SD | sigma_etaB_1 | 0.80 | 0.88 | [0.76, 1.01] | 0.25 | 0.95 | [0.81, 1.11] | 0.30 |
sigma_etaB_2 | 0.80 | 0.87 | [0.75, 1.01] | 0.26 | 0.94 | [0.80, 1.10] | 0.30 | |
sigma_phi(1)_11 | 0.15 | 0.14 | [0.10, 0.17] | 0.06 | 0.16 | [0.12, 0.20] | 0.07 | |
sigma_phi(1)_12 | 0.15 | 0.12 | [0.10, 0.16] | 0.06 | 0.14 | [0.11, 0.18] | 0.07 | |
sigma_phi(1)_21 | 0.15 | 0.15 | [0.12, 0.18] | 0.06 | 0.17 | [0.14, 0.21] | 0.07 | |
sigma_phi(1)_22 | 0.15 | 0.15 | [0.12, 0.19] | 0.06 | 0.17 | [0.14, 0.21] | 0.07 | |
sigma_ln.sigma2_1 | 0.25 | 0.20 | [0.13, 0.27] | 0.13 | 0.26 | [0.19, 0.33] | 0.14 | |
sigma_ln.sigma2_2 | 0.25 | 0.26 | [0.20, 0.34] | 0.13 | 0.31 | [0.24, 0.38] | 0.15 | |
sigma_ln.sigma_12 | 0.25 | 0.22 | [0.16, 0.29] | 0.13 | 0.27 | [0.20, 0.34] | 0.14 | |
RE correlation | r_etaB_1.etaB_2 | -0.20 | -0.09 | [-0.29, 0.10] | 0.39 | -0.09 | [-0.31, 0.13] | 0.44 |
r_etaB_1.phi(1)_11 | 0.20 | 0.28 | [0.05, 0.50] | 0.45 | 0.28 | [0.02, 0.52] | 0.50 | |
r_etaB_1.phi(1)_12 | 0.10 | 0.03 | [-0.22, 0.28] | 0.50 | 0.03 | [-0.26, 0.30] | 0.55 | |
r_etaB_1.phi(1)_21 | 0.15 | 0.15 | [-0.08, 0.38] | 0.45 | 0.16 | [-0.10, 0.40] | 0.50 | |
r_etaB_1.phi(1)_22 | 0.10 | 0.08 | [-0.14, 0.31] | 0.45 | 0.07 | [-0.19, 0.32] | 0.52 | |
r_etaB_1.ln.sigma2_1 | 0.20 | 0.45 | [0.18, 0.70] | 0.52 | 0.43 | [0.16, 0.67] | 0.51 | |
r_etaB_1.ln.sigma2_2 | 0.05 | 0.01 | [-0.23, 0.26] | 0.50 | -0.02 | [-0.29, 0.26] | 0.55 | |
r_etaB_1.ln.sigma_12 | 0.00 | -0.12 | [-0.37, 0.14] | 0.51 | -0.14 | [-0.41, 0.14] | 0.55 | |
r_etaB_2.phi(1)_11 | 0.20 | 0.24 | [-0.01, 0.47] | 0.47 | 0.25 | [-0.02, 0.49] | 0.51 | |
r_etaB_2.phi(1)_12 | -0.20 | -0.34 | [-0.56, -0.10] | 0.46 | -0.38 | [-0.60, -0.12] | 0.48 | |
r_etaB_2.phi(1)_21 | 0.05 | 0.24 | [ 0.00, 0.46] | 0.46 | 0.26 | [-0.01, 0.49] | 0.49 | |
r_etaB_2.phi(1)_22 | 0.10 | 0.13 | [-0.11, 0.37] | 0.48 | 0.14 | [-0.12, 0.39] | 0.51 | |
r_etaB_2.ln.sigma2_1 | -0.15 | 0.00 | [-0.29, 0.29] | 0.58 | -0.01 | [-0.32, 0.30] | 0.62 | |
r_etaB_2.ln.sigma2_2 | 0.15 | 0.22 | [-0.03, 0.47] | 0.50 | 0.23 | [-0.04, 0.48] | 0.52 | |
r_etaB_2.ln.sigma_12 | 0.00 | 0.00 | [-0.26, 0.27] | 0.53 | 0.01 | [-0.27, 0.29] | 0.56 | |
r_phi(1)_11.phi(1)_12 | -0.15 | 0.01 | [-0.29, 0.32] | 0.62 | -0.07 | [-0.37, 0.26] | 0.63 | |
r_phi(1)_11.phi(1)_21 | 0.05 | 0.19 | [-0.10, 0.45] | 0.55 | 0.27 | [-0.03, 0.52] | 0.55 | |
r_phi(1)_11.phi(1)_22 | -0.05 | -0.12 | [-0.39, 0.16] | 0.56 | -0.15 | [-0.44, 0.15] | 0.60 | |
r_phi(1)_11.ln.sigma2_1 | -0.15 | -0.05 | [-0.38, 0.28] | 0.66 | -0.01 | [-0.36, 0.34] | 0.71 | |
r_phi(1)_11.ln.sigma2_2 | -0.10 | -0.36 | [-0.63, -0.06] | 0.57 | -0.38 | [-0.64, -0.07] | 0.58 | |
r_phi(1)_11.ln.sigma_12 | 0.00 | -0.16 | [-0.47, 0.17] | 0.64 | -0.18 | [-0.50, 0.16] | 0.67 | |
r_phi(1)_12.phi(1)_21 | 0.20 | 0.18 | [-0.11, 0.44] | 0.56 | 0.12 | [-0.18, 0.42] | 0.60 | |
r_phi(1)_12.phi(1)_22 | -0.20 | -0.18 | [-0.46, 0.10] | 0.56 | -0.10 | [-0.41, 0.20] | 0.61 | |
r_phi(1)_12.ln.sigma2_1 | -0.20 | -0.30 | [-0.62, 0.05] | 0.66 | -0.29 | [-0.61, 0.08] | 0.69 | |
r_phi(1)_12.ln.sigma2_2 | -0.05 | -0.23 | [-0.53, 0.08] | 0.62 | -0.19 | [-0.50, 0.14] | 0.64 | |
r_phi(1)_12.ln.sigma_12 | 0.10 | 0.03 | [-0.33, 0.35] | 0.68 | 0.04 | [-0.31, 0.38] | 0.68 | |
r_phi(1)_21.phi(1)_22 | 0.20 | 0.33 | [ 0.05, 0.58] | 0.53 | 0.28 | [-0.03, 0.56] | 0.59 | |
r_phi(1)_21.ln.sigma2_1 | 0.00 | 0.07 | [-0.26, 0.39] | 0.66 | 0.10 | [-0.25, 0.43] | 0.67 | |
r_phi(1)_21.ln.sigma2_2 | -0.10 | -0.32 | [-0.58, -0.02] | 0.56 | -0.33 | [-0.60, -0.03] | 0.57 | |
r_phi(1)_21.ln.sigma_12 | -0.05 | -0.05 | [-0.36, 0.26] | 0.61 | -0.08 | [-0.41, 0.26] | 0.67 | |
r_phi(1)_22.ln.sigma2_1 | -0.15 | -0.07 | [-0.37, 0.27] | 0.64 | -0.13 | [-0.46, 0.22] | 0.68 | |
r_phi(1)_22.ln.sigma2_2 | 0.05 | 0.17 | [-0.13, 0.45] | 0.57 | 0.20 | [-0.11, 0.49] | 0.60 | |
r_phi(1)_22.ln.sigma_12 | 0.10 | 0.27 | [-0.04, 0.57] | 0.61 | 0.30 | [-0.04, 0.60] | 0.63 | |
r_ln.sigma2_1.ln.sigma2_2 | 0.15 | 0.10 | [-0.26, 0.46] | 0.72 | 0.02 | [-0.35, 0.38] | 0.73 | |
r_ln.sigma2_1.ln.sigma_12 | -0.05 | -0.02 | [-0.39, 0.38] | 0.77 | -0.12 | [-0.47, 0.25] | 0.72 | |
r_ln.sigma2_2.ln.sigma_12 | 0.15 | 0.32 | [-0.03, 0.66] | 0.68 | 0.30 | [-0.06, 0.62] | 0.68 | |
Item intercepts | alpha_1.1 | 0.00 | 0.00 | [0.00, 0.00] | 0.00 | 0.00 | [0.00, 0.00] | 0.00 |
alpha_1.2 | 1.00 | 0.96 | [0.90, 1.03] | 0.13 | 0.96 | [0.90, 1.03] | 0.13 | |
alpha_1.3 | 1.50 | 1.49 | [1.44, 1.55] | 0.11 | 1.49 | [1.44, 1.55] | 0.11 | |
alpha_2.1 | 0.00 | 0.00 | [0.00, 0.00] | 0.00 | 0.00 | [0.00, 0.00] | 0.00 | |
alpha_2.2 | 1.50 | 1.50 | [1.47, 1.54] | 0.07 | 1.50 | [1.47, 1.54] | 0.07 | |
alpha_2.3 | 2.00 | 1.96 | [1.92, 2.01] | 0.09 | 1.96 | [1.91, 2.01] | 0.09 | |
Loading | lambdaB_1.1 | 1.00 | 1.00 | [1.00, 1.00] | 0.00 | 1.00 | [1.00, 1.00] | 0.00 |
lambdaB_1.2 | 0.75 | 0.78 | [0.73, 0.82] | 0.09 | 0.78 | [0.73, 0.82] | 0.09 | |
lambdaB_1.3 | 0.85 | 0.87 | [0.83, 0.91] | 0.08 | 0.87 | [0.83, 0.91] | 0.08 | |
lambdaB_2.1 | 1.00 | 1.00 | [1.00, 1.00] | 0.00 | 1.00 | [1.00, 1.00] | 0.00 | |
lambdaB_2.2 | 0.80 | 0.78 | [0.75, 0.82] | 0.08 | 0.78 | [0.75, 0.82] | 0.08 | |
lambdaB_2.3 | 0.85 | 0.84 | [0.79, 0.89] | 0.10 | 0.84 | [0.79, 0.89] | 0.10 | |
Measurement Error SD | sigmaB_1.1 | 0.00 | 0.00 | [0.00, 0.00] | 0.00 | 0.03 | [0.03, 0.03] | 0.00 |
sigmaB_1.2 | 0.20 | 0.18 | [0.16, 0.21] | 0.05 | 0.18 | [0.16, 0.21] | 0.05 | |
sigmaB_1.3 | 0.15 | 0.16 | [0.14, 0.18] | 0.05 | 0.16 | [0.13, 0.18] | 0.05 | |
sigmaB_2.1 | 0.00 | 0.00 | [0.00, 0.00] | 0.00 | 0.03 | [0.03, 0.03] | 0.00 | |
sigmaB_2.2 | 0.15 | 0.16 | [0.14, 0.19] | 0.05 | 0.16 | [0.14, 0.19] | 0.05 | |
sigmaB_2.3 | 0.20 | 0.20 | [0.18, 0.24] | 0.06 | 0.20 | [0.18, 0.24] | 0.06 | |
Loading | lambdaW_1.1 | 1.00 | 1.00 | [1.00, 1.00] | 0.00 | 1.00 | [1.00, 1.00] | 0.00 |
lambdaW_1.2 | 0.75 | 0.75 | [0.75, 0.76] | 0.01 | 0.75 | [0.75, 0.76] | 0.01 | |
lambdaW_1.3 | 0.75 | 0.75 | [0.75, 0.76] | 0.01 | 0.75 | [0.75, 0.76] | 0.01 | |
lambdaW_2.1 | 1.00 | 1.00 | [1.00, 1.00] | 0.00 | 1.00 | [1.00, 1.00] | 0.00 | |
lambdaW_2.2 | 0.80 | 0.80 | [0.80, 0.80] | 0.01 | 0.80 | [0.80, 0.80] | 0.01 | |
lambdaW_2.3 | 0.80 | 0.80 | [0.80, 0.81] | 0.01 | 0.80 | [0.80, 0.81] | 0.01 | |
Measurement Error SD | sigmaW_1.1 | 0.30 | 0.30 | [0.30, 0.31] | 0.01 | 0.30 | [0.30, 0.31] | 0.01 |
sigmaW_1.2 | 0.20 | 0.20 | [0.19, 0.20] | 0.01 | 0.20 | [0.19, 0.20] | 0.01 | |
sigmaW_1.3 | 0.25 | 0.25 | [0.25, 0.26] | 0.01 | 0.25 | [0.25, 0.26] | 0.01 | |
sigmaW_2.1 | 0.25 | 0.25 | [0.25, 0.26] | 0.01 | 0.25 | [0.25, 0.26] | 0.01 | |
sigmaW_2.2 | 0.20 | 0.20 | [0.19, 0.20] | 0.01 | 0.20 | [0.19, 0.20] | 0.01 | |
sigmaW_2.3 | 0.30 | 0.30 | [0.29, 0.30] | 0.01 | 0.30 | [0.29, 0.30] | 0.01 | |
Code
P <- mplus_mlts_comp_plot(comp)
P[[1]]
P[[2]]
P[[3]]
P[[4]]
P[[5]]
P[[6]]Parameters with absolute posterior mean difference larger than 0.01:
Code
mplus_mlts_diff(comp, tol = 0.01)Param | True | mlts | Mplus | Diff |
|---|---|---|---|---|
Est | Est | |||
r_ln.sigma2_1.ln.sigma_12 | -0.05 | -0.02 | -0.12 | 0.10 |
r_phi(1)_11.phi(1)_21 | 0.05 | 0.19 | 0.27 | -0.08 |
r_phi(1)_12.phi(1)_22 | -0.20 | -0.18 | -0.10 | -0.08 |
r_phi(1)_11.phi(1)_12 | -0.15 | 0.01 | -0.07 | 0.08 |
sigma_etaB_1 | 0.80 | 0.88 | 0.95 | -0.07 |
r_ln.sigma2_1.ln.sigma2_2 | 0.15 | 0.10 | 0.02 | 0.07 |
sigma_etaB_2 | 0.80 | 0.87 | 0.94 | -0.07 |
sigma_ln.sigma2_1 | 0.25 | 0.20 | 0.26 | -0.06 |
r_phi(1)_22.ln.sigma2_1 | -0.15 | -0.07 | -0.13 | 0.06 |
r_phi(1)_12.phi(1)_21 | 0.20 | 0.18 | 0.12 | 0.05 |
r_phi(1)_21.phi(1)_22 | 0.20 | 0.33 | 0.28 | 0.05 |
sigma_ln.sigma_12 | 0.25 | 0.22 | 0.27 | -0.04 |
sigma_ln.sigma2_2 | 0.25 | 0.26 | 0.31 | -0.04 |
r_phi(1)_11.ln.sigma2_1 | -0.15 | -0.05 | -0.01 | -0.04 |
r_phi(1)_12.ln.sigma2_2 | -0.05 | -0.23 | -0.19 | -0.04 |
r_phi(1)_22.ln.sigma2_2 | 0.05 | 0.17 | 0.20 | -0.04 |
r_etaB_2.phi(1)_12 | -0.20 | -0.34 | -0.38 | 0.03 |
r_phi(1)_22.ln.sigma_12 | 0.10 | 0.27 | 0.30 | -0.03 |
r_phi(1)_21.ln.sigma_12 | -0.05 | -0.05 | -0.08 | 0.03 |
r_phi(1)_21.ln.sigma2_1 | 0.00 | 0.07 | 0.10 | -0.03 |
r_phi(1)_11.phi(1)_22 | -0.05 | -0.12 | -0.15 | 0.03 |
sigmaB_1.1 | 0.00 | 0.00 | 0.03 | -0.03 |
sigmaB_2.1 | 0.00 | 0.00 | 0.03 | -0.03 |
r_etaB_1.ln.sigma2_2 | 0.05 | 0.01 | -0.02 | 0.03 |
r_phi(1)_11.ln.sigma_12 | 0.00 | -0.16 | -0.18 | 0.02 |
sigma_phi(1)_11 | 0.15 | 0.14 | 0.16 | -0.02 |
sigma_phi(1)_21 | 0.15 | 0.15 | 0.17 | -0.02 |
r_phi(1)_11.ln.sigma2_2 | -0.10 | -0.36 | -0.38 | 0.02 |
sigma_phi(1)_12 | 0.15 | 0.12 | 0.14 | -0.02 |
r_ln.sigma2_2.ln.sigma_12 | 0.15 | 0.32 | 0.30 | 0.02 |
sigma_phi(1)_22 | 0.15 | 0.15 | 0.17 | -0.02 |
r_etaB_1.ln.sigma2_1 | 0.20 | 0.45 | 0.43 | 0.02 |
r_etaB_1.ln.sigma_12 | 0.00 | -0.12 | -0.14 | 0.02 |
r_etaB_2.ln.sigma2_1 | -0.15 | 0.00 | -0.01 | 0.02 |
r_etaB_2.phi(1)_21 | 0.05 | 0.24 | 0.26 | -0.02 |
r_phi(1)_21.ln.sigma2_2 | -0.10 | -0.32 | -0.33 | 0.02 |
r_etaB_1.phi(1)_22 | 0.10 | 0.08 | 0.07 | 0.01 |
r_etaB_2.ln.sigma2_2 | 0.15 | 0.22 | 0.23 | -0.01 |
r_etaB_2.phi(1)_11 | 0.20 | 0.24 | 0.25 | -0.01 |
r_phi(1)_12.ln.sigma_12 | 0.10 | 0.03 | 0.04 | -0.01 |
ln.sigma2_1 | -0.30 | -0.31 | -0.32 | 0.01 |
r_etaB_1.phi(1)_21 | 0.15 | 0.15 | 0.16 | -0.01 |
r_phi(1)_12.ln.sigma2_1 | -0.20 | -0.30 | -0.29 | -0.01 |
Within-Level Standardized Effects
mplus$parameters$stdyx.standardized[c(9:12),c(1:4,6,7)] paramHeader param est posterior_sd lower_2.5ci upper_2.5ci
9 AR1|F1.ON F1&1 0.180 0.011 0.158 0.202
10 CL12|F1.ON F2&1 0.037 0.011 0.015 0.057
11 CL21|F2.ON F1&1 -0.155 0.010 -0.175 -0.136
12 AR2|F2.ON F2&1 0.301 0.011 0.280 0.321
mlts_standardized(object = fit, what = "within")$`Within-level standardized effects averaged over clusters`
Type Param Std.Est SD 2.5% 97.5%
1 Fixed effect phi(1)_11 0.182 0.011 0.161 0.204
2 Fixed effect phi(1)_12 0.035 0.011 0.014 0.057
3 Fixed effect phi(1)_21 -0.157 0.011 -0.178 -0.135
4 Fixed effect phi(1)_22 0.301 0.011 0.280 0.322