hlaAssocTest | R Documentation |
Perform statistical association tests via Pearson's Chi-squared test, Fisher's exact test and logistic regressions.
## S3 method for class 'hlaAlleleClass'
hlaAssocTest(hla, formula, data,
model=c("dominant", "additive", "recessive", "genotype"),
model.fit=c("glm"), prob.threshold=NaN, use.prob=FALSE, showOR=FALSE,
verbose=TRUE, ...)
## S3 method for class 'hlaAASeqClass'
hlaAssocTest(hla, formula, data,
model=c("dominant", "additive", "recessive", "genotype"),
model.fit=c("glm"), prob.threshold=NaN, use.prob=FALSE, showOR=FALSE,
show.all=FALSE, verbose=TRUE, ...)
hla |
an object of |
formula |
an object of class |
data |
an optional data frame, list or environment containing the
variables in the model. If not found in |
model |
dominant, additive, recessive or genotype models:
|
model.fit |
"glm" – generalized linear regression |
prob.threshold |
the probability threshold to exclude individuals with low confidence scores |
use.prob |
if |
showOR |
show odd ratio (OR) instead of log OR if |
show.all |
if |
verbose |
if TRUE, show information |
... |
optional arguments to |
model | description (given a specific HLA allele h) |
dominant | [-/-] vs. [-/h,h/h] (0 vs. 1 in design matrix) |
additive | [-] vs. [h] in Chi-squared and Fisher's exact test, the allele dosage in regressions (0: -/-, 1: -/h, 2: h/h) |
recessive | [-/-,-/h] vs. [h/h] (0 vs. 1 in design matrix) |
genotype | [-/-], [-/h], [h/h] (0 vs. 1 in design matrix) |
In allelic associations, Chi-squared and Fisher exact tests are preformed on the cross tabulation, which is constructed according to the specified model (dominant, additive, recessive and gneotype).
In amino acid associations, Fisher exact test is performed on a cross tabulation with the numbers of each amino acid stratified by response variable (e.g., disease status).
In linear and logistic regressions, 95% confidence intervals are
calculated based on asymptotic normality. The option use.prob=TRUE
might
be useful in the sensitivity analysis.
Return a data.frame
with
[-] |
the number of haplotypes not carrying the specified HLA allele |
[h] |
the number of haplotype carrying the specified HLA allele |
%.[-] , ... |
case/disease proportion in the group [-], ... |
[-/-] |
the number of individuals or haplotypes not carrying the specified HLA allele |
[-/h] |
the number of individuals or haplotypes carrying one specified HLA allele |
[-/h] |
the number of individuals or haplotypes carrying two specified HLA alleles |
[-/h , h/h] |
the number of individuals or haplotypes carrying one or two specified HLA alleles |
[-/- , -/h] |
the number of individuals or haplotypes carrying at most one specified HLA allele |
%.[-/-] , ... |
case/disease proportion in the group [-/-], ... |
avg.[-/-] , ... |
outcome average in the group [-/-], ... |
chisq.st |
the value the chi-squared test statistic |
chisq.p |
the p-value for the Chi-squared test |
fisher.p |
the p-value for the Fisher's exact test |
h.est |
the coefficient estimate of HLA allele |
h.25% , h.75% |
the 95% confidence interval for HLA allele |
h.pval |
p value for HLA allele |
Xiuwen Zheng
hlaConvSequence
, summary.hlaAASeqClass
hla.id <- "A"
hla <- hlaAllele(HLA_Type_Table$sample.id,
H1 = HLA_Type_Table[, paste(hla.id, ".1", sep="")],
H2 = HLA_Type_Table[, paste(hla.id, ".2", sep="")],
locus=hla.id, assembly="hg19")
set.seed(1000)
n <- nrow(hla$value)
dat <- data.frame(case = c(rep(0, n/2), rep(1, n/2)), y = rnorm(n),
pc1 = rnorm(n))
hlaAssocTest(hla, case ~ 1, data=dat)
hlaAssocTest(hla, case ~ 1, data=dat, model="additive")
hlaAssocTest(hla, case ~ 1, data=dat, model="recessive")
hlaAssocTest(hla, case ~ 1, data=dat, model="genotype")
hlaAssocTest(hla, y ~ 1, data=dat)
hlaAssocTest(hla, y ~ 1, data=dat, model="genotype")
hlaAssocTest(hla, case ~ h, data=dat)
hlaAssocTest(hla, case ~ h + pc1, data=dat)
hlaAssocTest(hla, case ~ h + pc1, data=dat, showOR=TRUE)
hlaAssocTest(hla, y ~ h, data=dat)
hlaAssocTest(hla, y ~ h + pc1, data=dat)
hlaAssocTest(hla, y ~ h + pc1, data=dat, showOR=TRUE)
hlaAssocTest(hla, case ~ h, data=dat, model="additive")
hlaAssocTest(hla, case ~ h, data=dat, model="recessive")
hlaAssocTest(hla, case ~ h, data=dat, model="genotype")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.