Package 'predictionInterval'

Title: Prediction Interval Functions for Assessing Replication Study Results
Description: A common problem faced by journal reviewers and authors is the question of whether the results of a replication study are consistent with the original published study. One solution to this problem is to examine the effect size from the original study and generate the range of effect sizes that could reasonably be obtained (due to random sampling) in a replication attempt (i.e., calculate a prediction interval). This package has functions that calculate the prediction interval for the correlation (i.e., r), standardized mean difference (i.e., d-value), and mean.
Authors: David Stanley
Maintainer: David Stanley <[email protected]>
License: MIT License + file LICENSE
Version: 1.0.0
Built: 2025-03-09 03:26:17 UTC
Source: https://github.com/dstanley4/predictioninterval

Help Index


Prediction Interval Functions

Description

A common problem faced by journal reviewers and authors is the question of whether the results of a replication study are consistent with the original published study. One solution to this problem is to examine the effect size from the original study and generate the range of effect sizes that could reasonably be obtained (due to random sampling) in a replication attempt (i.e., calculate a prediction interval).This package has functions that calculate the prediction interval for the correlation (i.e., r), standardized mean difference (i.e., d-value), and mean.

Details

Package: predictionInterval
Type: Package
Version: 1.0.0
Date: 2016-08-19
License: MIT License + file LICENSE

pi.r creates a prediction interval for a correlation (i.e., r )
pi.d creates a prediction interval for a standardized mean difference (i.e., d )
pi.m creates a prediction interval for a mean (i.e., M )

pi.r.demo demonstrates PI capture percentage for a correlation (i.e., r )
pi.d.demo demonstrates PI capture percentage for a standardized mean difference (i.e., d )
pi.m.demo demonstrates PI capture percentage for a mean (i.e., M )

Author(s)

Author: David J. Stanley [email protected]
Maintainer: David J. Stanley [email protected]

References

Spence, J.R. & Stanley, D.J.(in prep). Prediction Interval: What to expect when you're expecting a replication.


Also:

Cumming, G. & Maillardet, R. (2006). Confidence intervals and replication: where will the next mean fall? Psychological Methods, 11(3), 217-227.

Estes, W.K. (1997). On the communication of information by displays of standard error and confidence intervals. Psychonomic Bulleting & Review, 4(3), 330-341.

Zou, G.Y. (2007). Toward using a confidence intervals to compare correlations. Psychological Methods, 12(4), 399-413.

Examples

pi.r(r=.35,n=100,rep.n=200)
pi.d(d=.65,n1=50,n2=50,rep.n1=100,rep.n2=100)
pi.m(M=2.53,SD=1.02,n=40,rep.n=80)

d-value (i.e., standardized mean difference) Prediction Interval

Description

d-value (i.e., standardized mean difference) Prediction Interval

Usage

pi.d(d, n1, n2, rep.n1 = NA, rep.n2 = NA, prob.level = 0.95)

Arguments

d

Original study: Sample d-value (standardized mean difference) created with pooled variance denominator. See formulas 4.18 and 4.19 (p.26) in Borenstein, Hedges, Higgins, & Rothstein (2009).

n1

Original study: Sample size for group 1

n2

Original study: Sample size for group 2

rep.n1

(optional) Replication study: Sample size for group 1. If not specified, n1 is used.

rep.n2

(optional) Replication study: Sample size for group 2. If not specified, n2 is used.

prob.level

(optional 0 to 1 value) Probability level desired (0 to 1). If not specified .95 (i.e., 95 percent) will be used.

Value

The prediction interval and related statistics in list format.

References

Borenstein, M., Hedges, L. V., Higgins, J. P., & Rothstein, H. R. (2009). Introduction to meta-analysis. John Wiley & Sons.

Cumming, G., & Finch, S. (2001). A primer on the understanding, use, and calculation of confidence intervals that are based on central and noncentral distributions. Educational and Psychological Measurement, 61(4), 532-574.

Examples

pi.d(d=.65,n1=50,n2=50,rep.n1=100,rep.n2=100)

Simulation to demonstrate the meaning of the d-value prediction interval

Description

Simulation to demonstrate the meaning of the d-value prediction interval

Usage

