Description Usage Arguments Details Value Note Author(s) See Also Examples
This function calculates Pearson correlation coefficients between columns of a
SnpMatrix
and columns of an ordinary matrix. The two matrices
must have the same number of rows. All valid pairs are used in the
computation of each correlation coefficient.
1 |
x |
An N by M |
y |
An N by P general matrix |
uncertain |
If |
This can be used together with xxt
and
eigen
to calculate standardized loadings in the principal
components
An M by P matrix of correlation coefficients
This version cannot handle X chromosomes
David Clayton dc208@cam.ac.uk
1 2 3 4 5 6 7 8 9 | # make a SnpMatrix with a small number of rows
data(testdata)
small <- Autosomes[1:100,]
# Calculate the X.X-transpose matrix
xx <- xxt(small, correct.for.missing=TRUE)
# Calculate the principal components
pc <- eigen(xx, symmetric=TRUE)$vectors
# Calculate the loadings in first 10 components */
loadings <- snp.cor(small, pc[,1:10])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.