Package 'AUtests'

Title: Approximate Unconditional and Permutation Tests
Description: Performs approximate unconditional and permutation testing for 2x2 contingency tables. Motivated by testing for disease association with rare genetic variants in case-control studies. When variants are extremely rare, these tests give better control of Type I error than standard tests.
Authors: Arjun Sondhi, Ken Rice
Maintainer: Arjun Sondhi <[email protected]>
License: GPL-2
Version: 0.99
Built: 2024-10-31 06:50:36 UTC
Source: CRAN

Help Index


Firth AU testing

Description

Calculates approximate unconditional Firth test p-value for testing independence in 2x2 case-control tables. The Firth test requires significantly more computational time than the tests computed in the au.tests function.

Usage

au.firth(m0, m1, r0, r1, lowthresh = 1e-12)

Arguments

m0

Number of control subjects

m1

Number of case subjects

r0

Number of control subjects exposed

r1

Number of case subjects exposed

lowthresh

A threshold for probabilities below to be considered as zero. Defaults to 1e-12.

Value

A single AU p-value, computed under the Firth test.

Examples

au.firth(15000, 5000, 1, 0)

Stratified AU testing

Description

Calculates AU p-values for testing independence in 2x2 case-control tables, while adjusting for categorical covariates. Inputs are given as a vector of counts in each strata defined by the covariate(s). Note that computational time can be extremely high.

Usage

au.test.strat(m0list, m1list, r0list, r1list, lowthresh = 1e-12)

Arguments

m0list

Number of control subjects in each strata

m1list

Number of case subjects in each strata

r0list

Number of control subjects exposed in each strata

r1list

Number of case subjects exposed in each strata

lowthresh

A threshold for probabilities below to be considered as zero. Defaults to 1e-12.

Value

An AU p-value, computed under the likelihood ratio test.

Examples

au.test.strat(c(500, 1250), c(150, 100), c(0, 0), c(10, 5))

AU testing

Description

Calculates approximate unconditional p-values for testing independence in 2x2 case-control tables.

Usage

au.tests(m0, m1, r0, r1, lowthresh = 1e-12)

Arguments

m0

Number of control subjects

m1

Number of case subjects

r0

Number of control subjects exposed

r1

Number of case subjects exposed

lowthresh

A threshold for probabilities below to be considered as zero. Defaults to 1e-12.

Value

A vector of AU p-values, computed under score, likelihood ratio, and Wald tests.

Examples

au.tests(15000, 5000, 30, 25)
au.tests(10000, 10000, 30, 25)

Basic testing

Description

Calculates standard p-values for testing independence in 2x2 case-control tables.

Usage

basic.tests(m0, m1, r0, r1)

Arguments

m0

Number of control subjects

m1

Number of case subjects

r0

Number of control subjects exposed

r1

Number of case subjects exposed

Value

A vector of p-values, computed under score, likelihood ratio, Wald, Firth, and Fisher's exact tests.

Examples

basic.tests(15000, 5000, 30, 25)

Stratified permutation testing

Description

Calculates permutation p-values for testing independence in 2x2 case-control tables, while adjusting for categorical covariates. Inputs are given as a vector of counts in each strata defined by the covariate(s). Note that computational time can be extremely high.

Usage

perm.test.strat(m0list, m1list, r0list, r1list)

Arguments

m0list

Number of control subjects in each strata

m1list

Number of case subjects in each strata

r0list

Number of control subjects exposed in each strata

r1list

Number of case subjects exposed in each strata

Value

A permutation p-value, computed under the likelihood ratio test.

Examples

perm.test.strat(c(7000, 1000), c(11000, 1000), c(50, 30), c(70, 40))

Permutation testing

Description

Calculates permutation p-values for testing independence in 2x2 case-control tables.

Usage

perm.tests(m0, m1, r0, r1, lowthresh = 1e-12)

Arguments

m0

Number of control subjects

m1

Number of case subjects

r0

Number of control subjects exposed

r1

Number of case subjects exposed

lowthresh

A threshold for probabilities below to be considered as zero. Defaults to 1e-12.

Value

A vector of permutation p-values, computed under score, likelihood ratio, Wald, and Firth tests.

Examples

perm.tests(15000, 5000, 30, 25)