Learn R Programming

SNPassoc (version 1.0-2)

tableHWE: Test for Hardy-Weinberg Equilibrium

Description

Test the null hypothesis that Hardy-Weinberg equilibrium holds in cases, controls and both populations.

Usage

tableHWE(x, strata)
print.tableHWE(x, digits=4, sig=0.05, na="-", ...)

Arguments

x
an object of class 'setupSNP'
strata
a factor variable for a stratified analysis
digits
number of significant digits, see 'print.default'
sig
significance level in the flag column
na
character string (or 'NULL') indicating 'NA' values in printed output, see 'print.default
...
further arguments passed to or from other methods

Value

  • A matrix with p values for Hardy-Weinberg Equilibrium

Details

This function calculates the HWE test for those variables of class 'snp' in the object x of class 'setupSNP'

References

Wigginton JE, Cutler DJ and Abecasis GR (2005). A note on exact tests of Hardy-Weinberg equilibrium. Am J Hum Genet 76:887-93

See Also

setupSNP

Examples

Run this code
data(SNPs)
ans<-setupSNP(SNPs,6:40,sep="")
res<-tableHWE(ans)
print(res)
#change the significance level showed in the flag column
print(res,sig=0.001)


#stratified analysis
res<-tableHWE(ans,ans$sex)
print(res)

Run the code above in your browser using DataLab