Crohns additive test of association with rs11957134

m = matrix(c(341,395,3151,5467),nrow=2)
row.names(m) = c("crohns","control")
colnames(m) = c("A","G")
print(m)
##           A    G
## crohns  341 3151
## control 395 5467
chisq.test(m)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  m
## X-squared = 27.242, df = 1, p-value = 1.795e-07
fisher.test(m)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  m
## p-value = 2.287e-07
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  1.283301 1.747461
## sample estimates:
## odds ratio 
##   1.497685

example when chi2 approximation fails

m = matrix(c(11,0,31,54),nrow=2)
row.names(m) = c("crohns","control")
colnames(m) = c("A","G")
print(m)
##          A  G
## crohns  11 31
## control  0 54
chisq.test(m)$p.value
## Warning in chisq.test(m): Chi-squared approximation may be incorrect
## [1] 0.0002390852
fisher.test(m)$p.value
## [1] 4.853876e-05
chisq.test(m)$p.value/fisher.test(m)$p.value
## Warning in chisq.test(m): Chi-squared approximation may be incorrect
## [1] 4.925656

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The source code is licensed under MIT.

Suggest changes

If you find any mistakes (including typos) or want to suggest changes, please feel free to edit the source file of this page on Github and create a pull request.

Citation

For attribution, please cite this work as

R package build (2021). L3-Crohns-Additive. BIOS 25328 Cancer Genomics Class Notes. /post/2021/02/18/l3-crohns-additive/

BibTeX citation

@misc{
  title = "L3-Crohns-Additive",
  author = "R package build",
  year = "2021",
  journal = "BIOS 25328 Cancer Genomics Class Notes",
  note = "/post/2021/02/18/l3-crohns-additive/"
}