tau2: Variance Components

Description Usage Arguments Value References Examples

View source: R/tau2.R

Description

Typically, the variance components are assumed constant across the k studies in meta-analysis. When scale modeling, the variance components are a function of moderators, which can be computed with this function \insertCite@see @williams2021puttingblsmeta.

Usage

1
2
3
4
5
6
7
8
9
tau2(
  object,
  type = "sd",
  newdata_scale2 = NULL,
  newdata_scale3 = NULL,
  cred = 0.95,
  summary = TRUE,
  digits = 3
)

Arguments

object

An object of class blsmeta.

type

character. Should the variance or standard deviation? The options are type = "var" and type = "sd" (the default).

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

cred

numeric. credible interval (defaults to 0.95).

summary

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

digits

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

Value

A data frame of predicted values.

References

\insertAllCited

'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(psymetadata)

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


tau2(object = fit, 
     newdata_scale2 = data.frame(n = seq(20, 100, 10)))

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