0% found this document useful (0 votes)
32 views63 pages

Lecture LAB3 T-Tests

The document discusses different types of t-tests and their non-parametric counterparts that are used to compare means and medians. It provides examples of one-sample t-tests, two independent samples t-tests, and their non-parametric versions. Steps are outlined for conducting these tests in SPSS and interpreting the results.

Uploaded by

Samar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views63 pages

Lecture LAB3 T-Tests

The document discusses different types of t-tests and their non-parametric counterparts that are used to compare means and medians. It provides examples of one-sample t-tests, two independent samples t-tests, and their non-parametric versions. Steps are outlined for conducting these tests in SPSS and interpreting the results.

Uploaded by

Samar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 63

Lecture/Lab 3

Comparison of Means (t – Tests), and Medians


Introduction

 The main purpose of this lab is to learn when/why and how to perform t-tests and
their non-parametric counterparts, and how to correctly interpret the results
 There are 3 types of t-tests:
 One- sample t-test
 Two-sample t-test
 Paired t-test (two dependent samples t-test)
And there non-parametric counterparts are:
 One-Sample Wilcoxon Signed Rank Test
 Mann-Whitney U Test
 Wilcoxon Signed Rank Test
Evidence or Proof

• If p-value ≤ 0.05, we reject the null hypothesis

P-value (Sig.)
• If p-value > 0.05, we fail to reject the null hypothesis

• 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 )


Confidence Interval (CI)
• If CI does not include the value of zero, we reject the null
hypothesis
One sample t-test
 One-Sample t-Test (Two-tailed)
 is used to compare a single mean of a quantitative variable to a specific known
value or “gold standard”
 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. H :0
  0

 The alternative hypothesis:


The mean of a population for a given quantitative variable is not equal to a specific
known value. H :a
  0
Assumptions: The quantitative 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.
Example: Is the average age significantly different from 45?

Hypothesis: H0: µ= 45 Ha: µ ≠ 45

Assumption: Normality assumption of the quantitative variable (age)


Assessing the Assumption :

Assess the normality assumption using Explore option in SPSS


(new procedure)
Checking extreme values (outliers)
Impossible value for
age
Removing the impossible value
Re-check the data after removing the outlier
One sample t-test in SPSS

Analyze Compare Means One-Sample T Test Select

baseline age as the variable to be tested Enter a numeric test value


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
age is significantly higher than 50.
Reporting the Results for a One-Sample t test
Summary Table:

95% CI of the
Mean Difference
N Mean ± SD P-value
Difference
Lower Upper

Age 406 51.83 ± 11.64 6.82 5.69 7.96 <0.001

 Interpretation:
“The average age is significantly higher than 45 yrs., t(405) = 11.81, p <0.001”
If the assumption not met

Use One-Sample Wilcoxon Signed Rank Test


One-Sample Wilcoxon Signed Rank Test
Example: Is the blood glucose level significantly different from 100 mg/dl?

Hypothesis: H0: Median= 100 Ha: Median ≠ 100


Explore glucose variable:
Severely right skewed assumption not met
One-sample Wilcoxon signed rank test in SPSS
Analyze Non-parametric Test One Sample Objective

Select Automatically compare observed data to hypothesized

Click Fields Move Baseline Glucose to Test Fields


Click Settings Select Customize Test Select Compare
median to hypothesized (Wilcoxon signed-rank test ) and enter the
numeric test value Click
Interpretation:
The median baseline glucose level is significantly lower than 100 mg/dl ( p <0.001)
Two independent samples t-test
 Independent Samples t-Test (Two-tailed)
 Used when comparing the means (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) H :o A

B

 The alternative hypothesis:


The population means of the two groups are different
H :a A

B
 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 who have history of breast cancer and

those that do not?


• Is the mean baseline BMI level different for the smokers versus the non-smokers?
Example: Is the mean baseline cholesterol level different for the
smokers versus the non-smokers?

Hypothesis: H :  
o 1 2 H :  
a 1 2

• Since we have one quantitative and one qualitative (two categories)


variables, Two- Independent Samples t-Test should be used to answer
this research question.
 Assessing the Assumption of Normality
 Explore your data for unusual or extreme values (outliers)
 Add the quantitative variable in the Dependent list
 Add the qualitative variable in the Factor list in order to get the normality test for each of
the two groups.
 Homogeneity of variance through Levene’s test will be done within the independent t-test
Two Independent Samples t-tests in SPSS

Analyze Compare Means Independent-Samples T Test Select baseline Cholesterol 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 scale (quantitative) variable
SPSS Output

Since the p-value for t-test is not


Since the p-value for Levene’s test is
significant, we conclude that there is
not significant, we will assume the
no significant difference in cholesterol
variances are equal and we will use
level at the baseline between the two
the top row for the t-test
groups
Summary Table:

95% CI of the
P-value Difference
Std. Mean
Group N Mean t-value (Sig. [2-
Deviation Difference
tailed]) Lower Upper

Baseline Smokers 37 5.39 0.97


-1.31 0.189 -.26 -0.65 0.12
Cholesterol Non-smokers 370 5.65 1.16
Decision:

