ncp: Compute non-centrality parameter of chi squared distribution.

Description Usage Arguments Details Value Author(s) Examples

Description

Computes the non-centrality parameter of chi squared distribution for specified alpha and beta, such that there is probability (power) beta of exceeding the critical value for probability (size) alpha for a central chi squared distribution

Usage

1
chi2ncp(alpha, beta, df = 1)

Arguments

alpha

Required tail area for central chi squared distribution.

beta

Required tail area for non-central chi squared distribution.

df

Degrees of freedom for both chi squared distributions.

Details

See the examples.

Value

The non-centrality parameter.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
3
4
5
6
7
## 0.80 power for 0.05 size test
chi2ncp(.05, .8)
## 0.80 power for genome-wide significance
chi2ncp(5e-08, .8)
## test
critval <- qchisq(5e-08, lower.tail = FALSE, df = 1)
pchisq(critval, ncp = chi2ncp(5e-08, .8), lower.tail = FALSE, df = 1)

Example output

Loading required package: survival
[1] 7.848861
[1] 39.60099
[1] 0.8000001

gtx documentation built on May 2, 2019, 5:08 a.m.