Meta-Regression
Ivan Jacob Agaloos Pesigan
2026-01-19
Source:vignettes/covariate-1000.Rmd
covariate-1000.RmdDynamics Description
The Stable Persistence with Baseline-Moderated Autoregression process represents a bivariate dynamic system in which two latent psychological constructs (e.g., positive and negative affect) exhibit within-construct persistence over time through autoregressive dynamics. The transition matrix is diagonal, implying that each construct evolves according to its own self-regulatory process and there are no cross-lagged (reciprocal) influences between the constructs in the systematic dynamics.
Between-person heterogeneity in persistence is captured via a time-invariant baseline covariate with one value per individual. The individual-specific transition matrix is modeled as so that individuals with follows , whereas individuals with follow . Under the current specification, increases the diagonal autoregressive parameters, implying that the group exhibits greater persistenceβdeviations from an individualβs equilibrium decay more slowlyβwhile remaining dynamically stable.
Between-person heterogeneity in baseline levels is also captured via the same time-invariant covariate through the person-specific set-point vector so that individuals with follow , whereas individuals with follow .
The process noise covariance allows for small disturbances that may be correlated across constructs, permitting coordinated innovations even though the lagged dynamics are decoupled. Measurement errors are assumed to be minimal and symmetric across indicators.
Model
The measurement model is given by where , , and are random variables and , and are model parameters. represents a vector of observed random variables, a vector of latent random variables, and a vector of random measurement errors, at time and individual . denotes a matrix of factor loadings, and the covariance matrix of that is invariant across individuals. In this model, is an identity matrix and is a symmetric matrix.
The dynamic structure is given by where , , and are random variables, and , and are model parameters. Here, is a vector of latent variables at time and individual , represents a vector of latent variables at time and individual , and represents a vector of dynamic noise at time and individual . is a matrix of autoregression and cross regression coefficients for individual , and the covariance matrix of that is invariant across all individuals. In this model, is a symmetric matrix.
Data Generation
Notation
Let be the number of time points and be the number of individuals. We simulate a total of time points per individual, discarding the first as burn-in. The analysis uses the final measurement occasions.
Let the factor loadings matrix be given by
Let the measurement error covariance matrix be given by
Let the initial condition be given by and are functions of and .
Let the intercept vector when be Let the intercept vector when be Let the covariance matrix be
Let the transition matrix when be Let the transition matrix when be Let the covariance matrix be and covariance matrix
The SimAlphaN and SimBetaNCovariate
functions from the simStateSpace package generate random
intercept vectors and transition matrices from the multivariate normal
distribution. Note that the SimBetaNCovariate function
generates transition matrices that are weakly stationary with an option
to set lower and upper bounds. The person-specific set-point vector
was derived from the generated
and
.
Let the dynamic process noise be given by
R Function Arguments
n
#> [1] 1000
time
#> [1] 11000
burnin
#> [1] 10000
# first mu0 in the list of length n
mu0[[1]]
#> [1] 0.7520376 -0.5127468
# first sigma0 in the list of length n
sigma0[[1]]
#> [,1] [,2]
#> [1,] 0.2787159 -0.1023574
#> [2,] -0.1023574 0.2538853
# first sigma0_l in the list of length n
sigma0_l[[1]] # sigma0_l <- t(chol(sigma0))
#> [,1] [,2]
#> [1,] 0.5279355 0.0000000
#> [2,] -0.1938823 0.4650752
# first alpha in the list of length n
alpha[[1]]
#> [1] 0.3319244 -0.1910529
# first beta in the list of length n
beta[[1]]
#> [,1] [,2]
#> [1,] 0.47646139 -0.1205201
#> [2,] -0.08920883 0.4965522
# first psi in the list of length n
psi[[1]]
#> [,1] [,2]
#> [1,] 0.20 -0.05
#> [2,] -0.05 0.18
psi_l[[1]] # psi_l <- t(chol(psi))
#> [,1] [,2]
#> [1,] 0.4472136 0.0000000
#> [2,] -0.1118034 0.4092676
nu
#> [[1]]
#> [1] 0 0
lambda
#> [[1]]
#> [,1] [,2]
#> [1,] 1 0
#> [2,] 0 1
theta
#> [[1]]
#> [,1] [,2]
#> [1,] 0.5 0.0
#> [2,] 0.0 0.5
theta_l # theta_l <- t(chol(theta))
#> [[1]]
#> [,1] [,2]
#> [1,] 0.7071068 0.0000000
#> [2,] 0.0000000 0.7071068
# first mu_eta (set-point) in the list of length n
mu_eta[[1]]
#> [1] 0.7520376 -0.5127468Visualizing the Dynamics Without Process Noise and Measurement Error (n = 5 with Different Initial Condition)
Using the SimSSMIVary Function from the
simStateSpace Package to Simulate Data
library(simStateSpace)
sim <- SimSSMIVary(
n = n,
time = time,
mu0 = mu0,
sigma0_l = sigma0_l,
alpha = alpha,
beta = beta,
psi_l = psi_l,
nu = nu,
lambda = lambda,
theta_l = theta_l
)
data <- as.data.frame(sim, burnin = burnin)
head(data)
#> id time y1 y2
#> 1 1 0 -0.2039857 -0.5271213
#> 2 1 1 2.3635709 -0.8225477
#> 3 1 2 1.0336287 -1.3055546
#> 4 1 3 0.3748494 -0.1758500
#> 5 1 4 -0.6424827 -1.8117723
#> 6 1 5 1.0244405 -0.1976583
plot(sim, burnin = burnin)