√Fail to reject the null hypothesis (FTR)

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
If the assumptions not met

Use Mann-Whitney U Test


Mann-Whitney U Test
Example: Is there a statistically significant difference in glucose level
between males and females?

H0: Median(males) = Median(females)

Ha: Median(males) ≠ Median(females)


Explore glucose variable
Assumptions not met

Mann-Whitney U Test in SPSS
Analyze Non-parametric Test Legacy Dialogs

Two Independent Samples Move Baseline Glucose to


Test Fields Select Gender as Grouping Variable Click
Define Groups to specify two codes for the groups you want to
compare (codes of 1 and 2 in this case) Click Continue
Click Ok
SPSS Output
Summary table

Gender
Factor Males Females P-value*
n=161 n=246
Baseline Glucose Level, mg/dl [Median (Min. - Max.)] 97.20 ( 75.60 - 311.40) 93.60 (34.20- 250.20) 0.001
* Mann-Whitney Test

 Interpretation:

There was a significant difference between males and females in the median
glucose level at baseline, Mann-Whitney U =14648.5, p=0.001
Paired t-test
 Paired t-Test (Two-tailed)
 Used when comparing the means 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 H : or 0
o d
H o :  pre   post

 The alternative hypothesis:


The population mean of the difference is not zero
H :  or
a
0
d
H a :  pre   post
 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?


Example: Is there a statistically significant change in BMI after 6 weeks
compared to BMI at baseline?
 Hypothesis: H :
o Pr e

Post H :
a Pr e

Post

 Data exploration:

 Explore the data for unusual values

 Assumptions:

o Normality:

 Assess the normality assumption of the differences using Explore

option in SPSS
 Assessing the Assumption of Normality:

 Computing the BMI difference using Transform Compute Variable option


 Assessing the Assumption of Normality:
 Testing the normality using the difference in BMI
Paired-Samples t-test in SPSS

From the menus choose:

Analyze Compare Means Paired-Samples T Test

Select BMI at week 6 as your variable 1 and BMI at baseline as variable 2 OK


SPSS Outputs

Descriptive statistics for the mean difference Since the p-value for t-test is significant,
between the two quantitative variables. The mean we conclude that the mean cholesterol
BMI levels are lower after 6 weeks when compared levels after 6 weeks is significantly
to baseline lower than the baseline.
Reporting the Results for a Paired-Samples t test

Time

Factor N P-value*
Baseline Week 6

Body Mass Index, Kg/m2 [mean +/- SD] 407 28.67 ± 5.40 27.66 ± 5.13 <0.001

 Interpretation:
“There was a significant reduction in body mass index after 6 weeks of
follow-up, t(406)= - 34.06, p< 0.001.”
If the assumption not met

Use Wilcoxon Signed Rank Test


Wilcoxon Signed Rank Test
Example: Is there a statistically significant change in glucose
after 6 weeks compared to glucose at baseline?
H0: Median(pre) = Median(post)

Ha: Median(pre) ≠ Median(post)


Explore glucose variable
Assumptions not met
Wilcoxon Signed Rank Test in SPSS
Descriptive of the two tested variable (pre & post)
Summary table

Time
Characteristics N P-value*
At baseline At week 6

Glucose , mg/dl.[Median (Min. - Max.)] 407 95.40 ( 34.20- 311.40) 90 (68.40 - 246.60) <0.001
* Wilcoxon Signed Rank Test

 Interpretation:

There was a significant reduction in glucose level after 6 weeks of


follow-up, p< 0.001 < less than 0.05
In-class Assignment
Using CHIP_407 dataset, answer the following questions:
1. Is the mean body mass index (BMI) at baseline
significantly different from what is considered a upper limit
of normal BMI level (BMI=25)?
2. Is the mean baseline cholesterol level different for the
males versus the females
3.Is there a statistically significant change in pulse rate after
6 weeks?
Don not forget to..
 Check for the assumptions

 Check for outliers

…Ultimately… you will conduct parametric tests!


 Compute the needed variables for analysis

 BMI= (weight(lb)*703)/(height(in))** 2

 Convert cholesterol (mmol) to (mg/dl) by multiplying by 89

 Convert glucose (mmol) to (mg/dl) by multiplying by 18


Is the mean body mass index (BMI) significantly different from
what is considered a upper limit of normal BMI level (BMI=25)?
Hypothesis

Assumption(s)
SPSS output:

Summary table:

Variable 95% CI of the


Mean Difference
N Mean ± SD P-value
Difference
Lower Upper

Decision/Conclusion/interpretation:
Is the mean baseline cholesterol level different for the
males versus the females?
Hypothesis

Assumption(s)
SPSS output:

Summary table:

Quantitative 95% CI of the


variable P-value Difference
Std. Mean
Group N Mean t-value (Sig. [2-
Deviation Difference
tailed]) Lower Upper

Decision/Conclusion/interpretation:
Is there a statistically significant change in pulse rate
after 6 weeks?
Hypothesis

Assumption(s)
SPSS output:

Summary table:
Time
Factor N P-value*
Baseline Week 6

[mean +/- SD]

Decision/Conclusion/interpretation:
Thank you

You might also like