I2: I2 Heterogeneity Statistic

Description Usage Arguments Value Note References Examples

View source: R/I2.R

Description

Compute I2 (total heterogeneity divided by total variability). Note that the I2 formulation for three-level models is described in \insertCitecheung2014modeling;textualblsmeta.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
I2(
  object,
  newdata_scale2 = NULL,
  newdata_scale3 = NULL,
  s2 = NULL,
  cred = 0.95,
  summary = TRUE,
  percent = TRUE,
  digits = 3
)

Arguments

object

An object of class blsmeta.

newdata_scale2

An optional data.frame for which to compute predictions for the level 2 variance component. Defaults to NULL, which then uses the original data used in blsmeta

newdata_scale3

An optional data.frame for which to compute predictions for the level 3 variance component. Defaults to NULL, which then uses the original data used in blsmeta

s2

numeric. A user-defined "typical" sampling variance. Defaults to the estimator in Equation 9 of \insertCiteHiggins2002a;textualblsmeta.

cred

numeric. credible interval (defaults to 0.95).

summary

logical. Should the posterior samples be summarized (defaults to TRUE)?

percent

logical. Should the results be percentages, as in metafor (defaults to TRUE)?

digits

numeric. The desired number of digits for the summarized estimates (defaults to 3).

Value

A data frame of predicted values.

Note

The sampling variances are assumed to be known.

References

\insertAllCited

'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# data
library(psymetadata)

# no scale model
fit <- blsmeta(yi, vi,
               es_id = es_id,
               data = gnambs2020)

# compute I2 for all data
i2 <- I2(fit)

# scale model
fit <- blsmeta(yi, vi,
               es_id = es_id,
               mods_scale2 = ~ n,
               data = gnambs2020)

new_data <- data.frame(n = c(100, 150))

# compute I2 for new data
i2 <- I2(fit, newdata_scale2 = new_data)

donaldRwilliams/blsmeta documentation built on Dec. 20, 2021, 12:12 a.m.