r2_Wf: Expected r2 between inbreeding level (f) and fitness (W)
Description
Expected r2 between inbreeding level (f) and fitness (W)
Usage
r2_Wf(genotypes, trait, family = "gaussian", type = c("msats", "snps"))
Arguments
genotypes
data.frame with individuals in rows and loci in columns,
containing genotypes coded as 0 (homozygote), 1 (heterozygote) and NA (missing)
trait
vector of any type which can be specified in R's glm() function
family
distribution of the trait. Default is gaussian. For other distributions, just naming the distribution
(e.g. binomial) will use the default link function (see ?family). Specifying another
link function can be done in the same way as in the glm() function
type
specifies g2 formula to take. Type "snps" for large datasets and "msats" for smaller datasets.
Value
callfunction call.
exp_r2_fullexpected r2 between inbreeding and sMLH for the full dataset
nobsnumber of observations
nlocnumber of markers
References
Slate, J., David, P., Dodds, K. G., Veenvliet, B. A., Glass, B. C., Broad, T. E., & McEwan, J. C. (2004).
Understanding the relationship between the inbreeding coefficient
and multilocus heterozygosity: theoretical expectations and empirical data. Heredity, 93(3), 255-265.
Szulkin, M., Bierne, N., & David, P. (2010). HETEROZYGOSITY-FITNESS CORRELATIONS: A TIME FOR REAPPRAISAL.
Evolution, 64(5), 1202-1217.