Learn R Programming

HWxtest (version 1.0.5)

defaultHistobounds: Functions to plot a histogram of test statistic

Description

Running the function hwx.test, xtest or mtest can create data for a frequency distribution plot of one of the four test statistics. Then these functions can be used to make the plot. The user will not normally call these functions. Instead, they will be called by hwx.test provided histobins is positive.

Usage

defaultHistobounds(ostats, statID, m)

plotHistogram(ostats, statID, m, histobins, histobounds, histoData, showCurve = TRUE, color1 = "gray40", color2 = "lightcoral", ntrials = 0)

Arguments

ostats
Observed statistics for the 4 test measures, LLR, Prob, U and Chisq.
statID
Value 1-4 indicating which statistic to use for the plot.
m
A vector of the allele counts
histobins
the number of bins for the histogram
histobounds
The left and right boundary of the histogram x-axis
histoData
A vector of probabilities (or counts) returned from the xtest or mtest function
showCurve
Whether to draw a blue curve indicating the asymptotic distribution (if known)
color1
The color for outcomes fitting the null distribution better than the observed
color2
The color for outcomes deviating from the null at leasst as much as observed. Area of color2 is the P value.
ntrials
If greater than 0, this is the number of trials used in a Monte Carlo test.

Value

  • defaultHistobounds returns a vector containing the left and right boundaries for the x axis.

    plotHistogram does not return a value, but plots the histogram.

See Also

hwx.test