pcrit: Calculate pcrit

Description Usage Arguments Examples

View source: R/pcrit function.r

Description

This function calculates pcrit, a statistic discussed in Sagarin, Ambler, and Lee's (2014, Perspectives on Psychological Science, 9, 293-304) "An Ethical Approach to Peeking at Data".

Usage

1
pcrit(ns, pmax = 1, pdesired = 0.05, slices = 1000, tails = 2)

Arguments

ns

refers to a vector of sample sizes that indicate the initial number of participants run (N1) followed by the number of participants in the first round of augmentation (N2), the number of participants in the second round of augmentation (N3), etc.

pmax

refers to the maximum p-value in the data collected thusfar such that the researcher would augment the sample with additional participants.

pdesired

refers to the desired Type I error rate (typically .05).

slices

refers to the number of slices to divide the probability distribution (higher numbers of slices will make the calculations slower but more precise).

tails

refers to whether the tests are one- or two-tailed.

Examples

1
2
pcrit(c(200,150,50), pmax = .2, pdesired = .05, slices = 1000, tails = 2)
pcrit()

ianhussey/ethicalpeeking documentation built on May 18, 2019, 1:28 a.m.