UM.suff: Sufficient statistics for the Unconstrained-Multinomial model

Description Usage Arguments Value Examples

Description

Converts a matrix or data.frame of genotype data into the sufficient statistics required to fit a Dirichlet-Multinomial hierarchical model.

Usage

1
UM.suff(X, popId)

Arguments

X

Genotype adata. Either a N x 4 matrix with NA's indicating duplicates or a N x 5 column data.frame with the first column being the popId.

popId

grouping variable for X. Must be supplied if X has 4 columns.

Value

A list with elements:

Examples

1
2
3
4
5
6
7
8
# sufficient statistics in 3 lakes

X <- fish215[fish215$Lake %in% c("Hogan", "Manitou", "Simcoe"),]
suff <- UM.suff(X)

suff$A # allele names
suff$G # unique genotypes
suff$tab # contingency table

MADPop documentation built on May 1, 2019, 6:47 p.m.