Single-stage meta-analytic vector autoregressive model (VAR(1)) for time-series data collected across multiple studies. Pools temporal (lag-1) and contemporaneous network structures across studies using a random-effects framework. The meta_gvar wrapper sets contemporaneous = "ggm" for graphical VAR estimation.
meta_var1(data, covs, nobs,
vars, studyvar, idvar, dayvar, beepvar,
contemporaneous = c("cov", "chol", "prec", "ggm"),
beta = "full",
omega_zeta = "full", delta_zeta = "full",
kappa_zeta = "full", sigma_zeta = "full",
lowertri_zeta = "full",
randomEffects = c("chol", "cov", "prec", "ggm", "cor"),
sigma_randomEffects = "full",
kappa_randomEffects = "full",
omega_randomEffects = "full",
lowertri_randomEffects = "full",
delta_randomEffects = "full",
rho_randomEffects = "full",
SD_randomEffects = "full",
Vmats,
Vmethod = c("individual", "pooled"),
Vestimation = c("averaged", "per_study"),
baseline_saturated = TRUE, optimizer,
estimator = c("FIML", "ML"),
sampleStats, verbose = FALSE,
bootstrap = FALSE, boot_sub, boot_resample)meta_gvar(...)
An object of the class psychonetrics (psychonetrics-class)
A data frame containing time-series data for multiple studies. Use together with studyvar to identify studies.
A list of pre-computed Toeplitz covariance matrices (one per study). Each matrix should have dimension 2p x 2p where p is the number of variables, with the first p rows/columns being lagged variables and the second p being current variables. Alternative to data.
A vector with the number of observations per study. Required when covs is supplied.
Character vector of observed variable names. If missing, inferred from data.
A string indicating the column name in data that identifies the study. Required when data is supplied. If not supplied but idvar is, idvar is used as studyvar with a warning.
Optional string indicating the subject ID column within each study. When both studyvar and idvar are supplied, data is first split by studyvar, then idvar is used within each study to collate time series (as in var1).
Optional string indicating the day variable (passed to tsData per study).
Optional string indicating the beep variable within day (passed to tsData per study).
Parameterization of the contemporaneous (residual innovation) covariance structure. One of "cov", "chol", "prec", or "ggm".
Temporal lag-1 regression matrix specification. Defaults to "full" (all elements free, including diagonal autoregressive effects).
Contemporaneous partial correlation matrix specification (used when contemporaneous = "ggm").
Contemporaneous scaling matrix specification (used when contemporaneous = "ggm").
Contemporaneous precision matrix specification (used when contemporaneous = "prec").
Contemporaneous covariance matrix specification (used when contemporaneous = "cov").
Contemporaneous Cholesky factor specification (used when contemporaneous = "chol").
Parameterization of the random effects covariance structure.
Random effects covariance matrix specification (used when randomEffects = "cov").
Random effects precision matrix specification (used when randomEffects = "prec").
Random effects partial correlation matrix specification (used when randomEffects = "ggm").
Random effects Cholesky factor specification (used when randomEffects = "chol").
Random effects scaling matrix specification (used when randomEffects = "ggm").
Random effects correlation matrix specification (used when randomEffects = "cor").
Random effects standard deviation matrix specification (used when randomEffects = "cor").
Optional list with 'V' matrices (sampling error variance approximations).
Which method should be used to approximate the sampling error variance? "individual" or "pooled".
How should the sampling error estimates be evaluated? "averaged" or "per_study".
Logical indicating if baseline and saturated models should be included.
The optimizer to be used. Defaults to "nlminb".
The estimator to be used. "ML" or "FIML" (default).
Optional sample statistics object.
Logical, should progress be printed?
Should the data be bootstrapped?
Proportion of cases to subsample for bootstrap.
Logical, should bootstrap be with replacement?
Arguments sent to meta_var1.
Sacha Epskamp <mail@sachaepskamp.com>
This function implements a single-stage meta-analytic VAR(1) model. For p observed variables, each study's time-series data is transformed into a Toeplitz covariance structure from which two blocks are extracted:
Sigma_0: the p x p stationary covariance (symmetric, p(p+1)/2 unique elements)
Sigma_1: the p x p lag-1 cross-covariance (non-symmetric, p^2 elements)
The VAR(1) structural model implies: $$\textrm{vec}(\Sigma_0) = (I - \beta \otimes \beta)^{-1} \textrm{vec}(\Sigma_\zeta)$$ $$\Sigma_1 = \beta \Sigma_0$$
The meta-level mean is \(\mu = [\textrm{vech}(\Sigma_0), \textrm{vec}(\Sigma_1)]\) and heterogeneity is modeled as \(\Sigma = \Sigma^{(\textrm{ran})} + V\).
Note: the exogenous (lagged) covariance block from the full Toeplitz matrix is not modeled, as it is a nuisance parameter at the meta-analytic level.
var1, meta_varcov, meta_lvm
if (FALSE) {
library(mlVAR)
set.seed(42)
Model <- mlVARsim(nPerson = 50, nNode = 3, nTime = 50, lag = 1)
# Fit meta-analytic VAR(1):
mod <- meta_var1(Model$Data,
vars = Model$varNames,
studyvar = Model$idvar,
estimator = "ML")
mod <- mod %>% runmodel
# Inspect results:
print(mod)
getmatrix(mod, "beta")
# Fit meta-analytic GVAR (with GGM contemporaneous):
mod_gvar <- meta_gvar(Model$Data,
vars = Model$varNames,
studyvar = Model$idvar,
estimator = "ML")
mod_gvar <- mod_gvar %>% runmodel
getmatrix(mod_gvar, "omega_zeta")
}
Run the code above in your browser using DataLab