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

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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.