Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

Author(s)

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

See Also

Examples

### 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

metafor

Meta-Analysis Package for R

v2.4-0
GPL (>= 2)
Authors
Wolfgang Viechtbauer [aut, cre] (<https://orcid.org/0000-0003-3463-4063>)
Initial release
2020-03-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.