SPSS Lab activity - Comparisons between two groups

Jamil Palacios Bhanji and Vanessa Lobue
Last edited Oct 26, 2022

Goals for today


Step 0 - Get organized, import data


Step 0.1 - Start SPSS and import the data

Import the "Schroeder_Epley_2015_Study_4_abbrev.csv" data:
Open SPSS and use File -> Import Data-> CSV or Text Data - now check the variable types and add labels if you wish. Save the files with a sensible name like "Hiring_Ratings".
Careful! If you use "import text data" make sure you set the only delimiter as "comma" (SPSS may automatically select "space" as a delimiter, so uncheck that option)
In Variable View (or in the import process):
1. Set pnum, CONDITION and pnum_rm to Type: Numeric, Measure: Nominal, and set Hire_Rating to Type: Numeric, Measure: Scale.
2. Enter labels for the CONDITION variable: Click on the "Values" cell for the CONDITION variable, then click the three dots in the cell, then enter 0 with the Label "text", and 1 with the Label "audio", like this:

SPSS Label Values{width=50%}


Step 2 - Examine group means and distributions

Two group decision chart{width=50%}

Above is the decision process chart from the book.

Find the following information in the output:
1. Number of cases in each group
2. Mean, median, Std Deviation for each group
3. Boxplot, Histogram and Normal Q-Q plot for each group


Step 3 - Compare means with an independent samples t-test

Look at the Independent Samples Test summary:

  1. Levene's Test for Equality of Variances is an F-test of the null hypothesis that the variance of each group is equal. Some researchers use this test to decide whether to assume equal variances in the groups. A low "Sig." for this test would indicate that you should not assume the group variances are equal (and use the "Equal variance not assumed" row of the output (aka the Welch two sample t-test). Others say we can just use the Welch test by default because it is more general and there is little difference in power when variances are actually equal. Note that normality is still an assumption for both tests.
  2. The t-statistic, under "t", is the difference between group means divided by estimated standard error (see Chapter 10 of the Field textbook), and the two-sided p-value tells you the probability of a t-statistic at least this far from zero (positive or negative) under the null hypothesis (that the group means are not different). The one-sided p gives the probability of a t-statistic at least this much greater than zero under the null hypothesis.
  3. Notice the degrees of freedom (equal variance assumed), df, is equal to the number of cases minus 2 (because we estimate 2 parameters: the mean for each group) - it is a little lower (and not an integer) in the "Equal variances not assumed" row.
  4. The mean difference is the mean of Group 1 minus the mean of Group 2 (4.714-2.889 = 1.825). Standard Error is the standard error of that difference. The t-statistic is the mean difference divided by the standard error.
  5. The 95% confidence interval gives an interval around the estimated difference between means: we expect 95% of intervals constructed this way to contain the true difference in population means.

Effect size - independent samples

Below the "Independent Samples Test" table there is the "Independent Samples Effect Sizes" table. This table lists 3 effect size measures (values in the "point estimate" column) and 95% confidence intervals around the effect size measures.

Each effect size measure is based on the difference between means divided by some measure of deviation. SPSS gives you Cohen's d where the denominator is the standard deviation (ds in the Lakens (2013) article). Hedge's g also uses the pooled standard deviation in the denominator, with a correction that is considered more accurate for small samples. Glass' delta uses the standard deviation of only one of the groups (Group 2) in the denominator, which may be appropriate when one group is considered a control group. The "Standardizer" column in the effect size table tells you what the denominator is for each effect size measure.

Now, answer the following questions for yourself based on what you've done so far

  1. What is the difference between the mean Hire_Rating level for the group of recruiters that heard audio pitches compared to the mean level for recruiters that read text pitches (in terms of raw units of the 0-10 rating scale)?
  2. What is the estimated effect size (ds), and confidence interval for the effect size?
  3. What do you conclude about the effect of audio versus text pitches based on this sample of data you have examined? (assume this is a random sample from the population of professional recruiters) Can you reject the null hypothesis that the mean likelihood to hire ratings for each group are the same?

How to report the result

A report of the result of a comparison like this should include:
1. Type of comparison (this can be in the Methods section. e.g. "Means were compared by an independent samples t-test (equal variances not assumed).")
2. Means and SDs for each group (you might also report a confidence interval for each mean and/or for the difference between means)
3. Test statistic with degrees of freedom and p value
4. Effect size

Following the way the result was reported in the original publication (Schroeder & Epley, 2015) we could report the finding like this:
"Recruiters reported being more likely to hire the candidates when they listened to audio pitches (M = 4.71, SD = 2.26) than when they read the same pitches (M = 2.89, SD = 2.06), t(36.87) = 2.64, p = .01, 95% CI of the difference = [0.42, 3.23], d = 0.84."


Step 4 - Non-parametric test for independent samples (based on sum of ranks)

Examine the output

Step 5 - Dependent samples (also called paired samples, within-subjects comparison, repeated measures)

Now, let's imagine a different sample of data, where each recruiter was exposed to both conditions (audio and text) and made the same ratings, so from each recruiter there are two Hire_Rating measures: one in the audio and one in the text condition. This is a within-subjects or repeated measures design. When we analyze this sample we need to account for the fact that measures in each condition are dependent, meaning that the "audio" rating from a recruiter may be related to the "text" rating from the same recruiter.

What to do:

We'll use the same data file, but reorganize it as if it were a within-subjects design. We'll use the pnum_rm variable as the participant id variable (instead of pnum) to do this.
1. For repeated measures analyses in SPSS we need to reformat the dataset so that there is one row for each ID (pnum_rm) and the Hire_Rating values for each condition are in two separate variables
1. Delete the 3 cases with no value in the pnum_rm column (right-click on the case number and "clear"), then save the file with a new name, like "HiringRatingspaired" 2. Go to Data->Restructure
3. select "Restructure selected cases into variables" (next)
4. Enter pnum_rm as the Identifier Variable
5. Enter CONDITION as the Index Variable (next)
6. Select "Yes" to sort the data (next)
7. Select "group by index"
8. click Finish
9. Rename the "Hire_Rating.0" variable to "Hire_Rating_text" and the "Hire_Rating.1" variable to "Hire_Rating_audio", then set the label fields (this is helpful for the way the variables appear in the dialog boxes), and set the Measure type to "Scale" for the two variables.

  1. generate a box plot, histogram, Q-Q, and table of means similar to what you did for the first sample (use Analyze->Descriptive Statistics->Explore) - the only difference between these new descriptives and the descriptives you created earlier is that there are 3 less data points, and only 18 cases total.

Next, use a paired samples t-test to compare ratings in the "audio" condition to ratings in the "text" condition

  1. Go to Analyze->Compare Means->Paired Samples T Test
  2. Move Hire_rating_audio to "Variable 1" for Pair 1
  3. Move Hire_rating_text to "Variable 2" for Pair 1
  4. Check the box for effect size, and select "Standard deviation of the difference" (this will give you effect size estimates specific to the repeated measures design)

What is different in the analysis of this within-subjects design?

Effect size


Step 6 - Non-parametric test for paired samples

Examine the output

That's all for the SPSS activity, have fun in R now!


References