create.Tau2: Create a variance component of the heterogeneity of the...

View source: R/osmasem.R

create.Tau2R Documentation

Create a variance component of the heterogeneity of the random effects

Description

It creates variance component of the heterogeneity of the random effects by decomposing the variance component into matrices of correlation and standard deviations.

Usage

create.Tau2(RAM, no.var, Tau1.labels=seq(no.var),
            RE.type = c("Diag", "Symm", "Zero", "User"),
            level=c("single", "between", "within"),
            RE.User=NULL, Transform = c("expLog", "sqSD"),
            RE.startvalues=0.05)

Arguments

RAM

The RAM model for testing. no.var is calculated from it.

no.var

If RAM is missing, the user has to specify the no.var argument. It represents the no.var by no.var of the random effects).

Tau1.labels

Parameter labels in Tau1. The default is Tau1_1, Tau1_2, etc.

RE.type

Either "Diag", "Symm", "Zero" or "User". If it is"Diag" (the default if missing), a diagonal matrix is used for the random effects meaning that the random effects are independent. If it is "Symm", a symmetric matrix is used for the random effects on the covariances among the correlation (or covariance) vectors. If it is "Zero", a zero matrix is assumed on the variance component of the random effects. If it is "User", users have to specify the RE.User argument.

level

whether it is for single-level, between-, or within-level analyses. The only difference are the names of the matrices.

RE.User

It represents the no.var by no.var symmetric matrix of TRUE or FALSE for the variance component. If the elements are FALSE, they are fixed at 0.

Transform

Either "expLog" or "sqSD". If it is "expLog", the variances are estimated by applying a log and exp transformation. If it is "sqSD", the variances are estimated by applying a square on the SD. The transformation may improve the estimation when the heterogeneity is small or close to zero.

RE.startvalues

Starting values for the variances.

Value

A list of MxMatrix-class. The variance component is computed in Tau2.

Author(s)

Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>

See Also

osmasem, create.V, create.vechsR

Examples


T0 <- create.Tau2(no.var=4, RE.type="Diag", Transform="expLog", RE.startvalues=0.05)
T0

T1 <- create.Tau2(no.var=4, Tau1.labels=c("a", "b", "c", "d"))
T1


metaSEM documentation built on Sept. 30, 2024, 9:21 a.m.