chi2ncp: 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
2
chi2ncp(alpha, beta, df = 1)
chi2power(alpha, ncp, df = 1)

Arguments

alpha

Test size; required tail area for central chi squared distribution.

beta

Test power; required tail area for non-central chi squared distribution.

df

Degrees of freedom for both chi squared distributions.

ncp

Non-centrality parameter

Details

See the examples.

Value

chi2ncp returns the non-centrality parameter (ncp) for given alpha and beta. chi2power returns the power (beta) for given alpha and ncp.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
3
4
5
6
7
8
## NCP needed to have 0.80 power for a 0.05 size test
chi2ncp(.05, .8)
## NCP needed to have 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)
chi2power(5e-08, ncp = chi2ncp(5e-08, .8))

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.