matrix_i2: matrix_i2

View source: R/i2_ml.R

matrix_i2R Documentation

matrix_i2

Description

Calculated I2 (I-squared) for mulilevel meta-analytic models, based on a matrix method proposed by Wolfgang Viechtbauer.

Usage

matrix_i2(model)

Arguments

model

Model object of class rma.mv or rma.

Examples

## Not run: 
# English example
data(english)
english <- escalc(measure = "SMD", n1i = NStartControl, sd1i = SD_C, m1i = MeanC, n2i = NStartExpt, sd2i = SD_E, m2i = MeanE, var.names=c("SMD","vSMD"),data = english)
english_MA <- rma.mv(yi = SMD, V = vSMD, random = list( ~ 1 | StudyNo, ~ 1 | EffectID), data = english)
I2_eng <- i2_ml(english_MA, data = english, method = "matrix")

# Lim example
data(lim)
# Add in the sampling variance
lim$vi<-(1/sqrt(lim$N - 3))^2
# Lets fit a meta-regression - I will do Article non-independence. The phylogenetic model found phylogenetic effects, however, instead we could fit Phylum as a fixed effect and explore them with an Orchard Plot
lim_MR<-metafor::rma.mv(yi=yi, V=vi, mods=~Phylum-1,
random=list(~1|Article, ~1|Datapoint), data=lim)
I2_lim <- i2_ml(lim_MR, data=lim, method = "matrix")

## End(Not run)

daniel1noble/orchaRd documentation built on May 12, 2024, 7:46 a.m.