pi.d.demo(n1 = 50, n2 = 50, rep.n1 = NA, rep.n2 = NA, pop.d = 0.5,
  number.trials = 10000, prob.level = 0.95, bias.correction = FALSE)

Arguments

n1

Original study: Cell size 1

n2

Original study: Cell size 2

rep.n1

(optional) Replication study: Cell size 1. If not specified, n is used.

rep.n2

(optional) Replication study: Cell size 2. If not specified, n is used.

pop.d

All samples are drawn from a common population. This specifies the population correlation.

number.trials

Indicate the number of pairs of sample (original, replication) that should be used. 10,000 or higher suggested for stable results.

prob.level

(optional 0 to 1 value) Probability level desired (0 to 1). If not specified .95 (i.e., 95 percent) will be used.

bias.correction

Apply bias correction formula to d-values.

Value

The prediction interval capture percentage and related statistics in list format.

Examples

pi.d.demo(n1=50,n2=50,rep.n1=100,rep.n2=100,pop.d=.50,number.trials=10)

Prediction interval for the mean

Description

Prediction interval for the mean

Usage

pi.m(M, SD = NA, VAR = NA, n, rep.n = NA, prob.level = 0.95)

Arguments

M

Original study: Mean

SD

Original study: Standard deviation. Provide this or variance - not both.

VAR

Original study: Variance. Provide this or standard deviation - not both.

n

Original study: Sample size

rep.n

(optional) Replication study: Sample size. If not specified, n is used.

prob.level

(optional 0 to 1 value) Probability level desired (0 to 1). If not specified .95 (i.e., 95 percent) will be used.

Value

The prediction interval and related statistics in list format.

Examples

pi.m(M=2.53,SD=1.02,n=40,rep.n=80)

Simulation to demonstrate the meaning of the prediction interval for the mean

Description

Simulation to demonstrate the meaning of the prediction interval for the mean

Usage

pi.m.demo(n = 10, rep.n = NA, mu = 0, sigma = 1,
  number.trials = 10000, prob.level = 0.95, show.all.trials = FALSE)

Arguments

n

Original study: Sample size

rep.n

(optional) Replication study: Sample size. If not specified, n is used.

mu

All samples are drawn from a common population. This specifies the population correlation.

sigma

All samples are drawn from a common population. This specifies the population standard deviation.

number.trials

Indicate the number of pairs of sample (original, replication) that should be used. 10,000 or higher suggested for stable results.

prob.level

(optional 0 to 1 value) Probability level desired (0 to 1). If not specified .95 (i.e., 95 percent) will be used.

show.all.trials

Show original correlation, prediction interval, replication correlation, and whether replication effect is in the interval.

Value

The prediction interval capture percentage and related statistics in list format.

Examples

pi.m.demo(n=150,mu=0,sigma=1,number.trials=10)

Correlation prediction interval

Description

Correlation prediction interval

Usage

pi.r(r, n, rep.n = NA, prob.level = 0.95)

Arguments

r

Original study: Correlation

n

Original study: Sample size

rep.n

(optional) Replication study: Sample size. If not specified, n is used.

prob.level

(optional 0 to 1 value) Probability level desired (0 to 1). If not specified .95 (i.e., 95 percent) will be used.

Value

The prediction interval and related statistics in list format.

Examples

pi.r(r=.35,n=100,rep.n=200)

Simulation to demonstrate the meaning of the correlation prediction interval

Description

Simulation to demonstrate the meaning of the correlation prediction interval

Usage

pi.r.demo(n = 100, rep.n = NA, rho = 0.5, number.trials = 10000,
  prob.level = 0.95, bias.correction = FALSE)

Arguments

n

Original study: Sample size

rep.n

(optional) Replication study: Sample size. If not specified, n is used.

rho

All samples are drawn from a common population. This specifies the population correlation.

number.trials

Indicate the number of pairs of sample (original, replication) that should be used. 10,000 or higher suggested for stable results.

prob.level

(optional 0 to 1 value) Probability level desired (0 to 1). If not specified .95 (i.e., 95 percent) will be used.

bias.correction

Apply bias correction formula to d-values.

Value

The prediction interval capture percentage and related statistics in list format.

Examples

pi.r.demo(n=100,rho=.50,number.trials=10)