Description Usage Arguments Details Value Author(s) References See Also Examples
prop_variance
returns a vector of squared correlation coefficients representing the
proportion of variation captured by the specified covariance model at each locus.
1 | prop_variance(model, Y)
|
model |
an object of class 'tfa' adjusted with |
Y |
an nxp numeric matrix containing genetic information for n individuals recorded in p columns. Genetic information could be encoded by any numeric value, not necessarily an integer value. Missing data are not allowed. The matrix should have the same number of rows as in the adjusted model. |
This function requires that a preliminary model has been adjusted with K factors, where K is the number of source populations.
A vector of probabilities representing the proportion of variation captured the specified covariance model at each locus.
Olivier Francois, olivier.francois@univ-grenoble-alpes.fr
François, O., Liégeois, S., Demaille, B., Jay, F. (2019). Inference of population genetic structure from temporal samples of DNA. bioRxiv, 801324. https://www.biorxiv.org/content/10.1101/801324v3
François, O., Jay, F. (2020). Factor analysis of ancient population genomic samples. Under review.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(tfa)
# Ancient DNA from Bronze Age Great Britain samples
data(england_ba)
attach(England_BA)
# Remove HG from Serbia to keep k = 2 ancestral populations
age2 <- age[meta$Group.ID != "Serbia_HG"]
geno2 <- genotype[meta$Group.ID != "Serbia_HG",]
# Adjust an FA model
mod <- tfa(age2,
geno2,
k = 2,
lambda = 5e-2,
center = TRUE)
r_squared <- prop_variance(mod, geno2)
summary(r_squared)
hist(r_squared, col = "darkviolet")
detach(England_BA)
# rm(list = ls())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.