Dprime {ldsep} | R Documentation |
Get the standardized composite D'.
Description
This function will either standardize by the maximum covariance conditional on the marginal genotype distribution, or by the maximum covariance conditional on the marginal allele frequencies.
Usage
Dprime(qmat, type = c("allele", "geno"), constrain = FALSE)
Arguments
qmat |
The observed joint genotype distribution. |
type |
Should we condition on the marginal genotype distribution
( |
constrain |
A logical. This option is only applicable when
|
Details
Note that when type = "allele"
and constrain = FALSE
,
the resulting D' is constrained to fall between -K and K, where
K is the ploidy of the species. However, under HWE, this measure is
equal to haplotypic D'. Using constrain = TRUE
will result
in a measure that is constrained to lie between -1 and 1, but
it will not equal haplotypic D' under HWE.
Using type = "geno"
is its own thing and will not equal
D' generally under HWE. When type = "geno"
, then the
the constrain
parameter has no effect.
Value
A vector of length 2. The first element is the estimated D'. The second element is the normalization used.
Author(s)
David Gerard
Examples
K <- 6
qmat <- matrix(stats::runif((K+1)^2), nrow = K+1)
qmat <- qmat / sum(qmat)
Dprime(qmat, type = "geno")
Dprime(qmat, type = "allele")