Under the assumption of Hardy-Weinberg equilibrium, a SNP genotype is
a binomial variate with two trials for an autosomal SNP or with one or
two trials (depending on sex) for a SNP on the X chromosome.
With each SNP in an input
"SnpMatrix" as dependent variable, this function fits a
logistic regression model. The Hardy-Weinberg
assumption can be relaxed by use of a "robust" option.
1 2 3
The SNP data, as an object of class
An array describing the subset of observations to be considered
An array describing the subset of SNPs to be considered. Default action is to test all SNPs.
The data frame in which
An object giving parameters for the IRLS algorithm
fitting of the base model and for the acceptable aliasing amongst
new terms to be tested. See
The model fitted is the union of the
add.formula models, although parameter estimates (and their
variance-covariance matrix) are only
generated for the parameters of the latter.
The "robust" option causes a Huber-White "sandwich" estimate of the
variance-covariance matrix to be used in place of the usual inverse
second derivative matrix of the log-likelihood (which assumes
data argument is supplied, the
data objects are aligned by rowname. Otherwise all variables in
the model formulae are assumed to be stored in the same order as the
columns of the
An object of class
A factor (or
several factors) may be included as arguments to the function
strata(...) in the
base.formula. This fits all
interactions of the factors so included, but leads to faster
computation than fitting these in the normal way. Additionally, a
cluster(...) call may be included in the base model
formula. This identifies clusters of potentially correlated
observations (e.g. for members of the same family); in this case, an
appropriate robust estimate of the variance-covariance matrix of
parameter estimates is calculated. No more than one
strata() call may be used, and neither
cluster(...) calls may appear in the
If uncertain genotypes (e.g. as a result of imputation) are used, the interpretation of the regression coefficients is questionable.
A known bug is that the function fails when no
data argument is
supplied and the base model formula contains no variables
~1). A work-round is to create a data frame to hold the
variables in the models and pass this as
David Clayton [email protected]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
data(testdata) test1 <- snp.lhs.estimates(Autosomes[,1:10], ~cc, ~region, data=subject.data) test2 <- snp.lhs.estimates(Autosomes[,1:10], ~strata(region), ~cc, data=subject.data) test3 <- snp.lhs.estimates(Autosomes[,1:10], ~cc, ~region, data=subject.data, robust=TRUE) test4 <- snp.lhs.estimates(Autosomes[,1:10], ~strata(region), ~cc, data=subject.data, robust=TRUE) test5 <- snp.lhs.estimates(Autosomes[,1:10], ~region+sex, ~cc, data=subject.data, robust=TRUE) print(test1) print(test2) print(test3) print(test4) print(test5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.