Learn R Programming

hwde (version 0.2)

hwde: 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 = 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 b
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

Value

  • anovatabanova (analysis of deviance) table
  • data.dfData, and contrasts used in fitting the various models.
  • aovtab.termsThis 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.
  • modelsOptionally, this holds the complete sequence of qmodel objects that were fitted

Details

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

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

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

Run the code above in your browser using DataLab