metafor (version 2.4-0)

bldiag: Construct Block Diagonal Matrix

Description

Function to construct a block diagonal matrix from (a list of) matrices.

Usage

bldiag(…)

Arguments

individual matrices or a list of matrices.

See Also

rma.mv

Examples

Run this code
# NOT RUN {
### copy data into 'dat'
dat <- dat.berkey1998

### construct list of the variance-covariance matrices of the observed outcomes for the studies
V <- lapply(split(dat[c("v1i", "v2i")], dat$trial), as.matrix)
V

### construct block diagonal matrix
V <- bldiag(V)
V
# }

Run the code above in your browser using DataLab