Learn R Programming

pedtools (version 2.10.0)

expectedHomozygosity: Expected homozygosity and heterozygosity

Description

Computes the expected homozygosity and heterozygosity for a marker from its allele frequencies. The homozygosity is \(\sum_i p_i^2\) and the heterozygosity is one minus this.

Usage

expectedHomozygosity(p)

expectedHeterozygosity(p)

Value

A numeric value giving the expected homozygosity or heterozygosity.

Arguments

p

A numeric vector of allele frequencies, or a marker object (from which the frequencies are extracted with afreq()).

Examples

Run this code
p = c(0.2, 0.5, 0.3)
expectedHomozygosity(p)
expectedHeterozygosity(p)

Run the code above in your browser using DataLab