Hypothesis Test and ASTUDT

Return to the Main Math 160 Topics Chapter 9 page Revised November, 2013
Some images on this page have been generated via AsciiMathML.js.
For more information see: www.chapman.edu/~jipsen/asciimath.html.

This page is devoted to presenting an example of doing a hypothesis test and, in that process, presenting the use of the ASTUDT program as a replacement for the INVT program and as a calculator replacement for using a table of values.

The problem that we will examine here is to test, for a given population, the null hypothesis:

`H_0: mu=26`
against the alternative hypothesis:
`H_1: mu!=26`
We take a sample of 25 observations. From that sample we find that the sample standard deviation is `s_x=5.6` and the sample mean `barx=23.5`. We want to test the hypthesis with a significance level of 0.05, that is, `alpha=0.05`. The alternative hypothesis, `H_1: mu!=26`, indicates that we have a two sided test. This means that if the sample mean is way too low or way too high then we will have reason to reject the null hypothesis. If we are going to work this out by doing our own calculations then our first task is to determine just how low or how high the sample mean needs to be in order to reject the null hypothesis.

We know that the distribution of sample means, for samples of size 25, will have its mean equal to `mu` and its standard deviation, the standard error, equal to `s_x/sqrt(25)`, and it will be distributed as a Student's t with 25-1 degrees of freedom. Here is an abbreviated table giving t-values for various probabilities and for a select number of degrees of freedom:

Notice that the chart gives the t-values for the area to the right of the indicated t-value. Because this is a two sided test and because we want the level of significance to be 0.05, we want to find the t-value for 24 degrees of freedom that has 0.025 as the area under the curve to the right of that value. We recognize that there will be a corresponding 0.025 as the area under the curve to the left of the opposite of that value, thus giving us the 0.05 for the total area of the more extreme values. The chart above has that particular cell highlighted in yellow. From that we know that for 24 degrees of freedom, a `t`-value of 2.064 has 2.5% of the area to the right of that value.

At this point we can proceed in either of two ways. First, we can compute the margin of error `t_(alpha/2)xx(s_x/sqrt(n)) = 2.064xx(5.6/sqrt(25))`. That value is the most that our sample mean can differ from the value of `mu` in our null hypothesis. Thus, if we subtract that value from 26 we will have the lowest allowable value for our sample mean; if we add that value to 26 we will have the highest allowable value for our sample mean. Once we know those values we can inspect the sample mean, in this case, 23.5, to see if it is below the lowest allowed value or above the highest allowed value. If either is true then we can reject `H_0: mu=26` in favor of the alternative hypothesis `H1: mu!=26`.

Alternatively, we could just compute the `t`-score of our sample mean, that is, compute `(barx-mu)/(s_x/sqrt(n))=(23.5-26)/(5.6/sqrt(25))` and then compare that value to `-2.064` and to `2.064`. If our computed `t`-score is less than `-2.064` or greater than `2.064`, then we can reject the null hypothesis `H_0:mu=26` in favor of the alternative hypothesis `H_1:mu!=26`.

