# pi.r.demo: Simulation to demonstrate the meaning of the correlation... In predictionInterval: Prediction Interval Functions for Assessing Replication Study Results

## Description

Simulation to demonstrate the meaning of the correlation prediction interval

## Usage

 ```1 2``` ```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

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

### Example output

```Population correlation: 0.50

Original sample size: 100
Replication sample size: 100

95% Prediction interval capture percentage: 100.0% (10 of 10 trials)
95% Confidence interval capture percentage: 80.0% (8 of 10 trials)

Illustrative Trials:

n    r ci.LL ci.UL rep.n pi.LL pi.UL rep.r rep.r.in.ci rep.r.in.pi
100 0.52  0.36  0.36   100  0.31  0.72  0.37        TRUE        TRUE
100 0.48  0.31  0.31   100  0.26  0.69  0.55        TRUE        TRUE
100 0.46  0.29  0.29   100  0.24  0.68  0.39        TRUE        TRUE
100 0.60  0.46  0.46   100  0.42  0.78  0.57        TRUE        TRUE
100 0.51  0.35  0.35   100  0.30  0.72  0.46        TRUE        TRUE

Note: n = original sample size, r = original correlation,
ci.LL = lower-limit confidence interval, ci.UL = upper-limit confidence interval, rep.n = replication sample size,
pi.UL = lower-limit prediction interval, pi.UL = upper-limit prediction interval,
rep.r = replication correlation.
```

predictionInterval documentation built on May 1, 2019, 10:13 p.m.