Answers To Exercises and Review Questions: T-Test
Answers To Exercises and Review Questions: T-Test
QUESTIONS
Before attempting these questions read through the introduction to Part Five and Chapters 16-
21 of the SPSS Survival Manual.
T-tests
5.1 Using the data file survey.sav follow the instructions in Chapter 16 of the SPSS Survival
Manual to find out if there is a statistically significant difference in the mean score for males
and females on the Total Life Satisfaction Scale (tlifesat). Present this information in a brief
report.
T-Test
Group Statistics
Levene's Test
for Equality of
Variances t-test for Equality of Means
95% Confidence
Interval of the
Sig. Mean Std. Error Difference
F Sig. t df (2-tailed) Difference Difference Lower Upper
tlifesat total Equal variances
.706 .401 -1.881 434 .061 -1.230 .654 -2.516 .055
life satisfaction assumed
Equal variances not
-1.897 408.528 .059 -1.230 .648 -2.505 .044
assumed
An independent-samples t-test was conducted to compare total life satisfaction scores for males
and females. There was no statistically significant difference between the two groups [t(434)
=-1.88, p=.06].
1
5.2 Using the data file experim.sav apply whichever of the t-test procedures covered in
Chapter 16 of the SPSS Survival Manual that you think are appropriate to answer the
following questions.
(a) Who has the greatest fear of statistics at time 1, males or females?
Group Statistics
An independent-samples t-test was conducted to compare fear of statistics scores for males and
females. There was no statistically significant difference between the two groups [t(28) =1.10,
p=.28].
(b) Was the intervention effective in increasing students’ confidence in their ability to cope
with statistics? You will need to use the variables, confidence time1 (conf1) and confidence
time2 (conf2). Write your results up in a report.
2
Paired Samples Test
Paired Differences
95% Confidence
Interval of the
Std. Std. Error Difference Sig.
Mean Deviation Mean Lower Upper t df (2-tailed)
Pair 1 confid1
confidence
time1 - confid2 -2.867 4.754 .868 -4.642 -1.091 -3.303 29 .003
confidence
time2
A paired-samples t-test was conducted to assess whether there was a change in students’
confidence scores from time 1 (pre-intervention) to time 2 (post-intervention). There was a
statistically significant difference between the two sets of scores [t(29) =-3.30, p=.003]. Mean
scores increased from 19.0 (SD=5.37) at Time 1 to 21.87(SD=5.59) at Time 2.
(c) What impact did the intervention have on students’ levels of depression?
Paired Differences
A paired-samples t-test was conducted to assess whether there was a change in students’
depression scores from time 1 (pre-intervention) to time 2 (post-intervention). There was a
statistically significant difference between the two sets of scores [t(29) =-3.95, p<.001]. Mean
scores decreased from 42.53 (SD=4.59) at Time 1 to 40.73(SD=5.52) at Time 2.
3
One-way analysis of variance
For exercises 5.3 and 5.4 you will need to open the data file survey.sav.
5.3 Perform a one-way between-groups ANOVA to compare the levels of perceived stress
(tpstress) for the five different age groups (agegp5), 18-24yrs, 25-32yrs, 33-40yrs, 41-49yrs
and 50+yrs.
Descriptives
95% Confidence
Interval for Mean Between-
Std. Lower Upper Componen
N Mean Deviation Std. Error Bound Bound Minimum Maximum t Variance
18-24 93 28.60 6.094 .632 27.35 29.86 12 46
25-32 86 25.65 4.920 .531 24.60 26.71 14 39
33-40 82 26.77 5.918 .654 25.47 28.07 13 40
41-49 95 26.62 5.706 .585 25.46 27.78 12 42
50+ 77 25.75 6.178 .704 24.35 27.16 13 42
Total 433 26.73 5.848 .281 26.18 27.28 12 46
Model Fixed
5.774 .277 26.18 27.27
Effects
Random
.539 25.23 28.22 1.062
Effects
ANOVA
4
29
28
Mean of tpstress
27
26
The results of the one way ANOVA indicate that there is a difference in the perceived stress
levels amongst the age groups [F(4, 428)=3.76, p=.005]. Inspection of the means plot
suggests that the younger age group (18 to 24yrs) has higher stress levels than the other age
groups.
5.4 Perform post-hoc tests to compare the Self esteem scores for people across the three
different age groups (use the agegp3 variable).
Descriptives
95% Confidence
Interval for Mean Between-
Std. Std. Lower Upper Componen
N Mean Deviation Error Bound Bound Minimum Maximum t Variance
18-29 149 32.60 5.589 .458 31.69 33.50 18 40
30-44 152 33.59 5.288 .429 32.74 34.43 18 40
45+ 135 34.50 5.151 .443 33.63 35.38 20 40
Total 436 33.53 5.395 .258 33.02 34.04 18 40
Model Fixed Effects 5.352 .256 33.03 34.04
Random Effects .545 31.19 35.88 .692
5
tslfest total self esteem
b. The group sizes are unequal. The harmonic mean of the group sizes is
used. Type I error levels are not guaranteed.
Post-hoc comparisons using the Tukey Honestly Significant Difference test indicated that the
mean score for Group 1 (M=32.6, SD=5.59) was significantly different from Group 3 (M=34.5,
SD=5.15). Group 2 (M=33.59, SD=5.29) did not differ significantly from either Group 1 or 3.
For the following exercise you will need to open the data file experim.sav.
5.5 Use one-way repeated measures ANOVA to compare the Fear of Statistics scores for the
three time periods (time1, time2 and time3). Inspect the means plots and describe the impact
of the intervention and the subsequent follow-up three months later.
Measure: MEASURE_1
Dependent
time Variable
1 fost1
2 fost2
3 fost3
Descriptive Statistics
6
Multivariate Tests b
Partial Eta
Effect Value F Hypothesis df Error df Sig. Squared
time Pillai's Trace .635 24.356a 2.000 28.000 .000 .635
Wilks' Lambda .365 24.356a 2.000 28.000 .000 .635
Hotelling's Trace 1.740 24.356a 2.000 28.000 .000 .635
Roy's Largest Root 1.740 24.356a 2.000 28.000 .000 .635
a. Exact statistic
b.
Design: Intercept
Within Subjects Design: time
Measure: MEASURE_1
a
Epsilon
Approx. Greenhouse-
Within Subjects Effect Mauchly's W Chi-Square df Sig. Geisser Huynh-Feldt Lower-bound
time .342 30.071 2 .000 .603 .615 .500
Tests the null hypothesis that the error covariance matrix of the orthonormalized transformed dependent variables is proportional to an
identity matrix.
a. May be used to adjust the degrees of freedom for the averaged tests of significance. Corrected tests are displayed in the
Tests of Within-Subjects Effects table.
b.
Design: Intercept
Within Subjects Design: time
Measure: MEASURE_1
Type III Sum Partial Eta
Source of Squares df Mean Square F Sig. Squared
time Sphericity Assumed 365.867 2 182.933 41.424 .000 .588
Greenhouse-Geisser 365.867 1.206 303.368 41.424 .000 .588
Huynh-Feldt 365.867 1.230 297.506 41.424 .000 .588
Lower-bound 365.867 1.000 365.867 41.424 .000 .588
Error(time) Sphericity Assumed 256.133 58 4.416
Greenhouse-Geisser 256.133 34.974 7.323
Huynh-Feldt 256.133 35.664 7.182
Lower-bound 256.133 29.000 8.832
Measure: MEASURE_1
Type III Sum Partial Eta
Source time of Squares df Mean Square F Sig. Squared
time Linear 365.067 1 365.067 46.652 .000 .617
Quadratic .800 1 .800 .795 .380 .027
Error(time) Linear 226.933 29 7.825
Quadratic 29.200 29 1.007
7
Tests of Between-Subjects Effects
Measure: MEASURE_1
Transformed Variable: Average
Type III Sum Partial Eta
Source of Squares df Mean Square F Sig. Squared
Intercept 127464.100 1 127464.100 1583.134 .000 .982
Error 2334.900 29 80.514
41
40
Estimated Marginal Means
39
38
37
36
35
1 2 3
time
A one way repeated measures ANOVA was conducted to compare scores on the Fear of
Statistics Test scores at Time 1(prior to the intervention), Time 2 (following the intervention)
and Time 3 (three month follow-up). There was a significant effect for time [Wilks’ Lambda=
.365, F(2,28 )=24.36, p<.0005, multivariate partial eta squared=.64. Inspection of the plot of
mean values indicate a steady decrease in fear scores following the intervention, and at the
three month follow-up.
8
Two-way between-groups ANOVA
5.6 For this exercise you will need to open the data file survey.sav. Follow the instructions in
Chapter 18 of the SPSS Survival Manual to conduct a two-way ANOVA to explore the impact
of sex and age group on levels of perceived stress. The three variables you will need are sex,
agegp5 and tpstress.
(a) Interpret the results. Is there a significant interaction effect? Are the two main effects
significant?
Value Label N
sex sex 1 MALES 184
2 FEMALES 249
agegp5 1 18-24 93
age 5 2 25-32 86
groups
3 33-40 82
4 41-49 95
5 50+ 77
Descriptive Statistics
9
Tests of Between-Subjects Effects
10
Homogeneous Subsets
tpstress total perceived stress
a,b,c
Tukey HSD
Subset
age 5 groups N 1 2
25-32 86 25.65
50+ 77 25.75
41-49 95 26.62 26.62
33-40 82 26.77 26.77
18-24 93 28.60
Sig. .706 .159
29
sex
MALES
FEMALES
28
Estimated Marginal Means
27
26
25
24
The interaction effect (sex*agegp5) did not reach statistical significance[F(4, 423)=.492,
p=.741), however there was a significant main effect for sex [F(1,423)=8.44,p=.004) and age
group [F(4,423)=3.82, p=.005). Inspection of the mean scores and the plot suggest that
overall males have lower levels of perceived stress at all age levels. Overall younger people
(18 to 24 yrs) reported higher levels of stress than the other age groups. The results of this
analysis shows that although the means plot suggests the possibility of an interaction between
age and gender, it did not reach statistical significance.
11
(b) Write up this analysis and the results in a report. (Don’t forget to report the means and
standard deviations for each group.)
A two-way between groups analysis of variance was conducted to explore the impact of sex
and age on levels of perceived stress, as measured by the Perceived Stress Scale. Subjects
were divided into five groups according to their age (Group 1: 18 to 24years; Group 2: 25 to
32yrs; Group 3: 33 to 40yrs; Group 4: 41 to 49yrs; Group 5: 50yrs and above). There was no
significant interaction effect between age and sex [F(4,423)=.49, p=.74]. The main effect for
both sex [F(1,423)=8.44, p=.004, partial eta squared=.02] and age [F(4,423)=3.82, p=.005,
partial eta squared=.035] was statistically significant. Post hoc tests using Tukey’s Honestly
Significance Difference test revealed that the 18 to 24yr age group differed significantly from
the 25 to 32yr age group and the 50+ age group. All other group comparisons did not reach
statistical significance. Table XX below shows the mean scores for males and females for
each of the age groups.
Table XX
Mean and Standard Deviations for Males and Females across Age Groups
Males Females
n Mean SD n Mean SD
18-24yrs 39 28.18 5.62 54 28.91 6.45
25-32yrs 38 25.26 4.77 48 25.96 5.06
33-40yrs 38 25.50 5.18 44 27.86 6.35
41-49yrs 35 25.06 6.16 60 27.53 6.02
50+ 34 24.70 6.16 43 26.58 6.14
12
Mixed between-within subjects analysis of variance
5.7 In Chapter 19 of the SPSS Survival Manual we explored the impact of two different
intervention programs (maths skills/confidence building) on participants’ fear of statistics. We
found that both interventions were equally effective in reducing participants’ fear—that is, we
found no differences between groups—but a significant difference across the three time
periods. Repeat these analyses, but this time use confidence scores as the dependent variable.
Open the file experim.sav. You will need to use the following variables: group, conf1, conf2
and conf3.
Measure: MEASURE_1
Dependent
time Variable
1 confid1
2 confid2
3 confid3
Between-Subjects Factors
Value Label N
group type 1 maths skills 15
of class 2 confidence
15
building
Descriptive Statistics
Box's M 8.522
F 1.254
df1 6
df2 5680.302
Sig. .275
13
Multivariate Tests b
Partial Eta
Effect Value F Hypothesis df Error df Sig. Squared
time Pillai's Trace .752 40.897a 2.000 27.000 .000 .752
Wilks' Lambda .248 40.897a 2.000 27.000 .000 .752
Hotelling's Trace 3.029 40.897a 2.000 27.000 .000 .752
Roy's Largest Root 3.029 40.897a 2.000 27.000 .000 .752
time * group Pillai's Trace .207 3.534a 2.000 27.000 .043 .207
Wilks' Lambda .793 3.534a 2.000 27.000 .043 .207
Hotelling's Trace .262 3.534a 2.000 27.000 .043 .207
Roy's Largest Root .262 3.534a 2.000 27.000 .043 .207
a. Exact statistic
b.
Design: Intercept+group
Within Subjects Design: time
Measure: MEASURE_1
a
Epsilon
Within Approx. Greenhouse- Huynh-
Subjects Effect Mauchly's W Chi-Square df Sig. Geisser Feldt Lower-bound
time .573 15.059 2 .001 .701 .753 .500
Tests the null hypothesis that the error covariance matrix of the orthonormalized transformed dependent
variables is proportional to an identity matrix.
a. May be used to adjust the degrees of freedom for the averaged tests of significance. Corrected
tests are displayed in the Tests of Within-Subjects Effects table.
b.
Design: Intercept+group
Within Subjects Design: time
Measure: MEASURE_1
Type III Sum Partial Eta
Source of Squares df Mean Square F Sig. Squared
time Sphericity Assumed 546.467 2 273.233 35.383 .000 .558
Greenhouse-Geisser 546.467 1.401 390.038 35.383 .000 .558
Huynh-Feldt 546.467 1.505 363.097 35.383 .000 .558
Lower-bound 546.467 1.000 546.467 35.383 .000 .558
time * group Sphericity Assumed 45.089 2 22.544 2.919 .062 .094
Greenhouse-Geisser 45.089 1.401 32.182 2.919 .082 .094
Huynh-Feldt 45.089 1.505 29.959 2.919 .079 .094
Lower-bound 45.089 1.000 45.089 2.919 .099 .094
Error(time) Sphericity Assumed 432.444 56 7.722
Greenhouse-Geisser 432.444 39.230 11.023
Huynh-Feldt 432.444 42.140 10.262
Lower-bound 432.444 28.000 15.444
14
Tests of Within-Subjects Contrasts
Measure: MEASURE_1
Type III Sum Partial Eta
Source time of Squares df Mean Square F Sig. Squared
time Linear 546.017 1 546.017 52.526 .000 .652
Quadratic .450 1 .450 .089 .767 .003
time * group Linear 10.417 1 10.417 1.002 .325 .035
Quadratic 34.672 1 34.672 6.867 .014 .197
Error(time) Linear 291.067 28 10.395
Quadratic 141.378 28 5.049
Tests the null hypothesis that the error variance of the dependent variable is equal
across groups.
a.
Design: Intercept+group
Within Subjects Design: time
Measure: MEASURE_1
Transformed Variable: Average
Type III Sum Partial Eta
Source of Squares df Mean Square F Sig. Squared
Intercept 43428.100 1 43428.100 619.488 .000 .957
group 88.011 1 88.011 1.255 .272 .043
Error 1962.889 28 70.103
15
Estimated Marginal Means of MEASURE_1
26
type of class
maths skills
confidence
building
Estimated Marginal Means
24
22
20
18
1 2 3
time
(a) Is there a significant interaction effect between type of intervention (group) and time?
The interaction between type of intervention and time is significant (p=.043). An inspection of
the plot suggests that the confidence building group showed greater improvement in
confidence levels following the intervention than the maths skills group.
(b) Is there a significant main effect for the within-subjects independent variable, time?
The interaction effect for group by time is significant, therefore it is not really appropriate to
interpret the main effect. The impact of one variable (eg. Time) is dependent on the level of
the other variable (group).
(c) Is there a significant main effect for the between-subjects independent variable, group
(maths skills/confidence building)?
The interaction effect for group by time is significant, therefore it is not appropriate to
interpret the main effect. The impact of one variable (eg. Time) is dependent on the level of
the other variable (group).
16
Multivariate analysis of variance
Multivariate analysis of variance is an extension of analysis of variance for use when there is
more than one dependent variable.
5.9 In Chapter 20 of the SPSS Survival Manual it is recommended that you check the
Mahalonobis distances before proceeding with MANOVA. What does this allow you to check
for?
5.11 Follow the procedure detailed in Chapter 20 of the SPSS Survival Manual to perform a
MANOVA to explore positive and negative affect scores for the three age groups (18-29yrs,
30-44yrs, 45+yrs). The three variables you will need are tposaff, tnegaff, agegp3. Remember
to check your assumptions.
Value Label N
agegp3 age 1 18-29 147
3 groups 2 30-44 153
3 45+ 135
Descriptive Statistics
17
Box's Test of Equality of Covariance Matrices a
Box's M 2.703
F .448
df1 6
df2 4335850.466
Sig. .847
Multivariate Tests c
Partial Eta
Effect Value F Hypothesis df Error df Sig. Squared
Intercept Pillai's Trace .976 8661.453a 2.000 431.000 .000 .976
Wilks' Lambda .024 8661.453a 2.000 431.000 .000 .976
Hotelling's Trace 40.192 8661.453a 2.000 431.000 .000 .976
Roy's Largest Root 40.192 8661.453a 2.000 431.000 .000 .976
agegp3 Pillai's Trace .021 2.340 4.000 864.000 .054 .011
Wilks' Lambda .979 2.347a 4.000 862.000 .053 .011
Hotelling's Trace .022 2.354 4.000 860.000 .052 .011
Roy's Largest Root .022 4.709b 2.000 432.000 .009 .021
a. Exact statistic
b. The statistic is an upper bound on F that yields a lower bound on the significance level.
c. Design: Intercept+agegp3
Tests the null hypothesis that the error variance of the dependent variable is equal across
groups.
a. Design: Intercept+agegp3
18
Estimated Marginal Means of total positive affect
34.2
34
Estimated Marginal Means
33.8
33.6
33.4
33.2
21
20.5
Estimated Marginal Means
20
19.5
19
18.5
18
19
The results of Box’s test of equality of covariance matrices indicate no violation of the
assumption (p=.85)
The results of Levene’s test of equality of error variances indicate that we have not violated
the assumption for either of our dependent variables (p=.71, p=.38).
Inspection of the results shown in Multivariate tests indicate a significant result overall
[Wilks’ Lambda=.98, F(4, 862)=2.35, p=.05].
The Tests of Between Subjects Effects table indicates a significant result for Total Negative
Affect [F(2,432)=4.71, p=.009, partial eta squared=.02], but not for Total Positive Affect
[F(2,432)=.45, p=.64, partial eta squared=.002]. Inspection of the mean scores for each age
group indicates a steady decrease in levels of negative affect across the three age groups (18-
29yrs mean=20.65, SD=7.35; 30-44yrs mean=19.37, SD=6.62; 45+yrs mean=18.09,
SD=7.07).
20
Analysis of covariance
5.12 Under what circumstances would you want to consider using analysis of covariance?
Analysis of covariance is used when you wish to compare groups, while controlling for
additional variables that you suspect might be influencing scores on the dependent variable.
5.13 What issues do you need to consider when you are selecting possible covariates?
Covariates need to be chosen with a good understanding of background theory and previous
research in your research area. The covariates need to be continuous variables, measured
reliably and correlate significantly with the dependent variable. The covariate must be
measured before the treatment or experimental manipulation is conducted.
5.14 Using the experim.sav data file, perform the appropriate analyses (including assumption
testing) to compare the confidence scores for the two groups (maths skills, confidence
building) at time 2, while controlling for confidence scores at time 1. The variables you will
need are group, conf1, conf2.
Value Label N
group type 1 maths skills 15
of class 2 confidence
15
building
The above output is used to assess the assumption of homogeneity of regression slopes. The
interaction term (group*confid1) is not significant (p=.317), therefore we have not violated
the assumption and can then proceed with the ANCOVA analysis.
21
Univariate Analysis of Variance
Between-Subjects Factors
Value Label N
group type 1 maths skills 15
of class 2 confidence
15
building
Descriptive Statistics
22
Inspection of the table ‘Levene’s Test of Equality of Error Variances’ indicate we have not
violated the assumption concerning the equality of variances (p=.715).
The Tests of Between-Subjects Effects table results indicate a significant effect for group
(p=.025). There is a significant difference in confidence scores for the confidence building
and maths skills groups, after controlling for confidence scores administered prior to the
treatment program.
5.15 Perform a two-way analysis of covariance to explore the question: Does gender influence
the effectiveness of the two intervention programs designed to increase participants’
confidence in being able to cope with statistics training? You will need to assess the impact of
sex and type of intervention (group) on confidence at time 2, controlling for confidence scores
at time 1.
Value Label N
group type 1 maths skills 15
of class 2 confidence
15
building
sex 1 male 15
2 female 15
Descriptive Statistics
23
Tests of Between-Subjects Effects
2. sex
24
Estimated Marginal Means of confidence time2
27.5
sex
male
female
25
Estimated Marginal Means
22.5
20
17.5
15
An inspection of the plot of mean scores suggests the possibility of an interaction between
gender and type of intervention in terms of confidence scores. Females in the Confidence
building group showed higher confidence scores at Time 2, than those who received the
Maths skills intervention. Males however who participated in the Maths skills intervention
showed higher mean scores than those who were in the Confidence Building group. This is
supported by the results in the Tests of Between Subjects Effects table. The group*sex
interaction term is statistically significant [F(1,25)=117.04, p<.0005].
25
Non-parametric statistics
5.16 What is the difference between parametric techniques and non-parametric techniques?
The parametric tests (eg. T-tests, ANOVA) make assumptions about the population the sample
has been drawn from. Non-parametric techniques do not have such stringent requirements
and do not make assumptions about the underlying population distribution.
5.17 What factors would you consider when choosing whether to use a parametric or a non-
parametric technique?
You need to consider the levels of measurement of your data. If you have nominal or ordinal
scaled data you should use a suitable non-parametric, rather than parametric technique.
5.18 For each of the following parametric techniques indicate the non-parametric alternative
(if one exists).
5.19 Choose and perform the appropriate non-parametric test to address each of the following
research questions.
(a) Using the survey.sav data file find out whether smokers are significantly more stressed
than non-smokers. The variables you will need are smoke and total perceived stress (tpstress).
Mann-Whitney Test
(b) Using the survey.sav data file compare the self-esteem scores across the three different age
groups (18-29yrs, 30-44yrs, 45+yrs). The variables you will need are tslfest and agegp3.
Kruskal-Wallis Test.
(c) Using the survey.sav data file explore the relationship between optimism and negative
affect. The variables you will need are toptim and tnegaff.
(d) Using the survey.sav data file explore the association between education level and
smoking. The variables you will need are educ2 and smoke. Check the codebook and the
questionnaire in the appendix of the SPSS Survival Manual for details on these two variables.
26
(e) Using the experim.sav data file compare the depression scores at time 1 and the depression
scores at time 2. Did the intervention result in a significant change in depression scores? The
variables you will need are depress1 and depress2.
(f) Using the experim.sav data file compare the depression scores for the three time periods
involved in the study (before the intervention, after the intervention and at the three-month
follow up). The variables you will need are depress1, depress2 and depress3.
Friedman Test
27