SPSS LAP assignment
LAB 4:
Comparison of Means I (t – Tests)
1
The main purpose of this lab is to learn when, why, and how to perform t-tests and how to correctly interpret the result.
There are 3 types of t-tests: these types are:
One- sample t-test, which is used to compare a single mean of a quantitative variable to a specific known value or “gold standard”.
Two-sample t-test, which is used to compare two means based on independent samples from the two populations or group
Paired t-test (two dependent samples t-test), which is used to compare two means based on samples that are related. It is usually used in a “before and after” studies
Introduction
See Chapter 6 for more details
2
| Comparison of Means (I) | ||||
| Type of Test | Number of Variables | Variables Type | Writing the Null / Alternative Hypothesis | The Value of the Test Statistics |
| One Sample t-test | 1 | Quantitative variable | t- value | |
| Independent Samples t-Test | 2 | One quantitative and one qualitative (two categories only) | t- value | |
| Paired t-Test | 2 | Two related quantitative variables | t- value |
Comparison
of
Means
One-Sample t-Test
For comparing sample result with a known value
Independent Samples t-Test
To determine whether the unknown means of two population are different from each other based on independent samples
Paired t-Test
For data in which the two samples are paired in some way.
| Evidence or Proof | |
| P-value (Sig.) | If p-value ≤ 0.05, we reject the null hypothesis |
| If p-value > 0.05, we fail to reject the null hypothesis | |
| Confidence Interval (CI) | If CI includes the value of zero, we fail to reject the null hypothesis (Check to see if the interval goes from negative to positive ) |
| If CI does not include the value of zero, we reject the null hypothesis |
One-Sample t-Test (Two-tailed)
Only one sample is taken
Involves one quantitative variable
The null hypothesis (Two-tailed t-Test):
The mean of a population for a given quantitative variable is equal to a specific known value.
The alternative hypothesis:
The mean of a population for a given quantitative variable is not equal to a specific known value.
Assumptions: We will assume the variable is approximately normal
Scenarios when you would use One-Sample t-Test:
Based on a random sample of 200 students, can we conclude that the average SAT score this year is lower than the national average from 3 years ago?
Is the mean weight loss for adult men, who attended the lifestyle intervention program, more than 5 pounds after 3 months.
Independent Samples t-Test (Two-tailed)
Used when comparing the averages of a quantitative variable between two groups
Involves one quantitative and one qualitative (two categories only) variables
The null hypothesis (Two-tailed t-Test):
The population means of the two groups, A and B are the same (SPSS uses Group 1 or 2)
The alternative hypothesis:
The population means of the two groups are different
Assumptions:
Normality: The quantitative variable is normally distributed in each group
Homogeneity of variance (equality of variances): Variances in the two groups are roughly equal.
Scenarios when you would use Two-tailed Independent Samples t-Test:
Does baseline cholesterol differ between those that have history of breast cancer and those that do not?
Is the mean baseline BMI level different for the smokers versus the non-smokers?
Paired t-Test (Two-tailed)
Used when comparing the averages of two measurements on the same (related) sample of subjects
The two samples have to be dependents
Involves two related quantitative variables (pre and post)
Usually used in a “before and after” research design
The null hypothesis (Two-tailed t-Test):
The population mean of the differences is zero
or
The alternative hypothesis:
The population mean of the difference is not zero
or
Assumptions:
Normality: The sampling distribution of the differences between scores should be normal, not the pre and post scores themselves
Scenario when you would use Two-tailed Paired Samples t-Test:
Is there a statistically significant change in BMI after 6 weeks compared to BMI at baseline?
Examples: Using assignment# 4 dataset, answer the following questions:
Is the mean body mass index (BMI) significantly different from what is considered a upper limit of normal BMI level (BMI=25)?
Hypothesis: H0: µ= 25 Ha: µ ≠ 25
Answer:
Since we have one quantitative variable, one-sample t-test should be used to answer this research question.
To Obtain a One-Sample T Test:
From the menus choose:
Analyze Compare Means One-Sample T Test... Select baseline BMI as the variable to be tested
Enter a numeric test value.
9
Step 1:
Select the quantitative
variable from the list
Step2:
Enter a numeric test value
The numeric test value
Since the p-value for t-test is significant, we conclude that the mean BMI at baseline is significantly higher than 25
SPSS Outputs:
Since the 95% CI does not include “zero”, there is a significant difference between the means (NOTE: both Upper and Lower
Values are positive)
Decision:
Fail to reject the null hypothesis (FTR) √ Reject
Since P-value less than alpha = 0.05, we reject the null hypothesis.
Conclusion (Interpretation):
The mean body mass index (BMI) is significantly different from what is considered a upper limit of normal BMI level (BMI=25)
| N | Mean | Std. Deviation | t-value | P-value (Sig. [2-tailed]) | Mean Difference | 95% CI of the Difference | ||
| Lower | Upper | |||||||
| BMI | 406 | 27.96 | 4.404 | 13.55 | <0.001 | 2.96 | 2.53 | 3.39 |
Summary Table:
2. Is the mean baseline cholesterol level different for the smokers versus the non-smokers?
Answer:
Hypothesis:
Since we have one quantitative and one qualitative (two categories) variables, Two- Independent Samples t-Test should be used to answer this research question.
To Obtain and Independent-Samples t -Test:
From the menus choose:
Analyze Compare Means Independent-Samples T Test Select baseline BMI as the quantitative variable to be tested Select a single grouping variable (smoking at baseline) Click Define Groups to specify two codes for the groups you want to compare (codes of 1 and 2 in this case)
Note: The grouping variable is always the nominal variable while the test variable is always the interval variable.
13
2. Is the mean baseline cholesterol level different for the smokers versus the non-smokers?
.
14
SPSS outputs:
Since the p-value for Levene’s test is not significant, we will assume the variances are equal and we will use the top row for the t-test
Since the p-value for t-test is not significant, we conclude that there is no significant difference in cholesterol level at the baseline between the two groups
Since the 95% confidence interval does include the null hypothesis of “zero difference”, we conclude that there is no significant difference in cholesterol level at the baseline between the two groups
15
| Group | N | Mean | Std. Deviation | t-value | P-value (Sig. [2-tailed]) | Mean Difference | 95% CI of the Difference | ||
| Lower | Upper | ||||||||
| BMI | Smokers | 33 | 5.41 | 0.95 | -1.30 | 0.195 | -.27 | -0.68 | 0.139 |
| Non-smokers | 373 | 5.68 | 1.17 |
Summary Table:
Decision:
Fail to reject the null hypothesis (FTR) √ Reject
Since P-value greater than alpha = 0.05, we fail to reject the null hypothesis.
Conclusion (Interpretation):
There is no significant difference in cholesterol level between smokers and non-smokers at baseline
16
3. Is there a statistically significant change in cholesterol level after 6 weeks?
Answer:
Hypothesis:
Since we have two quantitative (related) variables, Paired t-Test should be used to answer this research question.
To Obtain and Independent-Samples t -Test:
From the menus choose:
Analyze Compare Means Paired-Samples T Test Select cholesterol level at week6 as your variable 1 and cholesterol level at baseline as variable 2 Click OK
Note: For this class, always choose the newest measurement to be your variable 1 and the first measurement as your variable 2.
17
2. Is there a statistically significant change in cholesterol level after 6 weeks?
.
18
SPSS outputs:
Descriptive statistics for the mean difference between the two quantitative variables. The mean cholesterol levels are lower after 6 weeks when compared to baseline since the value is negative.
Since the 95% confidence interval does not include “zero difference” of the null hypothesis, we conclude that there is a significant difference in cholesterol level from the baseline to week 6
Since the p-value for t-test is significant, we conclude that the mean cholesterol levels after 6 weeks is significantly lower than the baseline.
19
Summary Table:
Decision:
Fail to reject the null hypothesis (FTR) √ Reject
Since P-value greater than alpha = 0.05, we reject the null hypothesis.
Conclusion (Interpretation):
The mean cholesterol levels after 6 weeks is significantly lower than the baseline
| Time | N | Mean | Std. Deviation | t-value | P-value (Sig. [2-tailed]) | Mean Difference | 95% CI of the Difference | ||
| Lower | Upper | ||||||||
| Cholesterol level | Time 2(week 6) | 406 | 4.95 | 1.04 | -19.11 | <0.001 | - 0.72 | - 0.79 | - 0.64 |
| Time 1(at baseline | 406 | 5.66 | 1.15 |
20
0
0
0
:
:
a
H
H
mm
mm
=
¹
12
12
:
:
o
a
H
H
mm
mm
=
¹
0
:0
:0
Diff
a
Diff
H
H
m
m
=
¹
:0
:0
o
d
a
d
H
H
m
m
=
¹
0
0
:
H
mm
=
0
:
a
H
mm
¹
:
o
AB
H
mm
=
:
a
AB
H
mm
¹
:
H
o
prepost
mm
=
:
H
a
prepost
mm
¹
:0
o
d
H
m
=
:0
a
d
H
m
¹
12
:
o
H
mm
=
12
:
a
H
mm
¹
pr
:
o
epost
H
mm
=
:
a
prepost
H
mm
¹