Last data update: 2014.03.03

R: determines a cutoff threshold
getcutoffR Documentation

determines a cutoff threshold

Description

Determines an empirical cutoff value for statistics generated from a Monte Carlo simulation.

Usage

  getcutoff(stat, alpha, reverse)

Arguments

stat

a vector containing statistics sampled from a Monte Carlo simulation

alpha

a p-value specifying the quantile of the statistics to be determined, e.g., (alpha x 100)th percentile

reverse

if TRUE, the quantile is determined by (1-alpha)

Details

Calculates the quantile value of statistics sampled from a Monte Carlo simulation. For example, when alpha = 0.1 the function determines the 1st percentile of the statistics. Conversely, if reverse is True, the function determines the 99th percentile, i.e., (1-alpha) x 100.

Value

returns a scalar corresponding to the quantile of the statistics determined by alpha or (1-alpha)

Author(s)

Seung W. Choi <choi.phd@gmail.com>

See Also

montecarlo, permute

Examples

#top 1 percent
getcutoff(runif(1000),0.01,TRUE)
#bottom 1 percent
getcutoff(runif(1000),0.01,FALSE)

Results