variance_yi: Compute the Total Variance in 'yi'

Description Usage Arguments Value Note References Examples

View source: R/variance_yi.R

Description

Typically, the variance components are assumed constant across the k studies in meta-analysis, implying that the total variance for each effect size is the sum of the sampling and between-study variance. When scale modeling, the variance in yi is now a function of those moderators, which can be computed with this function \insertCite@see @williams2021puttingblsmeta.

Usage

1
variance_yi(object, type = "sd", cred = 0.95, summary = TRUE)

Arguments

object

object of class blsmeta.

type

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

cred

numeric. credible interval (defaults to 0.95).

summary

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

Value

Either a summarized data frame, including the posterior mean, sd, and credible intervals, or a matrix of dimensions iter * chains by k.

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
library(psymetadata)

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

no_scale_mod <- variance_yi(fit)

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

scale_mod <- variance_yi(fit)

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