Learn R Programming

HWxtest (version 1.1.9)

defaultHistobounds: Functions to plot a histogram of test statistic

Description

Running the function hwx.test can create data for a frequency distribution plot of one of the four test statistics provided the parameter histobins is positive. These plotting data are contained within the “hwtest” object generated by hwx.test. When that object is printed, a plot is drawn by ggplot2. If the user wishes to capture the ggplot2 results, such as to use in making a composite figure, the “gg” object can be obtained by calling makeHistogram.

Usage

defaultHistobounds(ostats, statID, m)

makeHistogram(x, curveColor = "blue", color1 = "gray40", color2 = "lightcoral")

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

vector of allele counts

x

output from hwx.test

curveColor

color for the asymptotic distribution curve

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.

Value

defaultHistobounds returns a vector containing the left and right boundaries for the x axis. This function is not normally called by the user

makeHistobram A graphic object of class “gg” or “ggplot” from ggplot2.

See Also

hwx.test