Description Usage Arguments Details Value Note Author(s) References See Also Examples
This function carries out tests for association between phenotype and a series of single nucleotide polymorphisms (SNPs), within strata defined by a possibly confounding factor. SNPs are considered one at a time and both 1-df and 2-df tests are calculated. For a binary phenotype, the 1-df test is the Cochran-Armitage test (or, when stratified, the Mantel-extension test).
1 | single.snp.tests(phenotype, stratum, data = sys.parent(), snp.data, subset, snp.subset)
|
phenotype |
A vector containing the values of the phenotype |
stratum |
Optionally, a factor defining strata for the analysis |
data |
A dataframe containing the |
snp.data |
An object of class |
subset |
A vector or expression describing the subset of subjects
to be used in teh analysis. This is evaluated in the same
environment as the |
snp.subset |
A vector describing the subset of SNPs to be considered. Default action is to test all SNPs. |
Formally, the test statistics are score tests for generalized linear models with canonical link. That is, they are inner products between genotype indicators and the deviations of phenotypes from their stratum means. Variances (and covariances) are those of the permutation distribution obtained by randomly permuting phenotype within stratum.
The subset
argument can either be a logical vector of length
equal to the length of the vector of phenotypes, an integer vector
specifying positions in the data
frame, or a character vector
containing names of the selected rows in the data
frame. Similarly, the snp.subset
argument can be a logical,
integer, or character vector.
A dataframe, with columns
chi2.1df |
Cochran-Armitage type test for additive genetic component |
chi2.2df |
Chi-squared test for both additive and dominance components |
N |
The number of valid data points used |
The behaviour of this function for objects of class
X.snp.matrix
is as described by Clayton (2008). Males are
treated as homozygous females and corrected variance estimates are
used.
David Clayton david.clayton@cimr.cam.ac.uk
Clayton (2008) Testing for association on the X chromosome Biostatistics (In press)
1 2 3 4 5 6 7 | data(testdata)
results <- single.snp.tests(cc, stratum=region, data=subject.data,
snp.data=Autosomes, snp.subset=1:10)
summary(results)
# QQ plot - see help(qq.chisq)
qq.chisq(results$chi2.1df)
qq.chisq(results$chi2.2df)
|
chi2.1df chi2.2df p.1df p.2df
Min. :0.0963 Min. :0.8189 Min. :0.08984 Min. :0.1136
1st Qu.:0.7577 1st Qu.:1.0972 1st Qu.:0.23253 1st Qu.:0.2190
Median :1.0000 Median :1.5847 Median :0.31731 Median :0.4536
Mean :1.1903 Mean :2.1849 Mean :0.33322 Mean :0.4082
3rd Qu.:1.4253 3rd Qu.:3.2740 3rd Qu.:0.38406 3rd Qu.:0.5809
Max. :2.8773 Max. :4.3497 Max. :0.75631 Max. :0.6640
NA's :1 NA's :4 NA's :1 NA's :4
N
Min. :378.0
1st Qu.:396.2
Median :398.5
Mean :395.6
3rd Qu.:400.0
Max. :400.0
N omitted lambda
9.000000 0.000000 4.867221
N omitted lambda
6.00000 0.00000 6.69583
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.