haplo.interaction {SNPassoc} | R Documentation |
Haplotype interaction with a covariate
Description
This function computes the ORs (or mean differences if a quantitative trait is analyzed) and their 95% confidence intervals corresponding to an interaction between the haplotypes and a categorical covariate
Usage
haplo.interaction(formula, data, SNPs.sel, quantitative =
is.quantitative(formula, data), haplo.freq.min = 0.05, ...)
Arguments
formula |
a symbolic description of the model to be fitted (a formula object).
It might have either a continuous variable (quantitative traits) or a
factor variable (case-control studies) as the response on the left of the |
data |
an object of class 'setupSNP' containing the variables in the model and the SNPs that will be used to estimate the haplotypes. |
SNPs.sel |
a vector indicating the names of SNPs that are used to estimate the haplotypes |
quantitative |
logical value indicating whether the phenotype (which is on the
left of the operator |
haplo.freq.min |
control parameter for haplo.glm included in 'haplo.glm.control'. This parameter corresponds to the minimum haplotype frequency for a haplotype to be included in the regression model as its own effect. The haplotype frequency is based on the EM algorithm that estimates haplotype frequencies independently of any trait. |
... |
additional parameters for 'haplo.glm.control'. |
Details
The function estimates the haplotypes for the SNPs indicated in the 'SNPs.sel' argument. Then, usign 'haplo.glm' function (from 'haplo.stats' library) estimates the interaction between these haplotypes and the covariate indicated in the formula by means of 'interaction' function.
Value
Three different tables are given. The first one corresponds to the full interaction matrix where the ORs (or mean differences if a quantitative trait is analyzed) are expressed with respect to the most frequent haplotype and the first category of the covariate. The other two tables show the ORs (or mean differences if a quantitative trait is analyzed) and their 95% confidence intervals for both marginal models. P values for interaction are also showed in the output.
Examples
# not Run
library(SNPassoc)
library(haplo.stats)
data(SNPs)
datSNP<-setupSNP(SNPs,6:40,sep="")
res <- haplo.interaction(log(protein)~int(sex), data=datSNP,
SNPs.sel=c("snp100019","snp10001","snp100029"))
res