metagen (version 1.0)

metareg: Inference: Based on methods of moments and maximum likelihood.

Description

Calculates common statistics for point and confidence interval estimates for the heterogeneity and the regression coefficients of the random effects meta regression model based on the given data.

Usage

metareg(y, d, x, sgnf)

Arguments

y
k-vector of study responses.
d
k-vector of heteroscedasticity.
x
design k-p-matrix.
sgnf
significance levels.

Value

The same return type as the skeleton 'metagenEmpty()'.

Examples

Run this code
bcg   <- bcgVaccineData()
bcg_y <- bcg$logrisk
bcg_d <- bcg$sdiv
bcg_s <- bcg$size
bcg_x <- cbind(1,bcg$x)
sgnf_lev <- c(0.01, 0.025, 0.05, 0.01)

set.seed(865287113) # for reproducibility

c1 <- metareg(y=bcg_y, d=bcg_d, x=bcg_x, sgnf=0.025)
c2 <- metareg(y=bcg_y, d=bcg_d, x=bcg_x, sgnf=sgnf_lev)

# When performing a meta analysis, provide the function
# with a vector of 1s.
if (!all(names(c1) == names(metagenEmpty()))) stop("Name clash")
if (!all(names(c2) == names(metagenEmpty()))) stop("Name clash")

Run the code above in your browser using DataLab