pred_int: Compute prediction interval for replication study given...

Description Usage Arguments Examples

View source: R/Replicate.R

Description

Given point estimates and their variances for one or multiple original studies and one or more replication studies, returns a vector stating whether each replication estimate is in its corresponding prediction interval. Assumes no heterogeneity.

Usage

1
pred_int(yio, vio, yir = NULL, vir, level = 0.95)

Arguments

yio

Effect estimate in the original study. Can be a vector for multiple original studies.

vio

Estimated variance of effect estimate in the original study (i.e., its squared standard error). Can be a vector for multiple original studies.

yir

Effect estimate in the replication study. Can be a vector for multiple replication studies. Can be omitted, in which case function returns only the prediction interval.

vir

Estimated variance of effect estimate in the replication study (i.e., its squared standard error). Can be a vector for multiple replication studies.

level

Coverage level of prediction interval. Typically 0.95.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# calculate prediction interval for a single replication study
pred_int( yio = 1, vio = .5, yir = 0.6,
vir = .2 )

# calculate prediction intervals for a one-to-one design
pred_int( yio = c(1, 1.3), vio = c(.01, .6),
yir = c(.6, .7), vir = c(.01,.3) )

# no need to pass yir if you only want the intervals
pred_int( yio = c(1, 1.3), vio = c(.01, .6),
vir = c(.01,.3) )

# calculate prediction intervals for a many-to-one design
pred_int( yio = c(1), vio = c(.01), yir = c(.6, .7), vir = c(.01,.3) )

Example output

$int.lo
[1] -0.6398235

$int.hi
[1] 2.639824

$rep.inside
[1] TRUE

$int.lo
[1]  0.7228192 -0.5593851

$int.hi
[1] 1.277181 3.159385

$rep.inside
[1] FALSE  TRUE

$int.lo
[1]  0.7228192 -0.5593851

$int.hi
[1] 1.277181 3.159385

$rep.inside
[1] NA

$int.lo
[1]  0.72281924 -0.09126176

$int.hi
[1] 1.277181 2.091262

$rep.inside
[1] FALSE  TRUE

Replicate documentation built on Dec. 1, 2019, 1:14 a.m.