hwde {hwde}R Documentation

Fit relevant models, and test for various types of departure from Hardy-Weinberg equilibrium. Allows only 2 alleles per locus. The number of loci is arbitrary.

Description

Fits models for genotypic disequilibria, as described in Huttley and Wilson (2000), Weir (1996) and Weir and Wilson (1986).

Usage

hwde(data = hwde::IndianIrish, gp = "Population", termlist = NULL, refmodel = NULL,
loci = paste("locus", 1:(dim(data)[2] - 1), sep = ""), observed = "Observed",
keep.models = FALSE, aovtable.print = TRUE, group.terms = TRUE, allele.chars = letters)

Arguments

data

Must have a column of frequencies, by default called Observed, and one or more columns giving genotype information, in the form AA, Aa, aa. or e.g., MM, MN, NN. (The choice of letters is arbitrary.) Additionally, there may be a column that gives information on groupings, by default called Population.

gp

Gives the name of the column, if any, that has information on groups within the data.

termlist

Use to specify a user-defined sequence of models. See the vignette hwde.pdf or hwde.html

refmodel

For each model in termlist, specifies a reference model, which will be updated to include the additional terms.

loci

Gives name(s) of columns that hold information on genotypes. By default, these are taken to be locus1, locus2, etc.

observed

Name (by default Observed) of the column that holds the frequenceies.

keep.models

Should a list be returned that holds the full sequence of models that were fitted?

aovtable.print

Should the anova table be printed?

group.terms

Should model terms be grouped according to hierarchy, for the anova table?

allele.chars

A sequence of letters used to code for the loci. By default a, b, c, ... are used

Details

See the document hwde.pdf or hwde.html for details. See the references (below) for information on the interpretation of model parameters.

Value

anovatab

anova (analysis of deviance) table

data.df

Data, and contrasts used in fitting the various models.

aovtab.terms

This string holds, for each model that is fitted. the terms that have appeared in the model formula. The text strings for the distinct models are concatenated.

models

Optionally, this holds the complete sequence of qmodel objects that were fitted

Author(s)

J.H. Maindonald

References

1. Huttley, G.A. and Wilson, S.R. 2000. Testing for concordant equilibria between population samples. Genetics 156:2127-2135.
2. Weir, B.S. 1996. Genetic Data Analysis II. Sinauer.
3. Weir, B.S. and Wilson, S.R. 1986. Log-linear models for linked loci. Biometrics 42:665-670.

See Also

make.contrasts, decode.genotypes

Examples

data(IndianIrish)
hwde(data=IndianIrish)
data(mendelABC)
hwde(data=mendelABC, loci=c("seedshape", "cotylcolor", "coatcolor"))

[Package hwde version 0.67-3 Index]