Learn R Programming

jarbes (version 2.3.0)

simData: Simulate Data for Meta-Analysis

Description

This function simulates aggregated data for a meta-analysis, introducing biased studies at different levels.

Usage

simData(
  mu,
  sigma,
  n.total,
  tau,
  N,
  mu.beta.1,
  mu.beta.2,
  mu.beta.3,
  n.B.1,
  n.B.2,
  n.B.3
)

Value

A dataframe with columns:

TE

Observed study's effect.

seTE

Standard error of the study's effect.

theta

True study's effect.

n.total

Sample size of the study.

B.flag

Bias category: "No B", "Mild B", "Large B", "Extreme B".

Arguments

mu

Scalar with the true pooled effect value.

sigma

Scalar with the true intra-study standard deviation.

n.total

A vector with the sample sizes of the studies.

tau

Scalar with the between-studies standard deviation.

N

Scalar with the total number of studies in the meta-analysis.

mu.beta.1

Scalar with the mean bias of studies in the mild bias class.

mu.beta.2

Scalar with the mean bias of studies in the large bias class.

mu.beta.3

Scalar with the mean bias of studies in the extreme bias class.

n.B.1

Scalar with the number of studies in the mild bias class.

n.B.2

Scalar with the number of studies in the large bias class.

n.B.3

Scalar with the number of studies in the extreme bias class.

Examples

Run this code

set.seed(123)
simData(mu = 0, sigma = 1, n.total = rep(100, 10), tau = 0.5, N = 10,
        mu.beta.1 = 0.2, mu.beta.2 = 0.5, mu.beta.3 = 1,
        n.B.1 = 2, n.B.2 = 2, n.B.3 = 2)

Run the code above in your browser using DataLab