getcutoff: determines a cutoff threshold

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/getcutoff.R

Description

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

Usage

1
  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

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

Example output

Loading required package: mirt
Loading required package: stats4
Loading required package: lattice
Loading required package: rms
Loading required package: Hmisc
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following objects are masked from 'package:base':

    format.pval, units

Loading required package: SparseM

Attaching package: 'SparseM'

The following object is masked from 'package:base':

    backsolve

[1] 0.9917575
[1] 0.006081911

lordif documentation built on May 2, 2019, 2:13 p.m.