Illustrate graphically the most common Null Hypothesis Significance Testing procedures. More specifically, this package provides functions to plot Chi-Squared, F, t (one- and two-tailed) and z (one- and two-tailed) tests, by plotting the probability density under the null hypothesis as a function of the different test statistic values. Although highly flexible (color theme, fonts, etc.), only the minimal number of arguments (observed test statistic, degrees of freedom) are necessary for a clear and useful graph to be plotted, with the observed test statistic and the p value, as well as their corresponding value labels. The axes are automatically scaled to present the relevant part and the overall shape of the probability density function. This package is especially intended for education purposes, as it provides a helpful support to help explain the Null Hypothesis Significance Testing process, its use and/or shortcomings.
nhstplot is a simple and convenient package to represent graphically
the most common Null Hypothesis Significance Tests (NHST).
In other words, it plots the density functions of z, t, F and Chi-squared, adding a cutline at the observed statistic value, scaling it all conveniently, and plotting a label for the p value.
First, install the library with install.packages("nhstplot"), load the
library with library(nhstplot).
nhstplot is composed of 4 functions, one for each major NHST test
“family” :
plotchisqtest function)plotftest function)plotttest function)plotztest function)They all work quite the same (with minor differences, see the vignette for more info), with very few required arguments:
See the vignette for examples and options.
This package is neither for or against NHST. It’s meant to help explain the process, should you want to explain it. A lot of students (and scholars) have no choice but to read articles with (p) values, so they might as well have a better understanding of what it is and what it’s not anyway, right?