zeroOneTable | R Documentation |
Make contingency tables for many binary outcomes and a binary covariate
zeroOneTable(EXPOSURE, phenotype)
EXPOSURE |
binary covariate (e.g., exposure). |
phenotype |
binary outcome (e.g., phenotype). |
Generates frequency and contingency tables for many binary outcomes (e.g., large number of phenotypes) and a binary covariate (e.g., drug exposure, genotypes) more efficiently.
t00 |
frequency for non-exposed group and non-case outcome. |
t01 |
frequency for non-exposed group and case outcome. |
t10 |
frequency for exposed group and non-case outcome. |
t11 |
frequency for exposed group and case outcome. |
Leena Choi leena.choi@vanderbilt.edu and Cole Beck cole.beck@vumc.org
## full example data data(dataPheWAS) demo.covariates <- c('id','exposure','age','race','gender') phenotypeList <- setdiff(colnames(dd), demo.covariates) tablePhenotype <- matrix(NA, ncol=4, nrow=length(phenotypeList), dimnames=list(phenotypeList, c("n.nocase.nonexp", "n.case.nonexp", "n.nocase.exp", "n.case.exp"))) for(i in seq_along(phenotypeList)) { tablePhenotype[i, ] <- zeroOneTable(dd[, 'exposure'], dd[, phenotypeList[i]]) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.