metagenGeneralised: Inference: Based on generalised inference principles.

Description Usage Arguments Examples

View source: R/methods-for-inference.R

Description

Inference: Based on generalised inference principles.

Usage

1
2
3
  metagenGeneralised(y, d, x, sgnf, s = NULL, n,
    method = list("univariate", "multivariate"),
    adjusted = FALSE)

Arguments

y

k-vector of responses.

d

k-vector of heteroscedasticities.

x

design k-p-matrix.

sgnf

vector of significance levels

s

k-vector of study responses. No need to provide this, when 'adjusted==FALSE'. Default is NULL.

n

draws from the pivotal distribution.

method

Default is 'list("univariate", "multivariate")'.

adjusted

TRUE or FALSE. Default is FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
bcg   <- bcgVaccineData()
bcg_y <- bcg$logrisk
bcg_d <- bcg$sdiv
bcg_x <- cbind(1,bcg$x)
sgnf_lev <- c(0.01, 0.025, 0.05, 0.01)

set.seed(865287113) # for reproducibility

# Runs a standard analysis, use n=1000 in an actual
# analysis instead!!
g1 <- metagenGeneralised(y=bcg_y, d=bcg_d, x=bcg_x, sgnf=0.025, n=50)
g2 <- metagenGeneralised(y=bcg_y, d=bcg_d, x=bcg_x, sgnf=sgnf_lev,
  n=50)

# Runs the methods based on generalised principles via an
# adjustment for the unknown heteroscedasticity.  Use n=1000 in an
# actual analysis instead!!
bcg_s <- bcg$size
g3 <- metagenGeneralised(y=bcg_y, d=bcg_d, x=bcg_x, sgnf=0.025,
  s=bcg_s, n=50, adj=TRUE)
g4 <- metagenGeneralised(y=bcg_y, d=bcg_d, x=bcg_x, sgnf=sgnf_lev,
  s=bcg_s, n=50, adj=TRUE)

# The implementation can also handle the case in which
# a meta regression is planed with no intercept and only a
# single covariate (i.e. dim(x) = 1).  In this case,
# the design matrix can simply be provided by a vector.
# (This makes no sense in this example and shall only proves
# feasibility)
g5 <- metagenGeneralised(y=bcg_y, d=bcg_d, x=bcg$x, sgnf=0.025, n=50)

# When performing a meta analysis, provide the function
# with a vector of 1s.
g6 <- metagenGeneralised(y=bcg_y, d=bcg_d, x=rep(1,length(bcg_y)),
  sgnf=0.025, n=50)

if (!all(names(g1) == names(metagenEmpty()))) stop("Name clash")
if (!all(names(g2) == names(metagenEmpty()))) stop("Name clash")
if (!all(names(g3) == names(metagenEmpty()))) stop("Name clash")
if (!all(names(g4) == names(metagenEmpty()))) stop("Name clash")
if (!all(names(g5) == names(metagenEmpty()))) stop("Name clash")
if (!all(names(g6) == names(metagenEmpty()))) stop("Name clash")

metagen documentation built on May 29, 2017, 7:13 p.m.