pval_simu: Computing P-values with a Simulated Sample from the Null...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pval_simu.R

Description

This function computes the p-value of a statistic using a simulated sample from its theoretical null distribution.

Usage

1
pval_simu(s, theo_dist)

Arguments

s

the observation whose p-value is computed. For instance a Likelihood Ratio.

theo_dist

the sample of the distribution under the null hypothesis.

Value

The p-value associated to the observation s.

Author(s)

Boris P. Hejblum

See Also

rchisqmix

Examples

1
2
3
4
5
if(interactive()){
theo_dist <- rnorm(n=10000, mean=0, sd=1)
TcGSA:::pval_simu(s=1.96, theo_dist)
1-pnorm(q=1.96, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)
}

TcGSA documentation built on Jan. 24, 2020, 1:07 a.m.