Let us look at doing these computations on the calculator.
Figure 1
In Figure 1 we start with computing our margin of error, `2.064xx(5.6/sqrt(25))`, and storing that value into the variable X. Then we find the lower and upper limits on acceptable values for our sample mean. In Figure 1 we see that the lower value is 23.68832 while the upper value is 28.31168. We compare our sample mean, 23.5, to these and we see that the sample mean is actually less than the lower acceptable limit, 23.68832. Thus, from our computations in Figure 1 we reject the null hypothesis in favor of the alternaitve hypothesis.
Figure 2
Figure 2 demonstrates the other method of analysis. Here we compute our `t`-value as `(23.5-26)/(5.6/sqrt(25))` and we find that value to be `-2.142857143`. We compare this to the the `t`-score from the table, namely, `2.064` and its opposite, namely, `-2.064`. Because our computed `t`-score, `-2.142857143` is less than the lower value, `-2.064`, we reject the null hypothesis in favor of the alternative hypothesis.
Either method works; they are absolutely equivalent. However, to use either method we do need to get that value, 2.064, from the table. What do we do if we do not have the table? If you have a TI-84 with more recent software, then this is not a problem. The DIST menu from that software has a built-in option, invT(, that will get the desired value for us.
Figure 2a
Figure 2a was generated on a TI-84 with the newest software. This figure shows the DIST menu, with item 4 highlighted. Press to select that item.
Figure 2b
The TI-84 responds with this input screen, asking us for the desired area to the left of the `t`-value, and the degrees of freedom.
Figure 2c
In Figure 2c we have supplied the appropriate values. Note that we gave the calculator the .975 value as the area to the left of the `t`-value, meaning that we will have 0.025 to the right of that value. The highlight has been moved down to the Paste option.

Press to paste the appropriate command onto the main screen.

Figure 2d
Figure 2d shows the invT( command as the calculator has formed it from the input screen of Figure 2c. We press to perform the command.
Figure 2e
The result is shown in Figure 2e. The value of 2.063898542 is the value that was rounded to 2.064 for the table.

Thus, if we have a TI-84 with the newer software, we are able to compute the `t`-value rather than having to look it up in a table.

This does give rise to the question of what can we do if we have neither the table nor a TI-84 running the newest software? What if we have an older TI-84 or an 83-Plus, or even an 83? On those calculators there is no invT( option on the DIST menu. However, we do have two programs that can help us accomplish the same task. The first program is called INVT. Let us look at a run of that program.
Figure 3
For Figure 3 we have found the INVT program in the PRGM menu and we have pasted it onto the main screen. Press to actually run the program.
Figure 4
The INVT program asks us for the degrees of freedom. We respond with 24. Then the program asks us for the desired area to the left of the `t`-value, and we have responded, in Figure 4 with the value 0.975.
Figure 5
Not shown between Figure 4 and Figure 5 is the series of dots that the calculator displays while INVT is working. Once it has come reasonably close to the desired value, the program, as shown in Figure 5, displays the number of degrees of freedom, the desired area (labeled as GOAL PERCENT), the `t`-value, in this case 2.063898683, and the area to the left of that value.

You might notice that the value shown in Figure 5 is slightly different from the value computed by the TI-84 used to produce Figure 2e. This is because the INVT program just tries to get reasonably close to the appropriate value and it gives up before it achieves the accuracy of the internal computations done on the TI-84. Remember that the table value was a much less accurate 2.064. We will not worry about the INVT value being just slightly different from the invT( answer.

A second program, ASTUDT, was suggested by Jim Egan here at Washtenaw Community College. Rather than do a successive approximation, as does the INVT program, the ASTUDT program uses the available TInterval command to "trick" the calculator into producing the correct result. Let us look at a run of the ASTUDT program.
Figure 6
As usual, we found the ASTUDT program in the PRGM menu and pasted it to the main screen. Then we press to run the program.
Figure 7
ASTUDT starts by telling us that it has an initial setting of 29 degrees of freedom. We press any key to get off of this page and to continue with the program.
Figure 8
Figure 8 shows the main menu of the program. From here we can
  1. change the number of degrees of freedom,
  2. specify the desired area to the left of the `t`-value,
  3. specify the desired area to the right of the `t`-value,
  4. specify the desired area between a `t`-value and its opposite, or
  5. tell the program to quit.

Our problem requires us to have 24, not 29, degrees of freedom. Therefore we select option 1 to take us to Figure 9.

Figure 9
The program requests a new number of degrees of freedom. We respond with 24 and then press to move to Figure 10.
Figure 10
The ASTUDT program merely confirms our input value and then waits for us to hit any key to return to the menu.
Figure 11
Figure 11 shows that we have returned to the menu and that we have highlighted the second option. We can press to move to that option.
Figure 12
Now the program asks for the area to the left of the `t`-value. We give that as .975 and then press to continue.
Figure 13
The program responds by telling us that the `t`-value 2.063898542 has .975 area to its left. We might note two things here. First, the actual computation time (which you cannot see on this web page of course) is much less than the time needed by the INVT program shown above. Second, the answer from ASTUDT is exacty the same as the answer that the TI-84 produced via its invT( command.

The program waits for us to hit a key to return to the menu.

Figure 13a
Back at the menu, we will again select option 2.
Figure 14
This time we will give the desired area as .025. The program returns with the correct answer `-2.063898542`. Again, press any key to return to the menu.
Figure 15
The actual problem that we are solving was really a two-tailed test with a level of signifcance at 0.05. Thus, we will have 5% of the area between the low and high values. We can use option 4 to compute the `t`-values based on that 95% value.
Figure 16
The ASTUDT program asks for the area between the values. We respond with .95, and the program gives us both values.

Not shown on this page is our return to the menu and our selection of item 5 to QUIT the program.

All of the work thus far has been to use the calculator to evaluate some expressions and to use the calculator to produce the values that we would generally look up in a table. However, there is a feature on the calcualtor that makes all of this seem like extra work. In particular, the calculator has a STAT Tests feature called T-Test.
Figure 17
In Figure 17 we have moved to the STAT menu and then shifted it to the TESTS submenu. There, in position 2, we find the T-Test... option. We select that option to move to Figure 18.
Figure 18
Figure 18 shows the input form for the T-Test feature. At the moment we have not placed any of our values into this form. We do so to move to Figure 19.
Figure 19
In Figure 19 we have told the input form that
  • we have STATistics to enter (not DATA),
  • that the null hypothesis specifies that `mu=26` (specified on the calculator as `mu_0:26`),
  • that the sample mean is `barx=23.5`,
  • that the sample standard deviation is `s_x=5`,
  • that `n=25`, and
  • that the alternative hypothesis `H_1` amounts to saying that the true mean is not equal to the value we specified as `mu_0`.
Then we move the highlight to Calculate and press to perform the command.
Figure 20
The result is shown in Figure 20. That Figure gives `H_1:mu_1!=26`, the `t`-score as `t=-2.23214857`, the probability of having a `t`-score like that or more extreme (including having one that is greater than `2.2314857`, and then it repeats the sample mean, standard deviation, and size.

Our interprestation of this is that we have a `t`-score that has even less than the 0.05% significance level that we started with. Thus, the statistics from our sample have yielded values that are even more rare than the 0.05 significance level that we had set. Therefore, we would reject the null hypothesis in favor of the alternative hypothesis.

Figure 21
For Figure 21 we have returned to the T-Test input form and here we have only changed the second from bottom line. Now we are asking the calculator to use the same values but to do so based on a one-tailed test because now our alternative hypothesis is `H_1:mu<26`. After we move to the Calculate field and press the calcuator takes us to Figure 22.
Figure 22
Everything in Figure 22 is the same as it was in Figure 20 except that the proability of having such a `t`-score or a more extreme score has dropped by half. That is because the only more extreme scores are now those that are less than the computed `t`-score. Because the Alternative Hyposthesis is now `H_1:mu<26` we only look at extreme values as being those way less than 26.

©Roger M. Palay
Saline, MI 48176
November, 2013