Psychology 242

Hypothesis testing, and t-tests in SPSS

 

Consider the following experimental hypothesis:  Taking caffeine before an exam improves exam scores.  In a completely randomized design (a between-subjects design, in other words) 10 students in the control group take an exam without drinking coffee.  In the experimental condition, 10 different students take the same exam after drinking coffee.  The researcher wants to find out whether caffeine improves test scores.

 

There are two population distributions:

 

Take 2 samples (see Excel file for demonstrations)

                                       

Do these two samples come from the same population, or from two different populations?

How can we tell?         

 

We can not know for sure.  But we can use what we know about normal distributions to find out how unlikely it is that these two samples could have come from the same distribution. 

 

But first, we must introduce the concept of a sampling distribution – specifically, we need to know about the sampling distribution of the mean.

 

Just as there is a distribution of how frequently each individual score occurs, there is also a distribution of how frequently a sample mean occurs for a given sample size.  We can demonstrate this by taking several samples from population A.

 

If we did this many many times we could plot a histogram of the resulting sample means.  If we took an infinite number of samples, we would wind up with a normal distribution of these sample means.  This is called the sampling distribution of the mean – it is a distribution of sample means for a given sample size.

 

Any statistic can have a sampling distribution - a distribution of values produced by different samples.  The difference between two means, for example, has a sampling distribution that tends to be normal.  If the null hypothesis is true (if the difference between the population means is really zero), then the sampling distribution of the difference between two means will have a mean of zero.  If we know shape of a distribution (in this case it is a normal distribution) and we know its mean (zero if the null hypothesis is true in this case), then we can figure out the probability of a particular value occurring by looking at where it falls in this distribution.  Thus, for any two sample means, we can figure out the probability (p) of finding a difference between them as large as the one we found if the null hypothesis were true.

 

Now, how can we use this information to decide whether we think our two sample means came from the same population or not?


Hypothesis Testing:

  1. Assume that they come from the same population (Assume the null hypothesis).
  2. Calculate the probability of getting this large a difference between sample means when both samples are from a single population (Calculate p).
  3. If that probability is small enough, reject the null hypothesis (If p < .05, conclude that the two groups are from different populations; “The difference is statistically significant”).
  4. If p is not small enough (p > .05) then do not reject the null hypothesis.  (In this case, you can not make any strong conclusion.  Just because you failed to reject the null hypothesis does not mean you have proven that the two samples do come from the same population.)

So how do we use a t-test for this in SPSS? 

 

Sampling distribution of t: The statistic t depends on the difference between two means and the standard deviation of the samples.  t gets larger when the difference between the means is larger.  It also has a sampling distribution:  If we repeatedly took pairs of samples from a single population and ran a t-test on them, the values of t would be distributed normally with a mean of zero and a standard deviation of around 1 (for large sample sizes).  We can ask the same question of the t for a sample that we did of the mean for a sample: how often would we get a t this big if the null hypothesis were true?

 

Hypothesis Testing with t:

  1. Assume that the samples come from the same population (Assume the null hypothesis).
  2. Calculate the probability of getting a t this large when both samples are from a single population (Calculate p).
  3. If that probability is small enough, reject the null hypothesis (If p < .05, conclude that the two groups are from different populations; “The difference is statistically significant”).
  4. If p is not small enough (p > .05) then do not reject the null hypothesis.  (In this case, you can not make any strong conclusion.  Just because you failed to reject the null hypothesis does not mean you have proven that the two samples do come from the same population.)

 


Steps for doing a t-test in SPSS:

 

A)   For a between-subjects design with 2 conditions (2 groups)

·        Analyze -> Compare Means -> Independent-Samples T Test

·        Move the dependent variable  into the Test Variable(s) box.

·        Move the indepent variable into the Grouping Variable box.

·        Click Define Groups

·        Enter the values your independent variable has in the 2 groups.  Click Continue.

·        Click OK.

·        In the output window, you should see the title "T-Test" followed by two tables.  The first table gives the means for each condition (among other things).  The second table gives the results of the t-test.  The fourth column (labeled "t") gives the value of t, the fifth column gives the degrees of freedom (labeled "df"), and the sixth column gives the p value (labeled "Sig. (2-tailed)"). 

·        The results of a significant t-test are reported like this:  t (df) = x.xx, p < .05.  (note that df is the number representing the degrees of freedom, and x.xx is the t score to the hundredths place.)

·        The results of a non-significant t-test (when p > .05) are reported like this:  t (df) = x.xx, n. s. 

 

B)   For a within-subjects design with 2 conditions

·     Analyze -> Compare Means -> Paired-Samples T Test

·     Move the variable names that correspond to your two conditions into the Paired Variables box

·     Click OK.