Description Usage Arguments Value References See Also

Given a set of genotype counts, `mtest`

examines a large number of possible outcomes with the same set of allele counts. For each table, it computes four test statistics and compares them with the observed values. It returns the total probability of all tables with test statistics as “extreme” or more so than the observed. It can also plot a histogram of one of the statitistics if `histobins`

is greater than zero. More about these four test statistics and other information can be found in the vignette. This function will not usually be called directly by the user. Instead, call `hwx.test`

with `method`

set to either “auto” or “monte”.

1 2 |

`c` |
A matrix containing the genotype counts. It should be a square matrix, but only the lower-left half is used. |

`ntrials` |
the number of random trials to perform |

`statName` |
can be “LLR”, “Prob”, “U”, or “Chisq” depending on which one is to be ploted. Note that P values for all four are computed regardless of which one is specified with this parameter. |

`histobins` |
If 0 no histogram is plotted. If 1 or |

`histobounds` |
A vector containing the left and right boundaries for the histogram's x axis. If you leave this as the default, |

`showCurve` |
whether to show a blue curve indicating the asymptotic (chi squared) distribution. This only works for |

`safeSecs` |
After this many seconds the calculation will be aborted. This is a safety valve to prevent attempts to compute impossibly large sets of tables. |

`detail` |
Determines how much detail is printed. If it is set to 0, nothing is printed (useful if you use |

`mtest`

returns a list components

`$ Pvalues` |
The four computed P values corresponding to the test statistics: |

`$ tableCount` |
placeholder |

`$ SE` |
Standard errors for the P values. These come from the binomial. |

`$ observed` |
The four observed statistics in the same order as above |

`$ ntrials` |
The number of tables examined during the calculation |

`$ genotypes` |
The input matrix of genotype counts |

`$ alleles` |
The allele counts |

`$ statID` |
Which test statistic was used if a histogram was plotted |

`$ histobins` |
If greater than zero, the number of bins to use for the histogram |

`$ histobounds` |
The lower and upper limits of the test statistic in the histogram |

`$ histoData` |
Vector of |

`$ showCurve` |
Whether the asymptotic curve should be plotted with the histogram |

The methods are described by Engels, 2009. **Genetics** 183:1431.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.