Learn R Programming

lordif (version 0.4.2)

getcutoff: determines a cutoff threshold

Description

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

Usage

getcutoff(stat, alpha, reverse)

Value

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

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)

Author

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

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.

See Also

montecarlo, permute

Examples

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

Run the code above in your browser using DataLab