Description Usage Arguments Details Value Note Author(s) References Examples
Probability of observing all alleles with a given frequency in a sample of a specified size.
1 |
freq |
(Minimum) Allele frequency (required) |
N |
Number of sampled genotypes |
missprob |
Desired maximum probability of failing to observe an allele. |
tol |
Omit computation for terms which contribute less than this value. |
maxN |
Largest value to consider when searching for N. |
maxiter |
Maximum number of iterations to use when searching for N. |
showiter |
Boolean flag indicating whether to show the iterations performed when searching for N. |
If freq
and N
are provided, but missprob
is omitted,
this function computes the probability of failing to observe all alleles
with true underlying frequency freq
when N
diploid
genotypes are sampled. This is accomplished using the sum provided in
Corollary 2 of Gregorius (1980), omitting terms which contribute less
than tol
to the result.
When freq
and missprob
are provide, but N
is
omitted. A binary search on the range of [1,maxN
] is performed
to locate the smallest sample size, N
, for which the
probability of failing to observe all alleles with true
underlying frequency freq
is at most missprob
. In this
case, maxiter
specifies the largest number of iterations to use
in the binary search, and showiter
controls whether the
iterations of the search are displayed.
A list containing the following values:
call |
Function call used to generate this object. |
method |
One of the strings, "Compute missprob given N and freq", or "Determine minimal N given missprob and freq", indicating which type of computation was performed. |
retval$freq |
Specified allele frequency. |
retval$N |
Specified or computed sample size. |
retval$missprob |
Computed probability of failing to observe all
of the alleles with frequency |
This code produces sample sizes that are slightly larger than those
given in table 1 of Gregorius (1980). This appears to be due to
rounding of the computed missprob
s by the authors of that
paper.
Code submitted by David Duffy davidD@qumr.edu.au, substantially enhanced by Gregory R. Warnes warnes@bst.rochester.edu.
Gregorius, H.R. 1980. The probability of losing an allele when diploid genotypes are sampled. Biometrics 36, 643-652.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.