Model Fitting
The FitDTVARMxID function fits a DT-VAR model on each
individual
.
To set up the estimation, we first provide starting
values for each parameter matrix.
Set-Point (mu_eta)
The set-point vector is initialized with starting values.
mu_eta_values <- mu_etaAutoregressive Parameters (beta)
We initialize the autoregressive coefficient matrix with the true values used in simulation.
beta_values <- betaLDLβ-parameterized covariance matrices
Covariances such as psi and theta are
estimated using the LDLβ decomposition of a positive definite covariance
matrix. The decomposition expresses a covariance matrix
as
where: -
is a strictly lower-triangular matrix of free parameters
(l_mat_strict),
-
is the identity matrix,
-
is an unconstrained vector,
-
ensures strictly positive diagonal entries.
The LDL() function extracts this decomposition from a
positive definite covariance matrix. It returns:
- d_uc: unconstrained diagonal parameters, equal to
InvSoftplus(d_vec),
- d_vec: diagonal entries, equal to
Softplus(d_uc),
- l_mat_strict: the strictly lower-triangular factor.
sigma <- matrix(
data = c(1.0, 0.5, 0.5, 1.0),
nrow = 2,
ncol = 2
)
ldl_sigma <- LDL(sigma)
d_uc <- ldl_sigma$d_uc
l_mat_strict <- ldl_sigma$l_mat_strict
I <- diag(2)
sigma_reconstructed <- (l_mat_strict + I) %*% diag(log1p(exp(d_uc)), 2) %*% t(l_mat_strict + I)
sigma_reconstructed
#> [,1] [,2]
#> [1,] 1.0 0.5
#> [2,] 0.5 1.0Process Noise Covariance Matrix (psi)
Starting values for the process noise covariance matrix are given below, with corresponding LDLβ parameters.
psi_values <- psi[[1]]
ldl_psi_values <- LDL(psi_values)
psi_d_values <- ldl_psi_values$d_uc
psi_l_values <- ldl_psi_values$l_mat_strict
psi_d_values
#> [1] -1.507772 -1.701853
psi_l_values
#> [,1] [,2]
#> [1,] 0.00 0
#> [2,] -0.25 0Measurement Error Covariance Matrix (theta)
Starting values for the measurement error covariance matrix are given below, with corresponding LDLβ parameters.
theta_values <- theta[[1]]
ldl_theta_values <- LDL(theta_values)
theta_d_values <- ldl_theta_values$d_uc
theta_l_values <- ldl_theta_values$l_mat_strict
theta_d_values
#> [1] -0.4327521 -0.4327521
theta_l_values
#> [,1] [,2]
#> [1,] 0 0
#> [2,] 0 0Initial mean vector (mu_0) and covariance matrix
(sigma_0)
The initial mean vector
and covariance matrix
are fixed using mu0 and sigma0.
mu0_values <- mu0
FitDTVARMxID
fit <- FitDTVARMxID(
data = data,
observed = c("y1", "y2"),
id = "id",
center = TRUE,
mu_eta_values = mu_eta_values,
beta_values = beta_values,
psi_d_values = psi_d_values,
psi_l_values = psi_l_values,
theta_d_values = theta_d_values,
mu0_values = mu0_values,
sigma0_d_values = sigma0_d_values,
sigma0_l_values = sigma0_l_values,
ncores = parallel::detectCores()
)Parameter estimates
head(summary(fit))
#> beta_1_1 beta_2_1 beta_1_2 beta_2_2
#> FitDTVARMxID_DTVAR_ID1.Rds 0.7356647 -0.03709508 0.124911294 0.6075660
#> FitDTVARMxID_DTVAR_ID2.Rds 0.3932550 0.33128856 0.070209848 0.6452306
#> FitDTVARMxID_DTVAR_ID3.Rds 0.3667931 0.17275648 0.005867861 0.6412371
#> FitDTVARMxID_DTVAR_ID4.Rds 0.4814453 -0.20665773 -0.083737394 0.1282792
#> FitDTVARMxID_DTVAR_ID5.Rds 0.3894912 -0.09250685 0.029823476 0.5788790
#> FitDTVARMxID_DTVAR_ID6.Rds 0.1466637 -0.04662990 0.044473537 0.3646829
#> mu_eta_1_1 mu_eta_2_1 psi_l_2_1 psi_d_1_1
#> FitDTVARMxID_DTVAR_ID1.Rds 0.7429922 -0.5422434386 -0.64137358 -2.09263860
#> FitDTVARMxID_DTVAR_ID2.Rds 2.1089697 -0.9809131058 -0.37478408 -1.74439266
#> FitDTVARMxID_DTVAR_ID3.Rds 0.9790736 -1.7645485016 -0.26088418 -1.21125563
#> FitDTVARMxID_DTVAR_ID4.Rds 1.5471235 -0.7583743612 -0.05025920 -1.63597326
#> FitDTVARMxID_DTVAR_ID5.Rds 0.8140559 -0.0001548687 -0.11296257 -0.87220954
#> FitDTVARMxID_DTVAR_ID6.Rds 0.6719574 -1.2148346783 -0.09648513 0.02601587
#> psi_d_2_1 theta_d_1_1 theta_d_2_1
#> FitDTVARMxID_DTVAR_ID1.Rds -2.44661974 -0.3062973 -0.2501242
#> FitDTVARMxID_DTVAR_ID2.Rds -2.01994760 -0.2184480 -0.3630670
#> FitDTVARMxID_DTVAR_ID3.Rds -1.83009313 -0.7312709 -0.5093707
#> FitDTVARMxID_DTVAR_ID4.Rds 0.08626565 -0.3614859 -14.3344963
#> FitDTVARMxID_DTVAR_ID5.Rds -1.77703664 -0.7189124 -0.6065102
#> FitDTVARMxID_DTVAR_ID6.Rds -0.80564615 -17.1757445 -0.8495140Proportion of converged cases
converged(
fit,
theta_tol = 0.01,
prop = TRUE
)
#> [1] 0.904Fixed-Effect Meta-Analysis of Measurement Error
When fitting DT-VAR models per person, separating process noise () from measurement error () can be unstable for some individuals. To stabilize inference, we first pool the person-level estimates from only the converged fits using a fixed-effect meta-analysis. This yields a high-precision estimate of the common measurement-error covariance that we will then hold fixed in a second pass of model fitting.
What the code does: - Selects individuals that converged and whose
diagonals exceed a small threshold (theta_tol), filtering
out near-zero or ill-conditioned solutions. - Extracts each personβs
LDLβ diagonal parameters for
and their sampling covariance matrices. - Computes the
inverse-variance-weighted pooled estimate (fixed effect), returning it
on the same LDLβ parameterization used by
FitDTVARMxID().
library(metaVAR)
fixed_theta <- MetaVARMx(
fit,
random = FALSE, # TRUE by default
effects = FALSE, # TRUE by default
cov_meas = TRUE, # FALSE by default
theta_tol = 0.01,
ncores = parallel::detectCores()
)You can read summary(fixed_theta) as providing the
pooled (fixed) measurement-error scale that is common across persons. If
individual instruments truly share the same reliability structure,
fixing
to this pooled value improves stability and often reduces bias in the
dynamic parameters.
Note: Fixed-effect pooling assumes a common across individuals.
coef(fixed_theta)
#> alpha_1_1 alpha_2_1
#> -0.3799274 -0.3843772
summary(fixed_theta)
#> [1] 0
#> Call:
#> MetaVARMx(object = fit, random = FALSE, effects = FALSE, cov_meas = TRUE,
#> theta_tol = 0.01, ncores = parallel::detectCores())
#>
#> CI type = "normal"
#> est se z p 2.5% 97.5%
#> alpha[1,1] -0.3799 0.0045 -84.0851 0 -0.3888 -0.3711
#> alpha[2,1] -0.3844 0.0043 -88.6964 0 -0.3929 -0.3759
theta_d_values <- coef(fixed_theta)Refit the model with fixed measurement error covariance matrix
We refit the individual models using the pooled as a fixed measurement-error covariance matrix.
fit <- FitDTVARMxID(
data = data,
observed = c("y1", "y2"),
id = "id",
center = TRUE,
mu_eta_values = mu_eta_values,
beta_values = beta_values,
psi_d_values = psi_d_values,
psi_l_values = psi_l_values,
theta_fixed = TRUE,
theta_d_values = theta_d_values,
mu0_values = mu0_values,
sigma0_d_values = sigma0_d_values,
sigma0_l_values = sigma0_l_values,
ncores = parallel::detectCores()
)With fixed, the re-estimation focuses on the dynamic structure (, , ). In practice, this often increases the proportion of converged fits and yields more stable cross-lag estimates.
Proportion of converged cases
converged(
fit,
prop = TRUE
)
#> [1] 1Mixed-Effects Meta-Analysis of Person-Specific Dynamics and Means
Having stabilized , we synthesize the person-specific estimates to recover population-level effects, between-person variability, and systematic covariate-related differences. We fit a mixed-effects meta-analytic model in which each individualβs estimate is weighted by its within-person sampling uncertainty, random effects capture residual heterogeneity across individuals, and fixed effects quantify the association between covariate and the person-specific dynamic parameters.
random <- MetaVARMx(
fit,
x = x,
effects = TRUE,
set_point = TRUE,
robust_v = FALSE,
robust = TRUE,
ncores = parallel::detectCores()
)
summary(random)
#> [1] 0
#> Call:
#> MetaVARMx(object = fit, x = x, effects = TRUE, set_point = TRUE,
#> robust_v = FALSE, robust = TRUE, ncores = parallel::detectCores())
#>
#> CI type = "normal"
#> est se z p 2.5% 97.5%
#> alpha[1,1] 1.0304 0.1204 8.5606 0.0000 0.7945 1.2663
#> alpha[2,1] -1.0166 0.1187 -8.5622 0.0000 -1.2494 -0.7839
#> alpha[3,1] 0.5513 0.0061 89.8952 0.0000 0.5392 0.5633
#> alpha[4,1] 0.0205 0.0059 3.4556 0.0005 0.0089 0.0321
#> alpha[5,1] 0.0208 0.0055 3.7535 0.0002 0.0099 0.0316
#> alpha[6,1] 0.5552 0.0058 95.1481 0.0000 0.5438 0.5666
#> gamma[1,1] 2.2504 0.1703 13.2175 0.0000 1.9167 2.5841
#> gamma[2,1] -2.4506 0.1680 -14.5914 0.0000 -2.7798 -2.1215
#> gamma[3,1] 0.1982 0.0081 24.5129 0.0000 0.1824 0.2141
#> gamma[4,1] -0.0394 0.0078 -5.0232 0.0000 -0.0548 -0.0240
#> gamma[5,1] -0.0140 0.0071 -1.9705 0.0488 -0.0279 -0.0001
#> gamma[6,1] 0.2052 0.0075 27.2652 0.0000 0.1904 0.2199
#> tau_sqr[1,1] 7.2471 0.3255 22.2635 0.0000 6.6091 7.8851
#> tau_sqr[2,1] 2.1395 0.2368 9.0359 0.0000 1.6755 2.6036
#> tau_sqr[3,1] 0.1274 0.0106 11.9771 0.0000 0.1066 0.1483
#> tau_sqr[4,1] 0.0747 0.0098 7.5996 0.0000 0.0554 0.0939
#> tau_sqr[5,1] -0.1148 0.0092 -12.4263 0.0000 -0.1329 -0.0967
#> tau_sqr[6,1] -0.0644 0.0094 -6.8561 0.0000 -0.0828 -0.0460
#> tau_sqr[2,2] 7.0475 0.3162 22.2902 0.0000 6.4278 7.6671
#> tau_sqr[3,2] 0.0632 0.0101 6.2661 0.0000 0.0434 0.0830
#> tau_sqr[4,2] 0.1344 0.0105 12.8179 0.0000 0.1138 0.1549
#> tau_sqr[5,2] -0.0516 0.0083 -6.2242 0.0000 -0.0679 -0.0354
#> tau_sqr[6,2] -0.1100 0.0095 -11.6067 0.0000 -0.1286 -0.0914
#> tau_sqr[3,3] 0.0123 0.0007 16.9720 0.0000 0.0109 0.0137
#> tau_sqr[4,3] 0.0061 0.0005 11.4181 0.0000 0.0051 0.0072
#> tau_sqr[5,3] -0.0016 0.0004 -3.6272 0.0003 -0.0024 -0.0007
#> tau_sqr[6,3] -0.0007 0.0005 -1.5136 0.1301 -0.0016 0.0002
#> tau_sqr[4,4] 0.0116 0.0007 16.8122 0.0000 0.0102 0.0129
#> tau_sqr[5,4] -0.0026 0.0004 -6.3703 0.0000 -0.0034 -0.0018
#> tau_sqr[6,4] -0.0017 0.0004 -3.8719 0.0001 -0.0026 -0.0009
#> tau_sqr[5,5] 0.0083 0.0005 15.6845 0.0000 0.0073 0.0093
#> tau_sqr[6,5] 0.0032 0.0004 7.7108 0.0000 0.0024 0.0040
#> tau_sqr[6,6] 0.0099 0.0006 16.1427 0.0000 0.0087 0.0111
#> i_sqr[1,1] 0.9998 0.0000 97238.7925 0.0000 0.9998 0.9998
#> i_sqr[2,1] 0.9998 0.0000 105455.4882 0.0000 0.9998 0.9998
#> i_sqr[3,1] 0.9131 0.0047 195.3269 0.0000 0.9039 0.9222
#> i_sqr[4,1] 0.9279 0.0038 241.1150 0.0000 0.9203 0.9354
#> i_sqr[5,1] 0.8770 0.0068 129.2992 0.0000 0.8637 0.8903
#> i_sqr[6,1] 0.9091 0.0050 180.8974 0.0000 0.8993 0.9190Normal Theory Confidence Intervals
confint(random, level = 0.95, lb = FALSE)
#> 2.5 % 97.5 %
#> alpha[1,1] 0.794500688 1.266335e+00
#> alpha[2,1] -1.249368686 -7.839276e-01
#> alpha[3,1] 0.539246802 5.632851e-01
#> alpha[4,1] 0.008869990 3.211681e-02
#> alpha[5,1] 0.009920418 3.160222e-02
#> alpha[6,1] 0.543766973 5.666404e-01
#> gamma[1,1] 1.916714537 2.584123e+00
#> gamma[2,1] -2.779814641 -2.121460e+00
#> gamma[3,1] 0.182372901 2.140712e-01
#> gamma[4,1] -0.054756177 -2.401921e-02
#> gamma[5,1] -0.027859052 -7.492511e-05
#> gamma[6,1] 0.190432550 2.199316e-01
#> tau_sqr[1,1] 6.609126166 7.885126e+00
#> tau_sqr[2,1] 1.675456057 2.603622e+00
#> tau_sqr[3,1] 0.106557338 1.482555e-01
#> tau_sqr[4,1] 0.055412703 9.392802e-02
#> tau_sqr[5,1] -0.132914126 -9.669806e-02
#> tau_sqr[6,1] -0.082815826 -4.599312e-02
#> tau_sqr[2,2] 6.427778640 7.667133e+00
#> tau_sqr[3,2] 0.043427044 8.295965e-02
#> tau_sqr[4,2] 0.113819147 1.549103e-01
#> tau_sqr[5,2] -0.067868279 -3.536159e-02
#> tau_sqr[6,2] -0.128593364 -9.143791e-02
#> tau_sqr[3,3] 0.010896543 1.374183e-02
#> tau_sqr[4,3] 0.005061211 7.158843e-03
#> tau_sqr[5,3] -0.002428657 -7.247159e-04
#> tau_sqr[6,3] -0.001611689 2.070945e-04
#> tau_sqr[4,4] 0.010243085 1.294653e-02
#> tau_sqr[5,4] -0.003412564 -1.806727e-03
#> tau_sqr[6,4] -0.002615203 -8.573679e-04
#> tau_sqr[5,5] 0.007268318 9.344249e-03
#> tau_sqr[6,5] 0.002397265 4.031314e-03
#> tau_sqr[6,6] 0.008730481 1.114348e-02
#> i_sqr[1,1] 0.999750884 9.997912e-01
#> i_sqr[2,1] 0.999770095 9.998073e-01
#> i_sqr[3,1] 0.903898157 9.222219e-01
#> i_sqr[4,1] 0.920331029 9.354159e-01
#> i_sqr[5,1] 0.863733254 8.903219e-01
#> i_sqr[6,1] 0.899277024 9.189772e-01
confint(random, level = 0.99, lb = FALSE)
#> 0.5 % 99.5 %
#> alpha[1,1] 0.720370144 1.3404655461
#> alpha[2,1] -1.322494783 -0.7108014842
#> alpha[3,1] 0.535470118 0.5670617417
#> alpha[4,1] 0.005217649 0.0357691546
#> alpha[5,1] 0.006513961 0.0350086730
#> alpha[6,1] 0.540173303 0.5702340307
#> gamma[1,1] 1.811857110 2.6889801650
#> gamma[2,1] -2.883249639 -2.0180250875
#> gamma[3,1] 0.177392743 0.2190513155
#> gamma[4,1] -0.059585304 -0.0191900815
#> gamma[5,1] -0.032224255 0.0042902776
#> gamma[6,1] 0.185797906 0.2245662926
#> tau_sqr[1,1] 6.408652077 8.0856000019
#> tau_sqr[2,1] 1.529630597 2.7494476002
#> tau_sqr[3,1] 0.100006088 0.1548067094
#> tau_sqr[4,1] 0.049361508 0.0999792125
#> tau_sqr[5,1] -0.138604082 -0.0910081089
#> tau_sqr[6,1] -0.088601092 -0.0402078565
#> tau_sqr[2,2] 6.233061927 7.8618499129
#> tau_sqr[3,2] 0.037216022 0.0891706675
#> tau_sqr[4,2] 0.107363263 0.1613661562
#> tau_sqr[5,2] -0.072975450 -0.0302544215
#> tau_sqr[6,2] -0.134430909 -0.0856003620
#> tau_sqr[3,3] 0.010449515 0.0141888617
#> tau_sqr[4,3] 0.004731650 0.0074884045
#> tau_sqr[5,3] -0.002696365 -0.0004570074
#> tau_sqr[6,3] -0.001897440 0.0004928460
#> tau_sqr[4,4] 0.009818344 0.0133712718
#> tau_sqr[5,4] -0.003664859 -0.0015544312
#> tau_sqr[6,4] -0.002891379 -0.0005811919
#> tau_sqr[5,5] 0.006942166 0.0096704015
#> tau_sqr[6,5] 0.002140537 0.0042880420
#> tau_sqr[6,6] 0.008351372 0.0115225850
#> i_sqr[1,1] 0.999744552 0.9997975191
#> i_sqr[2,1] 0.999764256 0.9998130971
#> i_sqr[3,1] 0.901019280 0.9251008237
#> i_sqr[4,1] 0.917961018 0.9377859492
#> i_sqr[5,1] 0.859555881 0.8944992324
#> i_sqr[6,1] 0.896181900 0.9220723415Robust Confidence Intervals
confint(random, level = 0.95, lb = FALSE, robust = TRUE)
#> 2.5 % 97.5 %
#> alpha[1,1] 0.953317251 1.1075184391
#> alpha[2,1] -1.093499451 -0.9397968168
#> alpha[3,1] 0.538473578 0.5640582816
#> alpha[4,1] 0.008487720 0.0324990831
#> alpha[5,1] 0.009663546 0.0318590883
#> alpha[6,1] 0.542884684 0.5675226497
#> gamma[1,1] 1.915786578 2.5850506967
#> gamma[2,1] -2.780365397 -2.1209093291
#> gamma[3,1] 0.182038875 0.2144051839
#> gamma[4,1] -0.055005919 -0.0237694669
#> gamma[5,1] -0.028223835 0.0002898577
#> gamma[6,1] 0.189992279 0.2203719191
#> tau_sqr[1,1] 5.386330684 9.1079213946
#> tau_sqr[2,1] 0.944284001 3.3347941960
#> tau_sqr[3,1] 0.100882881 0.1539299166
#> tau_sqr[4,1] 0.053787782 0.0955529388
#> tau_sqr[5,1] -0.138114052 -0.0914981389
#> tau_sqr[6,1] -0.085014507 -0.0437944418
#> tau_sqr[2,2] 5.455393298 8.6395185415
#> tau_sqr[3,2] 0.036203985 0.0901827051
#> tau_sqr[4,2] 0.104948539 0.1637808802
#> tau_sqr[5,2] -0.070748854 -0.0324810179
#> tau_sqr[6,2] -0.130694447 -0.0893368236
#> tau_sqr[3,3] 0.010886269 0.0137521081
#> tau_sqr[4,3] 0.004981457 0.0072385971
#> tau_sqr[5,3] -0.002449145 -0.0007042281
#> tau_sqr[6,3] -0.001609608 0.0002050131
#> tau_sqr[4,4] 0.010165771 0.0130238442
#> tau_sqr[5,4] -0.003439897 -0.0017793930
#> tau_sqr[6,4] -0.002583638 -0.0008889332
#> tau_sqr[5,5] 0.007330000 0.0092825673
#> tau_sqr[6,5] 0.002320616 0.0041079631
#> tau_sqr[6,6] 0.008579744 0.0112942137
#> i_sqr[1,1] 0.999712261 0.9998298097
#> i_sqr[2,1] 0.999738977 0.9998383760
#> i_sqr[3,1] 0.903829829 0.9222902751
#> i_sqr[4,1] 0.919788148 0.9359588189
#> i_sqr[5,1] 0.864421467 0.8896336463
#> i_sqr[6,1] 0.897834476 0.9204197653
confint(random, level = 0.99, lb = FALSE, robust = TRUE)
#> 0.5 % 99.5 %
#> alpha[1,1] 0.929090489 1.1317452016
#> alpha[2,1] -1.117647885 -0.9156483828
#> alpha[3,1] 0.534453930 0.5680779298
#> alpha[4,1] 0.004715262 0.0362715417
#> alpha[5,1] 0.006176373 0.0353462608
#> alpha[6,1] 0.539013779 0.5713935546
#> gamma[1,1] 1.810637564 2.6901997106
#> gamma[2,1] -2.883973454 -2.0173012719
#> gamma[3,1] 0.176953759 0.2194902995
#> gamma[4,1] -0.059913521 -0.0188618646
#> gamma[5,1] -0.032703661 0.0047696835
#> gamma[6,1] 0.185219292 0.2251449064
#> tau_sqr[1,1] 4.801626407 9.6926256719
#> tau_sqr[2,1] 0.568707629 3.7103705677
#> tau_sqr[3,1] 0.092548588 0.1622642100
#> tau_sqr[4,1] 0.047226000 0.1021147205
#> tau_sqr[5,1] -0.145437943 -0.0841742482
#> tau_sqr[6,1] -0.091490648 -0.0373183002
#> tau_sqr[2,2] 4.955130966 9.1397808739
#> tau_sqr[3,2] 0.027723313 0.0986633767
#> tau_sqr[4,2] 0.095705308 0.1730241110
#> tau_sqr[5,2] -0.076761166 -0.0264687051
#> tau_sqr[6,2] -0.137192201 -0.0828390700
#> tau_sqr[3,3] 0.010436013 0.0142023641
#> tau_sqr[4,3] 0.004626835 0.0075932195
#> tau_sqr[5,3] -0.002723291 -0.0004300819
#> tau_sqr[6,3] -0.001894705 0.0004901106
#> tau_sqr[4,4] 0.009716735 0.0134728801
#> tau_sqr[5,4] -0.003700782 -0.0015185088
#> tau_sqr[6,4] -0.002849895 -0.0006226758
#> tau_sqr[5,5] 0.007023229 0.0095893379
#> tau_sqr[6,5] 0.002039804 0.0043887756
#> tau_sqr[6,6] 0.008153270 0.0117206878
#> i_sqr[1,1] 0.999693793 0.9998482779
#> i_sqr[2,1] 0.999723360 0.9998539927
#> i_sqr[3,1] 0.900929482 0.9251906215
#> i_sqr[4,1] 0.917247552 0.9384994154
#> i_sqr[5,1] 0.860460347 0.8935947667
#> i_sqr[6,1] 0.894286070 0.9239681714Profile-Likelihood Confidence Intervals
confint(random, level = 0.95, lb = TRUE)
#> Error in `[.data.frame`:
#> ! undefined columns selected
confint(random, level = 0.99, lb = TRUE)
#> Error in `[.data.frame`:
#> ! undefined columns selected- The fixed part of the random-effects model gives pooled means for the person-specific parameters (e.g., and ) and fixed effects for how shifts these parameters.
- The random part yields between-person covariances () quantifying residual heterogeneity in set-point and dynamics beyond what is explained by .
means <- extract(random, what = "alpha")
means
#> [1] 1.03041785 -1.01664813 0.55126593 0.02049340 0.02076132 0.55520367
covariances <- extract(random, what = "tau_sqr")
covariances
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 7.24712604 2.13953910 0.1274063988 0.074670360 -0.114806095
#> [2,] 2.13953910 7.04745592 0.0631933449 0.134364710 -0.051614936
#> [3,] 0.12740640 0.06319334 0.0123191883 0.006110027 -0.001576686
#> [4,] 0.07467036 0.13436471 0.0061100270 0.011594808 -0.002609645
#> [5,] -0.11480610 -0.05161494 -0.0015766863 -0.002609645 0.008306284
#> [6,] -0.06440447 -0.11001564 -0.0007022972 -0.001736285 0.003214290
#> [,6]
#> [1,] -0.0644044742
#> [2,] -0.1100156354
#> [3,] -0.0007022972
#> [4,] -0.0017362855
#> [5,] 0.0032142896
#> [6,] 0.0099369788Finally, we compare the meta-analytic population estimates to the known generating values.
pop_mean
#> [1] 2.25717566 -2.11275830 0.61362799 -0.00661199 -0.00502123 0.61560881
pop_cov
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 7.87336834 0.88804821 0.273086594 0.0638425889 -0.0915731218
#> [2,] 0.88804821 8.36786378 -0.036344806 0.1331000366 -0.0374675414
#> [3,] 0.27308659 -0.03634481 0.030143625 0.0079252730 -0.0011555838
#> [4,] 0.06384259 0.13310004 0.007925273 0.0139995106 -0.0006635365
#> [5,] -0.09157312 -0.03746754 -0.001155584 -0.0006635365 0.0097715146
#> [6,] 0.09000510 -0.23694437 0.012738301 -0.0012966040 0.0040795653
#> [,6]
#> [1,] 0.090005095
#> [2,] -0.236944365
#> [3,] 0.012738301
#> [4,] -0.001296604
#> [5,] 0.004079565
#> [6,] 0.027041975Summary
This vignette demonstrates a two-stage hierarchical estimation approach for dynamic systems: 1. Individual-level DT-VAR estimation with stabilized measurement error. 2. Population-level meta-analysis of person-specific dynamics and means. 3. Estimation and interpretation of covariate effects, where predicts systematic between-person differences in dynamics and baseline levels.



