Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rowHWEs

Rowwise Test for Hardy-Weinberg Equilibrium


Description

Tests for each row of a matrix whether the Hardy-Weinberg Equilibrium holds for the SNP represented by the row.

Usage

rowHWEs(x, levels = 1:3, affy = FALSE, check = TRUE)

Arguments

x

a matrix in which each row represents a SNP and each column a subject, where the SNPs can take the values specified by levels. NAs are allowed.

levels

a vector of length three specifying the values with which the three genotypes of each SNP are represented. It is assumed that the second element of levels represents the heterozygous genotype, whereas the first and the third element represent the homozygous genotypes. Ignored if affy = TRUE.

affy

logical specifying whether the SNPs in x are coded as in the Affymetrix standard output. If TRUE, levels = c("AA", "AB", "BB") will be used.

check

should some checks be done if, e.g., other than the specified levels are used in x? It is highly recommended to leave check = TRUE. Setting check = FALSE will reduce the computation time slightly.

Value

A list containing the values of the ChiSquare statistic for testing for deviation from HWE (stats) and the raw p-values (rawp) computed by employing the ChiSquare distribution with 1 degree of freedom.

Author(s)

Holger Schwender, holger.schwender@udo.edu


scrime

Analysis of High-Dimensional Categorical Data Such as SNP Data

v1.3.5
GPL-2
Authors
Holger Schwender, with a contribution of Arno Fritsch
Initial release
2018-12-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.