SmallTelescopes {RSmallTelescopes}R Documentation

Small Telescopes

Description

Estimate statistical power for point estimate of effect size plus the lower and upper bounds of a confidence interval.

Usage

SmallTelescopes(
  data,
  analysis,
  n.original,
  B.CI = 10000,
  CI.level = 0.9,
  B.power = 10000,
  alpha = 0.05,
  n.rows = 1,
  seed = 1
)

Arguments

data

Dataset (matrix).

analysis

Function to produce a p value and an effect size estimate.

n.original

The sample size of the original analysis (scalar).

B.CI

The number of simulated samples used to construct CI (scalar); default = 10,000.

CI.level

The confidence level of the interval (scalar); default = .90.

B.power

The number of samples to be simulated (scalar); default = 10,000.

alpha

Set alpha level for analysis (scalar); default = 0.05.

n.rows

The number of rows per subject in the dataset (scalar); default = 1.

seed

Allows randomly generated numbers to be reproducible (scalar); default = 1.

Value

Displays statistical power for point estimate of an effect size plus the lower and upper bounds of a confidence interval. List contains the following components:

n.replication

The sample size of the replication analysis.

n.original

The sample size of the original analysis.

B.CI

The number of simulated samples used to construct CI.

CI.level

The confidence level of the interval.

B.power

The number of samples simulated.

p.value

The p value calculated from the replication data

es.estimate

Point estimate of effect size.

es.power

Estimated power for the point estimate of effect size.

CI.lower.estimate

Effect size estimate at the lower bound of the CI.

CI.lower.power

Estimated power for the lower bound of the CI.

CI.upper.estimate

Effect size estimate at the upper bound of the CI.

CI.upper.power

Estimated power for the upper bound of the CI.

Examples

# create or import dataset
 example.data <- matrix(rnorm(50), 25, 2)

# conduct empirical small telescopes analysis
 SmallTelescopes(
   data = example.data, 
   analysis = function(data) {
     corr <- cor.test(data[,1], data[,2])
     return(list(effect.size = corr$estimate, p.value = corr$p.value))
   }, 
   n.original = 10, 
   B.CI = 100, 
   B.power = 100)

[Package RSmallTelescopes version 1.0.4 Index]