| Title: | Multivariate Meta-Analysis of Dynamic Model Estimates |
|---|---|
| Description: | Fits fixed-, random-, or mixed-effects multivariate meta-analysis models using dynamic model estimates from each individual building on and extending Lee and Gates (2023) <doi:10.1080/00273171.2023.2229310>. |
| Authors: | Ivan Jacob Agaloos Pesigan [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-4818-8420>) |
| Maintainer: | Ivan Jacob Agaloos Pesigan <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.2 |
| Built: | 2026-06-05 14:47:40 UTC |
| Source: | https://github.com/jeksterslab/metaDyn |
metadynmeta
Estimated Parameter Method for an Object of Class
metadynmeta
## S3 method for class 'metadynmeta' coef(object, ...)## S3 method for class 'metadynmeta' coef(object, ...)
object |
an object of class |
... |
further arguments. |
Returns a vector of estimated parameters.
Ivan Jacob Agaloos Pesigan
Confidence Intervals for the Parameter Estimates
## S3 method for class 'metadynmeta' confint( object, parm = NULL, level = 0.95, ci_type = "wald", robust = NULL, nrep = 1000L, seed = NULL, ncores = NULL, ... )## S3 method for class 'metadynmeta' confint( object, parm = NULL, level = 0.95, ci_type = "wald", robust = NULL, nrep = 1000L, seed = NULL, ncores = NULL, ... )
object |
an object of class |
parm |
a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered. |
level |
the confidence level required. |
ci_type |
Character string.
Valid values are |
robust |
Logical.
If |
nrep |
Positive integer.
Number of replications for |
seed |
Random seed for |
ncores |
Positive integer.
Number of cores to use for |
... |
further arguments. |
Returns a matrix of confidence intervals.
Ivan Jacob Agaloos Pesigan
A generic function for extracting elements from objects.
extract(object, what)extract(object, what)
object |
An object. |
what |
Character string. |
A value determined by the specific method for the object's class.
metadynmeta
Extract Method for an Object of Class
metadynmeta
## S3 method for class 'metadynmeta' extract(object, what = NULL)## S3 method for class 'metadynmeta' extract(object, what = NULL)
object |
an object of class |
what |
Character string.
What specific matrix to extract.
If |
Returns a list of estimates.
Ivan Jacob Agaloos Pesigan
This function estimates fixed-, random-, or mixed-effects meta-analytic parameters using per-individual coefficient estimates and their sampling variance-covariance matrices. Optionally, it fits distal-outcome models in which between-person outcomes are regressed on between-person covariates and the meta-analyzed parameters/effect sizes.
Meta( y, v, x = NULL, z = NULL, random = TRUE, fixed_x = TRUE, alpha_free = NULL, alpha_values = NULL, alpha_lbound = NULL, alpha_ubound = NULL, tau_sqr_diag = FALSE, tau_sqr_d_free = NULL, tau_sqr_d_values = NULL, tau_sqr_d_lbound = NULL, tau_sqr_d_ubound = NULL, tau_sqr_l_free = NULL, tau_sqr_l_values = NULL, tau_sqr_l_lbound = NULL, tau_sqr_l_ubound = NULL, mu_x_free = NULL, mu_x_values = NULL, mu_x_lbound = NULL, mu_x_ubound = NULL, sigma_x_d_free = NULL, sigma_x_d_values = NULL, sigma_x_d_lbound = NULL, sigma_x_d_ubound = NULL, sigma_x_l_free = NULL, sigma_x_l_values = NULL, sigma_x_l_lbound = NULL, sigma_x_l_ubound = NULL, gamma_free = NULL, gamma_values = NULL, gamma_lbound = NULL, gamma_ubound = NULL, kappa_free = NULL, kappa_values = NULL, kappa_lbound = NULL, kappa_ubound = NULL, phi_free = NULL, phi_values = NULL, phi_lbound = NULL, phi_ubound = NULL, omega_free = NULL, omega_values = NULL, omega_lbound = NULL, omega_ubound = NULL, psi_diag = FALSE, psi_d_free = NULL, psi_d_values = NULL, psi_d_lbound = NULL, psi_d_ubound = NULL, psi_l_free = NULL, psi_l_values = NULL, psi_l_lbound = NULL, psi_l_ubound = NULL, check_estimates = TRUE, robust = FALSE, alpha = 0.05, seed = NULL, tries_explore = 100, tries_local = 100, max_attempts = 10, silent = FALSE, ncores = NULL )Meta( y, v, x = NULL, z = NULL, random = TRUE, fixed_x = TRUE, alpha_free = NULL, alpha_values = NULL, alpha_lbound = NULL, alpha_ubound = NULL, tau_sqr_diag = FALSE, tau_sqr_d_free = NULL, tau_sqr_d_values = NULL, tau_sqr_d_lbound = NULL, tau_sqr_d_ubound = NULL, tau_sqr_l_free = NULL, tau_sqr_l_values = NULL, tau_sqr_l_lbound = NULL, tau_sqr_l_ubound = NULL, mu_x_free = NULL, mu_x_values = NULL, mu_x_lbound = NULL, mu_x_ubound = NULL, sigma_x_d_free = NULL, sigma_x_d_values = NULL, sigma_x_d_lbound = NULL, sigma_x_d_ubound = NULL, sigma_x_l_free = NULL, sigma_x_l_values = NULL, sigma_x_l_lbound = NULL, sigma_x_l_ubound = NULL, gamma_free = NULL, gamma_values = NULL, gamma_lbound = NULL, gamma_ubound = NULL, kappa_free = NULL, kappa_values = NULL, kappa_lbound = NULL, kappa_ubound = NULL, phi_free = NULL, phi_values = NULL, phi_lbound = NULL, phi_ubound = NULL, omega_free = NULL, omega_values = NULL, omega_lbound = NULL, omega_ubound = NULL, psi_diag = FALSE, psi_d_free = NULL, psi_d_values = NULL, psi_d_lbound = NULL, psi_d_ubound = NULL, psi_l_free = NULL, psi_l_values = NULL, psi_l_lbound = NULL, psi_l_ubound = NULL, check_estimates = TRUE, robust = FALSE, alpha = 0.05, seed = NULL, tries_explore = 100, tries_local = 100, max_attempts = 10, silent = FALSE, ncores = NULL )
y |
A list. Each element of the list is a numeric vector of estimated coefficients. |
v |
A list.
Each element of the list
is a sampling variance-covariance matrix of |
x |
An optional list. Each element of the list is a numeric vector of covariates. |
z |
An optional list. Each element of the list is a numeric vector of distal outcomes. |
random |
Logical.
If |
fixed_x |
Logical.
If |
alpha_free |
Logical vector.
Optional vector of free ( |
alpha_values |
Numeric vector.
Optional vector of starting values for |
alpha_lbound |
Numeric vector.
Optional vector of lower bound values for |
alpha_ubound |
Numeric vector.
Optional vector of upper bound values for |
tau_sqr_diag |
Logical.
If |
tau_sqr_d_free |
Logical vector
indicating free/fixed status of the elements of |
tau_sqr_d_values |
Numeric vector
with starting values for |
tau_sqr_d_lbound |
Numeric vector
with lower bounds for |
tau_sqr_d_ubound |
Numeric vector
with upper bounds for |
tau_sqr_l_free |
Logical matrix
indicating which strictly-lower-triangular elements
of |
tau_sqr_l_values |
Numeric matrix
of starting values for the strictly-lower-triangular elements
of |
tau_sqr_l_lbound |
Numeric matrix
with lower bounds for |
tau_sqr_l_ubound |
Numeric matrix
with upper bounds for |
mu_x_free |
Logical vector.
Optional vector of free ( |
mu_x_values |
Numeric vector.
Optional vector of starting values for |
mu_x_lbound |
Numeric vector.
Optional vector of lower bound values for |
mu_x_ubound |
Numeric vector.
Optional vector of upper bound values for |
sigma_x_d_free |
Logical vector
indicating free/fixed status of the elements of |
sigma_x_d_values |
Numeric vector
with starting values for |
sigma_x_d_lbound |
Numeric vector
with lower bounds for |
sigma_x_d_ubound |
Numeric vector
with upper bounds for |
sigma_x_l_free |
Logical matrix
indicating which strictly-lower-triangular elements
of |
sigma_x_l_values |
Numeric matrix
of starting values for the strictly-lower-triangular elements
of |
sigma_x_l_lbound |
Numeric matrix
with lower bounds for |
sigma_x_l_ubound |
Numeric matrix
with upper bounds for |
gamma_free |
Logical matrix.
Optional matrix of free ( |
gamma_values |
Numeric matrix.
Optional matrix of starting values for |
gamma_lbound |
Numeric matrix.
Optional matrix of lower bound values for |
gamma_ubound |
Numeric matrix.
Optional matrix of upper bound values for |
kappa_free |
Logical vector.
Optional vector of free ( |
kappa_values |
Numeric vector.
Optional vector of starting values for |
kappa_lbound |
Numeric vector.
Optional vector of lower bound values for |
kappa_ubound |
Numeric vector.
Optional vector of upper bound values for |
phi_free |
Logical matrix.
Optional matrix of free ( |
phi_values |
Numeric matrix.
Optional matrix of starting values for |
phi_lbound |
Numeric matrix.
Optional matrix of lower bound values for |
phi_ubound |
Numeric matrix.
Optional matrix of upper bound values for |
omega_free |
Logical matrix.
Optional matrix of free ( |
omega_values |
Numeric matrix.
Optional matrix of starting values for |
omega_lbound |
Numeric matrix.
Optional matrix of lower bound values for |
omega_ubound |
Numeric matrix.
Optional matrix of upper bound values for |
psi_diag |
Logical.
If |
psi_d_free |
Logical vector
indicating free/fixed status of the elements of |
psi_d_values |
Numeric vector
with starting values for |
psi_d_lbound |
Numeric vector
with lower bounds for |
psi_d_ubound |
Numeric vector
with upper bounds for |
psi_l_free |
Logical matrix
indicating which strictly-lower-triangular elements
of |
psi_l_values |
Numeric matrix
of starting values for the strictly-lower-triangular elements
of |
psi_l_lbound |
Numeric matrix
with lower bounds for |
psi_l_ubound |
Numeric matrix
with upper bounds for |
check_estimates |
Logical.
Check elements of |
robust |
Logical.
If |
alpha |
NUmeric. Alpha for test of significance and confidence intervals. |
seed |
Random seed for reproducibility. |
tries_explore |
Integer. Number of extra tries for the wide exploration phase. |
tries_local |
Integer. Number of extra tries for local polishing. |
max_attempts |
Integer. Maximum number of remediation attempts after the first Hessian computation fails the criteria. |
silent |
Logical.
If |
ncores |
Positive integer. Number of cores to use. |
Returns an object of class metadynmeta which is
a list with the following elements:
Function call.
List of function arguments.
Function used ("Meta").
A fitted OpenMx model.
Output from OpenMx::imxRobustSE()
with argument details = TRUE if robust = TRUE.
Ivan Jacob Agaloos Pesigan
Cheung, M. W.-L. (2015). Meta-analysis: A structural equation modeling approach. Wiley. doi:10.1002/9781118957813
Neale, M. C., Hunter, M. D., Pritikin, J. N., Zahery, M., Brick, T. R., Kirkpatrick, R. M., Estabrook, R., Bates, T. C., Maes, H. H., & Boker, S. M. (2015). OpenMx 2.0: Extended structural equation and statistical modeling. Psychometrika, 81(2), 535–549. doi:10.1007/s11336-014-9435-8
Other Meta-Analysis of VAR Functions:
MetaVARMx()
if (requireNamespace("simStateSpace")) { # Generate data using the simStateSpace package------------------------- library(simStateSpace) set.seed(42) n <- 5 time <- 100 p <- 2 alpha <- rep(x = 0, times = p) beta <- 0.50 * diag(p) psi <- 0.001 * diag(p) psi_l <- t(chol(psi)) mu0 <- SSMMeanEta( beta = beta, alpha = alpha ) sigma0 <- SSMCovEta( beta = beta, psi = psi ) sigma0_l <- t(chol(sigma0)) sim <- SimSSMVARFixed( n = n, time = time, mu0 = mu0, sigma0_l = sigma0_l, alpha = alpha, beta = beta, psi_l = psi_l ) data <- as.data.frame(sim) # Stage 1--------------------------------------------------------------- library(fitVARMxID) stage1 <- FitVARMxID( data = data, observed = paste0("y", seq_len(p)), id = "id", center = TRUE ) summary(stage1) # Stage 2--------------------------------------------------------------- # Meta-analyze set point vector and matrix of lagged-effects y <- coef( object = stage1, mu = TRUE, beta = TRUE, alpha = FALSE, nu = FALSE, psi = FALSE, theta = FALSE ) v <- vcov( object = stage1, mu = TRUE, beta = TRUE, alpha = FALSE, nu = FALSE, psi = FALSE, theta = FALSE ) library(metaDyn) stage2 <- Meta(y = y, v = v, random = FALSE) # Methods for the output of the Meta() function print(stage2) summary(stage2) coef(stage2) vcov(stage2) confint(stage2) extract(stage2, what = "alpha") }if (requireNamespace("simStateSpace")) { # Generate data using the simStateSpace package------------------------- library(simStateSpace) set.seed(42) n <- 5 time <- 100 p <- 2 alpha <- rep(x = 0, times = p) beta <- 0.50 * diag(p) psi <- 0.001 * diag(p) psi_l <- t(chol(psi)) mu0 <- SSMMeanEta( beta = beta, alpha = alpha ) sigma0 <- SSMCovEta( beta = beta, psi = psi ) sigma0_l <- t(chol(sigma0)) sim <- SimSSMVARFixed( n = n, time = time, mu0 = mu0, sigma0_l = sigma0_l, alpha = alpha, beta = beta, psi_l = psi_l ) data <- as.data.frame(sim) # Stage 1--------------------------------------------------------------- library(fitVARMxID) stage1 <- FitVARMxID( data = data, observed = paste0("y", seq_len(p)), id = "id", center = TRUE ) summary(stage1) # Stage 2--------------------------------------------------------------- # Meta-analyze set point vector and matrix of lagged-effects y <- coef( object = stage1, mu = TRUE, beta = TRUE, alpha = FALSE, nu = FALSE, psi = FALSE, theta = FALSE ) v <- vcov( object = stage1, mu = TRUE, beta = TRUE, alpha = FALSE, nu = FALSE, psi = FALSE, theta = FALSE ) library(metaDyn) stage2 <- Meta(y = y, v = v, random = FALSE) # Methods for the output of the Meta() function print(stage2) summary(stage2) coef(stage2) vcov(stage2) confint(stage2) extract(stage2, what = "alpha") }
This function estimates fixed-, random-, or mixed-effects
meta-analytic parameters using per-individual coefficient estimates
and their sampling variance-covariance matrices.
Optionally, it fits distal-outcome models
in which between-person outcomes are regressed on
between-person covariates and the meta-analyzed parameters/effect sizes.
This function uses the estimated coefficients and
sampling variance-covariance matrix
from each individual fitted using the
fitVARMxID::FitVARMxID() function.
MetaVARMx( object, x = NULL, z = NULL, random = TRUE, fixed_x = TRUE, alpha_free = NULL, alpha_values = NULL, alpha_lbound = NULL, alpha_ubound = NULL, tau_sqr_diag = FALSE, tau_sqr_d_free = NULL, tau_sqr_d_values = NULL, tau_sqr_d_lbound = NULL, tau_sqr_d_ubound = NULL, tau_sqr_l_free = NULL, tau_sqr_l_values = NULL, tau_sqr_l_lbound = NULL, tau_sqr_l_ubound = NULL, mu_x_free = NULL, mu_x_values = NULL, mu_x_lbound = NULL, mu_x_ubound = NULL, sigma_x_d_free = NULL, sigma_x_d_values = NULL, sigma_x_d_lbound = NULL, sigma_x_d_ubound = NULL, sigma_x_l_free = NULL, sigma_x_l_values = NULL, sigma_x_l_lbound = NULL, sigma_x_l_ubound = NULL, gamma_free = NULL, gamma_values = NULL, gamma_lbound = NULL, gamma_ubound = NULL, kappa_free = NULL, kappa_values = NULL, kappa_lbound = NULL, kappa_ubound = NULL, phi_free = NULL, phi_values = NULL, phi_lbound = NULL, phi_ubound = NULL, omega_free = NULL, omega_values = NULL, omega_lbound = NULL, omega_ubound = NULL, psi_diag = FALSE, psi_d_free = NULL, psi_d_values = NULL, psi_d_lbound = NULL, psi_d_ubound = NULL, psi_l_free = NULL, psi_l_values = NULL, psi_l_lbound = NULL, psi_l_ubound = NULL, check_estimates = TRUE, effects = TRUE, set_point = TRUE, int_meas = TRUE, int_dyn = TRUE, cov_meas = TRUE, cov_dyn = TRUE, robust_v = FALSE, robust = FALSE, alpha = 0.05, seed = NULL, tries_explore = 100, tries_local = 100, max_attempts = 10, silent = FALSE, ncores = NULL )MetaVARMx( object, x = NULL, z = NULL, random = TRUE, fixed_x = TRUE, alpha_free = NULL, alpha_values = NULL, alpha_lbound = NULL, alpha_ubound = NULL, tau_sqr_diag = FALSE, tau_sqr_d_free = NULL, tau_sqr_d_values = NULL, tau_sqr_d_lbound = NULL, tau_sqr_d_ubound = NULL, tau_sqr_l_free = NULL, tau_sqr_l_values = NULL, tau_sqr_l_lbound = NULL, tau_sqr_l_ubound = NULL, mu_x_free = NULL, mu_x_values = NULL, mu_x_lbound = NULL, mu_x_ubound = NULL, sigma_x_d_free = NULL, sigma_x_d_values = NULL, sigma_x_d_lbound = NULL, sigma_x_d_ubound = NULL, sigma_x_l_free = NULL, sigma_x_l_values = NULL, sigma_x_l_lbound = NULL, sigma_x_l_ubound = NULL, gamma_free = NULL, gamma_values = NULL, gamma_lbound = NULL, gamma_ubound = NULL, kappa_free = NULL, kappa_values = NULL, kappa_lbound = NULL, kappa_ubound = NULL, phi_free = NULL, phi_values = NULL, phi_lbound = NULL, phi_ubound = NULL, omega_free = NULL, omega_values = NULL, omega_lbound = NULL, omega_ubound = NULL, psi_diag = FALSE, psi_d_free = NULL, psi_d_values = NULL, psi_d_lbound = NULL, psi_d_ubound = NULL, psi_l_free = NULL, psi_l_values = NULL, psi_l_lbound = NULL, psi_l_ubound = NULL, check_estimates = TRUE, effects = TRUE, set_point = TRUE, int_meas = TRUE, int_dyn = TRUE, cov_meas = TRUE, cov_dyn = TRUE, robust_v = FALSE, robust = FALSE, alpha = 0.05, seed = NULL, tries_explore = 100, tries_local = 100, max_attempts = 10, silent = FALSE, ncores = NULL )
object |
Output of the |
x |
An optional list. Each element of the list is a numeric vector of covariates. |
z |
An optional list. Each element of the list is a numeric vector of distal outcomes. |
random |
Logical.
If |
fixed_x |
Logical.
If |
alpha_free |
Logical vector.
Optional vector of free ( |
alpha_values |
Numeric vector.
Optional vector of starting values for |
alpha_lbound |
Numeric vector.
Optional vector of lower bound values for |
alpha_ubound |
Numeric vector.
Optional vector of upper bound values for |
tau_sqr_diag |
Logical.
If |
tau_sqr_d_free |
Logical vector
indicating free/fixed status of the elements of |
tau_sqr_d_values |
Numeric vector
with starting values for |
tau_sqr_d_lbound |
Numeric vector
with lower bounds for |
tau_sqr_d_ubound |
Numeric vector
with upper bounds for |
tau_sqr_l_free |
Logical matrix
indicating which strictly-lower-triangular elements
of |
tau_sqr_l_values |
Numeric matrix
of starting values for the strictly-lower-triangular elements
of |
tau_sqr_l_lbound |
Numeric matrix
with lower bounds for |
tau_sqr_l_ubound |
Numeric matrix
with upper bounds for |
mu_x_free |
Logical vector.
Optional vector of free ( |
mu_x_values |
Numeric vector.
Optional vector of starting values for |
mu_x_lbound |
Numeric vector.
Optional vector of lower bound values for |
mu_x_ubound |
Numeric vector.
Optional vector of upper bound values for |
sigma_x_d_free |
Logical vector
indicating free/fixed status of the elements of |
sigma_x_d_values |
Numeric vector
with starting values for |
sigma_x_d_lbound |
Numeric vector
with lower bounds for |
sigma_x_d_ubound |
Numeric vector
with upper bounds for |
sigma_x_l_free |
Logical matrix
indicating which strictly-lower-triangular elements
of |
sigma_x_l_values |
Numeric matrix
of starting values for the strictly-lower-triangular elements
of |
sigma_x_l_lbound |
Numeric matrix
with lower bounds for |
sigma_x_l_ubound |
Numeric matrix
with upper bounds for |
gamma_free |
Logical matrix.
Optional matrix of free ( |
gamma_values |
Numeric matrix.
Optional matrix of starting values for |
gamma_lbound |
Numeric matrix.
Optional matrix of lower bound values for |
gamma_ubound |
Numeric matrix.
Optional matrix of upper bound values for |
kappa_free |
Logical vector.
Optional vector of free ( |
kappa_values |
Numeric vector.
Optional vector of starting values for |
kappa_lbound |
Numeric vector.
Optional vector of lower bound values for |
kappa_ubound |
Numeric vector.
Optional vector of upper bound values for |
phi_free |
Logical matrix.
Optional matrix of free ( |
phi_values |
Numeric matrix.
Optional matrix of starting values for |
phi_lbound |
Numeric matrix.
Optional matrix of lower bound values for |
phi_ubound |
Numeric matrix.
Optional matrix of upper bound values for |
omega_free |
Logical matrix.
Optional matrix of free ( |
omega_values |
Numeric matrix.
Optional matrix of starting values for |
omega_lbound |
Numeric matrix.
Optional matrix of lower bound values for |
omega_ubound |
Numeric matrix.
Optional matrix of upper bound values for |
psi_diag |
Logical.
If |
psi_d_free |
Logical vector
indicating free/fixed status of the elements of |
psi_d_values |
Numeric vector
with starting values for |
psi_d_lbound |
Numeric vector
with lower bounds for |
psi_d_ubound |
Numeric vector
with upper bounds for |
psi_l_free |
Logical matrix
indicating which strictly-lower-triangular elements
of |
psi_l_values |
Numeric matrix
of starting values for the strictly-lower-triangular elements
of |
psi_l_lbound |
Numeric matrix
with lower bounds for |
psi_l_ubound |
Numeric matrix
with upper bounds for |
check_estimates |
Logical.
Check elements of |
effects |
Logical.
If |
set_point |
Logical.
If |
int_meas |
Logical.
If |
int_dyn |
Logical.
If |
cov_meas |
Logical.
If |
cov_dyn |
Logical.
If |
robust_v |
Logical.
If |
robust |
Logical.
If |
alpha |
NUmeric. Alpha for test of significance and confidence intervals. |
seed |
Random seed for reproducibility. |
tries_explore |
Integer. Number of extra tries for the wide exploration phase. |
tries_local |
Integer. Number of extra tries for local polishing. |
max_attempts |
Integer. Maximum number of remediation attempts after the first Hessian computation fails the criteria. |
silent |
Logical.
If |
ncores |
Positive integer. Number of cores to use. |
Returns an object of class metadynmeta which is
a list with the following elements:
Function call.
List of function arguments.
Function used ("Meta").
A fitted OpenMx model.
Output from OpenMx::imxRobustSE()
with argument details = TRUE if robust = TRUE.
Ivan Jacob Agaloos Pesigan
Cheung, M. W.-L. (2015). Meta-analysis: A structural equation modeling approach. Wiley. doi:10.1002/9781118957813
Neale, M. C., Hunter, M. D., Pritikin, J. N., Zahery, M., Brick, T. R., Kirkpatrick, R. M., Estabrook, R., Bates, T. C., Maes, H. H., & Boker, S. M. (2015). OpenMx 2.0: Extended structural equation and statistical modeling. Psychometrika, 81(2), 535–549. doi:10.1007/s11336-014-9435-8
Other Meta-Analysis of VAR Functions:
Meta()
if (requireNamespace("simStateSpace")) { # Generate data using the simStateSpace package------------------------- library(simStateSpace) set.seed(42) n <- 5 time <- 100 p <- 2 alpha <- rep(x = 0, times = p) beta <- 0.50 * diag(p) psi <- 0.001 * diag(p) psi_l <- t(chol(psi)) mu0 <- SSMMeanEta( beta = beta, alpha = alpha ) sigma0 <- SSMCovEta( beta = beta, psi = psi ) sigma0_l <- t(chol(sigma0)) sim <- SimSSMVARFixed( n = n, time = time, mu0 = mu0, sigma0_l = sigma0_l, alpha = alpha, beta = beta, psi_l = psi_l ) data <- as.data.frame(sim) # Stage 1--------------------------------------------------------------- library(fitVARMxID) stage1 <- FitVARMxID( data = data, observed = paste0("y", seq_len(p)), id = "id", center = TRUE ) summary(stage1) # Stage 2--------------------------------------------------------------- # Meta-analyze set point vector and matrix of lagged-effects library(metaDyn) stage2 <- MetaVARMx( object = stage1, random = FALSE, effects = TRUE, set_point = TRUE, int_meas = FALSE, int_dyn = FALSE, cov_meas = FALSE, cov_dyn = FALSE ) # Methods for the output of the MetaVARMx() function print(stage2) summary(stage2) coef(stage2) vcov(stage2) confint(stage2) extract(stage2, what = "alpha") }if (requireNamespace("simStateSpace")) { # Generate data using the simStateSpace package------------------------- library(simStateSpace) set.seed(42) n <- 5 time <- 100 p <- 2 alpha <- rep(x = 0, times = p) beta <- 0.50 * diag(p) psi <- 0.001 * diag(p) psi_l <- t(chol(psi)) mu0 <- SSMMeanEta( beta = beta, alpha = alpha ) sigma0 <- SSMCovEta( beta = beta, psi = psi ) sigma0_l <- t(chol(sigma0)) sim <- SimSSMVARFixed( n = n, time = time, mu0 = mu0, sigma0_l = sigma0_l, alpha = alpha, beta = beta, psi_l = psi_l ) data <- as.data.frame(sim) # Stage 1--------------------------------------------------------------- library(fitVARMxID) stage1 <- FitVARMxID( data = data, observed = paste0("y", seq_len(p)), id = "id", center = TRUE ) summary(stage1) # Stage 2--------------------------------------------------------------- # Meta-analyze set point vector and matrix of lagged-effects library(metaDyn) stage2 <- MetaVARMx( object = stage1, random = FALSE, effects = TRUE, set_point = TRUE, int_meas = FALSE, int_dyn = FALSE, cov_meas = FALSE, cov_dyn = FALSE ) # Methods for the output of the MetaVARMx() function print(stage2) summary(stage2) coef(stage2) vcov(stage2) confint(stage2) extract(stage2, what = "alpha") }
metadynmeta
Print Method for Object of Class metadynmeta
## S3 method for class 'metadynmeta' print( x, alpha = NULL, ci_type = "wald", robust = NULL, nrep = 1000L, seed = NULL, digits = 4, ... )## S3 method for class 'metadynmeta' print( x, alpha = NULL, ci_type = "wald", robust = NULL, nrep = 1000L, seed = NULL, digits = 4, ... )
x |
an object of class |
alpha |
Numeric vector.
Significance level |
ci_type |
Character string.
Valid values are |
robust |
Logical.
If |
nrep |
Positive integer.
Number of replications for |
seed |
Random seed for |
digits |
Integer indicating the number of decimal places to display. |
... |
further arguments. |
Returns a matrix of estimates, standard errors, test statistics, degrees of freedom, p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
metadynmeta
Summary Method for Object of Class metadynmeta
## S3 method for class 'metadynmeta' summary( object, alpha = NULL, ci_type = "wald", robust = NULL, nrep = 1000L, seed = NULL, ncores = NULL, digits = 4, ... )## S3 method for class 'metadynmeta' summary( object, alpha = NULL, ci_type = "wald", robust = NULL, nrep = 1000L, seed = NULL, ncores = NULL, digits = 4, ... )
object |
an object of class |
alpha |
Numeric vector.
Significance level |
ci_type |
Character string.
Valid values are |
robust |
Logical.
If |
nrep |
Positive integer.
Number of replications for |
seed |
Random seed for |
ncores |
Positive integer.
Number of cores to use for |
digits |
Integer indicating the number of decimal places to display. |
... |
further arguments. |
Returns a matrix of estimates, standard errors, test statistics, degrees of freedom, p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
metadynmeta
Variance-Covariance Matrix Method for an Object of Class
metadynmeta
## S3 method for class 'metadynmeta' vcov(object, robust = NULL, ...)## S3 method for class 'metadynmeta' vcov(object, robust = NULL, ...)
object |
an object of class |
robust |
Logical.
If |
... |
further arguments. |
Returns the sampling variance-covariance matrix of the estimated parameters.
Ivan Jacob Agaloos Pesigan