theta.k | R Documentation |
This function computes the population parameter THETA using the expected number of alleles.
theta.k(x, n = NULL, k = NULL)
x |
a vector or a factor. |
n |
a numeric giving the sample size. |
k |
a numeric giving the number of alleles. |
This function can be used in two ways: either with a vector giving the
individual genotypes from which the sample size and number of alleles
are derived (e.g., theta.k(x)
), or giving directly these two
quantities (e.g., theta.k(n = 50, k = 5)
).
The argument x
can be either a factor or a vector. If it is a
factor, then it is taken to give the individual alleles in the
population. If it is a numeric vector, then its values are taken to be
the numbers of each allele in the population. If it is a non-numeric
vector, it is a coerced as a factor.
Both arguments n
and k
must be single numeric values.
A numeric vector of length one with the estimated theta.
For the moment, no standard-error or confidence interval is computed.
Emmanuel Paradis
Ewens, W. J. (1972) The sampling theory of selectively neutral alleles. Theoretical Population Biology, 3, 87–112.
theta.h
, theta.s
, theta.tree
data(jaguar)
## compute frequencies:
S <- summary(jaguar)
## compute THETA for all loci:
sapply(S, function(x) theta.k(x$allele))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.