Description Usage Arguments Examples
Get residuals coming from a distribution with a given set of parameters
1 | getError(H2, freqs, means, ninds)
|
H2 |
Heritability |
freqs |
Allele frequencies |
means |
Phenotype means per genotype |
ninds |
Number of individuals |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (H2, freqs, means, ninds)
{
if (length(freqs) < 3) {
freqs[3] <- 0
}
VG <- freqs[1] * (means[1])^2 + freqs[2] * (means[2])^2 +
freqs[3] * (means[3])^2
sigmaSq <- (VG - H2 * VG)/H2
error <- rnorm(ninds, 0, sqrt(sigmaSq))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.