This is a engage post for a series of blog posts about understanding hypothesis tests. In this series, I create a graphical equivalent to a 1-sample t-test and confidence interval to help you understand how it works more intuitively.
This post focuses entirely on the steps required to create the graphs. It’s a fairly technical and task-oriented post designed for those who need to create the graphs for illustrative purposes. If you’d instead like to gain a better understanding of the concepts behind the graphs, please see the following posts:
To create the following graphs, we’ll use Minitab’s probability distribution plots in conjunction with several statistics obtained from the 1-sample t output. If you’d like more information about the formulas that are involved, you can find them in Minitab at: Help > Methods and Formulas > Basic Statistics > 1-Sample t.
The data for this example is FamilyEnergyCost and it is just one of the many data set examples that can be found in Minitab’s Data Set Library. We’ll perform the regular 1-sample t-test with a null hypothesis mean of 260, and then graphically recreate the results.
To create a graphical equivalent to a 1-sample t-test, we’ll need to graph the t-distribution using the correct number of degrees of freedom. For a 1-sample t-test, the degrees of freedom equals the sample size minus 1. So, that’s 24 degrees of freedom for our sample of 25.
You should see this graph.
This graph shows the distribution of t-values for a sample of our size with the t-values for the end points of the critical region. The t-value for our sample mean is 2.29 and it falls within the critical region.
For my blog posts, I thought displaying the x-axis in the same units as our measurement variable (energy costs) would make the graph easier to understand. To do this, we need to transform the x-axis scale from t-values to energy costs.
Transforming the t-values to energy costs for a distribution centered on the null hypothesis mean requires a simple calculation:
Energy Cost = Null Hypothesis Mean + (t-value * SE Mean)
We’ll use the null hypothesis value that we entered in the dialog box (260) and the SE Mean value that appears in the 1-sample t-test output (30.8). We need to calculate the energy cost values for all of the t-values that will appear on the x-axis (-4 to +4).
For example, a t-value of 1 equals 290.8 (260 + (1*30.8). Zero is the null hypothesis value, which is 260.
Next, we need to replace the t-values with the energy cost equivalents.
You should see this graph. To cleanup the x-axis, I had to delete the t-values that were still showing from before. Simply click each t-value once and press the Delete key.
Let’s add a reference line to show where our sample mean falls within the sampling distribution and critical region. The trick here is that the x-axis still uses t-values despite displaying the energy costs. We need to use the t-value for our sample mean that appears in the 1-sample t output (2.29).
After editing the title and the x-axis label, you should have a graph similar to the one below.
To do this, we’ll duplicate the graph we created above and then modify it. This allows us to reuse some of the work that we’ve already done.
You’ll need to edit the graph title and delete some extra numbers on the x-axis. After these edits, you should have a graph similar to this one.
To graphically recreate the confidence interval, we’ll need to start from scratch for this graph.
Your graph should look like this:
Like before, we’ll need to transform the x-axis into energy costs. For this graph, I’ll only display the x-values for the end points of the confidence interval and the sample mean. So, we need to convert the three t-values of -2.064, 0, 2.064.
The equation to transform the t-values to energy costs for a distribution centered on the sample mean is:
Energy Cost = Sample Mean + (t-score * SE Mean)
We obtain the following rounded values that represent the lower confidence limit, sample mean, and upper confidence limit: 267, 330.6, 394.
Simply double click the values in the x-axis to edit each individual label. Replace the t-value with the energy cost value. After editing the graph title, you should have a visual representation of the confidence interval that looks like this. I rounded the values for the confidence limits.
When I create multiple graphs that involve many steps, I generally use Minitab's command language. This may sound daunting if you're not familiar with using this command language. However, Minitab makes this easier for you.
After you create one graph, choose Editor > Copy Command Language, and paste it into a text editor, such as Notepad. Save the file with the extension *.mtb and you have a Minitab Exec file. This Exec file contains all of the edits you made. Now, you can easily create similar graphs simply by modifying the parts that you want to change.
You can also get help for the command language right in Minitab. First, make sure the command prompt is enabled by choosing Editor > Enable Commands. At the prompt, type help dplot, and Minitab displays the help specific to probability distribution plots!
To run an exec file, choose File > Other Files > Run an Exec. Click Select File and browse to the file you saved. Here are the MTB files for my graphs for the critical region, P value, and confidence interval.
Happy graphing!