bldiag {metafor}R Documentation

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.

Author(s)

Posted to R-help by Berton Gunter (2 Sep 2005).

See Also

rma.mv

Examples

### load data
dat <- get(data(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)

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

[Package metafor version 2.0-0 Index]