Learn R Programming

gtx (version 0.0.8)

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

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

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.

Value

The non-centrality parameter.

Details

See the examples.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab