Raw File
Tip revision: be291479202d9ca826914b9bf0fe0b8efa26e6c3 authored by Martin Lysy on 22 August 2022, 08:20:12 UTC
version 1.1.4
Tip revision: be29147
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/UM.suff.R
\title{Sufficient statistics for the Unconstrained-Multinomial model}
UM.suff(X, popId)
\item{X}{Genotype adata.  Either a \code{N x 4} matrix with \code{NA}'s indicating duplicates or a \code{N x 5} column data.frame with the first column being the \code{popId}.}

\item{popId}{grouping variable for \code{X}. Must be supplied if \code{X} has 4 columns.}
A list with elements:
\item \code{A}: Vector of unique alleles names.  The allele numbers in the following quantities correspond to the indices of \code{A}.
\item \code{G}: 4-column matrix of unique genotype combinations.  The presence of 0's indicates that less than four alleles were amplified indicating that a given genotype either has less than 4 distinct alleles or that some alleles are duplicated.
\item \code{tab}: Observed data in a simplified numerical format.  This is a contingency table with rows given by the unique elements of \code{popId} and columns given by each row of \code{G}.
Converts a matrix or data.frame of genotype data into the sufficient statistics required to fit a Dirichlet-Multinomial hierarchical model.
# 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
back to top