Lab 18

1-Sample t-Tests

The one-sample t-test allows us to extend our hypothesis testing procedure to cases where we don’t know the population standard deviation σ.  Without the population σ, we can’t directly calculate the standard error like we would do for a z-test. So in this situation, we will take our best guess at what σ might be. That value is the sample standard deviation, because without knowing the values in the entire population, our best guess at what the value is comes from the sample we are testing. That’s what the sample statistics are supposed to be doing, representing the population values. So here we’ll let the sample statistics represent the population parameter σ in our test. And instead of calculating the standard error directly, we’ll calculate the estimated standard error. In other words, in our t-test we’ll estimate σ since we don’t know it.

 

So our t-test formula will be

 

Rule: When you know the value of σ, use a z-score. If σ is unknown, use the sample to estimate σ and use the t-statistic.


If we know σ:

If we don't know σ:

standard error=

estimated standard error=



test statistic: z-score


test statistic: t-score

 

 

 

Degrees of freedom is a complex topic. At first it will seem like nonsense. Even competant data analysts often have a tough time telling you exactly what it is. I will explain it here but not expect that you will grasp it fully until you have taken other statistics courses.

In short, degrees of freedom is like an entry in the balance column in your checkbook. It keeps track of how many independent bits of information there are left that we can use to estimate a parameter. In this case, we have n data points (i.e., the number of scores in the sample) and we wish to esimate the standard deviation of the population. In using the standard deviation  of the sample as our estimate, we had to calculate the sample mean. This "eats up" 1 degree of freedom.  We still have n - 1 degrees of freedom left to estimate the standard deviation.

Why does the term "degrees of freedom" have such a silly name? Well, one way of looking at it is that degrees of freedom describe the number of scores in a sample that are free to vary after we have placed restrictions on the values of some scores in the sample. If I say there are 12 scores in a sample and that the sample mean is 20, 11 scores are free to vary and one is determined. What does this mean? If you choose any set of 11 numbers, no matter how big or small, I can choose 1 number that will make the mean turn out to be 20. In this sample, there are 11 degrees of freedom left, after you have estimated the sample mean. From there, we can estimate other parameters with the 11 bits of independent information. In general, there are n-1 degrees of freedom in any sample.

When we do our hypothesis test, we have to add in a fudge factor that accounts for the fact that in estimating the standard deviation, we had to use up a degree of freedom. The critical value of the t-test depends on the number of degrees of freedom, n - 1. In other statistics, we have different formulas for the degrees of freedom.

The critical value of z was looked up using the NORMSINV function. The critical value of t is looked up using the TINV function. Here is the formula: critical t = TINV(2α / tails, df)
So, if n = 5, df = 5 - 1 = 4.


If α = .05 and it is a 1-tailed test,
critical t = TINV(2 * .05 / 1 , 4) = TINV(.10, 4) = 2.13.

If α = .05 and it is a 2-tailed test,
critical t = TINV(2 * .05 / 2 , 4) = TINV(.05, 4) = 2.78.

Note that for a 1-tailed z-test at α = .05, the critical z was 1.64 and for a 2-tailed z-test at α = .05, the critical z was 1.96. Critical t will always be higher than critical z. This means that t-tests are less powerful. That is, it takes a bigger observed difference to reject the null hypothesis for a t-test than for a z-test. Thus, if you have a choice, always choose a z-test. Only do a t-test when you have no other choice.


We will be using four steps to conduct our hypothesis test:

 

Step 1: State your null H0 and research hypotheses H1

Step 2: Figure out your decision criteria (α, is this a one or two tailed test, what are your degrees of freedom, and the critical value of t.)

Remember: One-tailed tests are directional, and two-tailed tests are looking for a difference.

df = n - 1
critical t = tinv(2α / tails, df)

Step 3: Compute sample statistics (sample mean and estimated standard error)

Step 4: Compute the test statistics, (what is the observed value of t?)

Step 5: Compare your t-score with the critical t-score and make your conclusions about the null hypothesis H0: should you reject it or fail to reject it?

Step 6: State your conclusion in ordinary language.

 

 

Let's walk through an example using these steps:

 

Are Psychology students less outgoing than typical college students at ISU? A sample of 55 Psychology majors is given a standard personality questionnaire with higher scores indicating higher degrees of extraversion. This sample had an average of 44 and a standard deviation of 15.4. The mean score for general population of college students is 50. Use α = .05).

 

Step 1: State your null H0 and research hypotheses H1

H0: Psychology Students are not less outgoing than typical ISU students. That is, the mean score for Psychology students is μ >= 50.
H1: Psychology Students are less outgoing than typical ISU students. That is, the mean score for Psychology students is μ < 50.

Step 2: Figure out your decision criteria (α, is this a one or two tailed test, what are your degrees of freedom, and the critical value of t.)
α = .05
This is a one tailed test.
df = 55 - 1 = 54
critical t = TINV(2 * .05 / 1, 54) = 1.67 (actually it is -1.67 because the sample mean is expected to be lower than the population mean)

Step 3: Compute sample statistics (sample mean and estimated standard error)
Sample mean = 44
Sample standard deviation = 15.4
Estimated standard error = 15.4 / sqrt(55) = 2.07
Population mean = 50

Step 4: Compute the test statistics, (what is the observed value of t?)

Observed t = (44 - 50) / 2.07 = -2.88

Step 5: Compare your t-score with the critical t-score and make your conclusions about the null hypothesis H0: should you reject it or fail to reject it?
-2.88 is larger in absolute value than -1.67 so the null hypothesis is rejected.

Step 6: State your conclusion in ordinary language.

Psychology students are significantly less outgoing than the general population of college students.

Here is a new spreadsheet that might be helpful to you.

It works just like the z-test spreadsheet.

Below is an example of how to conduct a t-test using SPSS.

 

Ms. X teaches four high school statistics classes each semester.  In the picture below, in the "Quiz1" column, are the scores for her first quiz in her first class.  She wants to know if they performed significantly differently from the rest of her classes.  The mean of her other classes for the last 20 years has been 10.



 

Go to Analyze,-compare means,-One-sample T test:


 

Click your variable over to the "Test Variable(s) box with the arrow. 
Change the Test Value box from 0 to the sample mean (10, in this case). Forgetting this step is the #1 reason people miss points on the 1-sample test questions.

 

Remember to put your mean (10, in this case) in the test value box

 

 


 

This is what the output should look like:

                                                              

 

 

The last step is to interpret your data:

You could look up the critical t using =TINV(2 * .05 / 2, 12) = 2.18 and then compare it to the observed t of 2.28.
An easier way is to look at the "Sig. (2-tailed)" column in the SPSS output. This is called the "significance value" or, more commonly, the "p-value." It indicates the probability of getting the obtained value of t if the null hypothesis is true. If it is less than α, reject the null. SPSS always reports a p-value for a 2-tailed test. To calculate a 1-tailed p-value, simply divide in half. In this case, a 1-tailed p would be .041 / 2 = .0205. Whether this is a 1 or 2-tailed test, the null hypothesis is rejected. Technically, this was a 2-tailed test. It appears that the null hypothesis should be rejected. Thus, it appears that this class scored significantly better than other classes Ms. X has taught.



Download the worksheet here to answer the questions.
Email it to your GA when you are finished.