Professional Documents
Culture Documents
Course Instructor
Ms. Sidra Zaheer
Lecturer
School of Public Health,
DUHS
Introduction to Biostatistics
12/29/2014 1
Lecture 06
t – Test
Inference Regarding Sample Means
12/29/2014 2
Previous class
Hypothesis testing with single mean
12/29/2014 3
What are we doing today?
Two-sample t-test
Paired t-test
Independent samples
Equal variance
Unequal variance
Confidence intervals
Comparison of CI to hypothesis test
12/29/2014 4
Learning Objectives
Understand the procedure of hypothesis testing and
assumptions for two population means.
12/29/2014 5
What kind of t is it?
Single sample t – we have only 1 group; want to test
against a hypothetical mean.
12/29/2014 7
Example: t -test
An investigator conducted an experiment to see if a
given therapy works to reduce test anxiety in a sample
of college students. A standard measure of test anxiety
is known to produce a µ = 20. In the sample drawn of
25 the mean = 18 with s = 9.
H0 ? and Ha ?
12/29/2014 8
Two Samples t-Test
i- Paired samples t-test
The paired samples test is a kind of research called repeated
measures test (aka, within-subjects design), commonly used
in before-after-designs.
12/29/2014 9
Paired Sample t Test
Single-Sample Paired-Sample
Single observation from each Two observations from each
participant participant
The second observation is
The observation is dependent upon the first
independent from that of since they come from the
the other participants same person.
Comparing a mean of
Comparing a mean score to a
difference scores to a
distribution of mean scores . distribution of means of
difference scores
12/29/2014 10
Hypothesis Testing with two samples t-test
State the hypotheses
Upper-tailed Test
Ho: (µ1 - µ2) ≤ 0
Ha: (µ1 - µ2) > 0 Rejection
region
Lower-tailed Test:
Ho: (µ1 - µ2) ≥ 0 Rejection
region
Ha: (µ1 - µ2) < 0
Two-tailed Test:
Ho: (µ1 - µ2) = 0 Rejection
Rejection
region
region
Ha: (µ1 - µ2) ≠ 0
12/29/2014 11
Scenario
A tumor size study: Having an accurate measure of tumor
size is extremely important because it allows a physician to
accurately determine if a tumor is growing, shrinking or
remaining constant.
12/29/2014 12
Available data
For a portion of the study, a pair of doctors were
shown the same set of tumor pictures. The volume
of the tumor was measured by two separate
physicians under similar conditions.
H 0 : dr1 dr 2 dr1 dr 2 0
H A : dr1 dr 2 dr1 dr 2 0
2) Alpha=0.05
2
1
0
-4 -3 -2 -1 0 1 2 3
diff
12/29/2014 17
Paired t-test in SPSS
Import Data1.sav
12/29/2014 18
Paired t-test in SPSS
Analyze –> Compare means –> Paired samples t test
12/29/2014 19
Paired t-test in SPSS
12/29/2014 20
Paired t-test in SPSS
To interchange
the means
position
12/29/2014 21
SPSS Output
12/29/2014 24
Independent t-Test
For example, an independent t-test is used to understand
whether first year graduate salaries differed based on
gender (i.e., your dependent variable would be "first year
graduate salaries" and your independent variable would be
"gender", which has two groups: "male" and "female").
12/29/2014 25
Assumptions
Independent t-Test:
It is only appropriate to use an independent t-test if your data
"passes" six assumptions that are required for an independent t-test
to give you a valid result
Assumption #1:
Dependent variable should be measured at the interval or ratio
level (i.e., they are continuous).
Examples: Revision time (measured in hours), intelligence
(measured using IQ score), exam performance (measured from 0
to 100), weight (measured in kg), and so forth
12/29/2014 26
Assumptions cont…
Assumption #2:
Independent variable should consist of two
categorical, independent groups.
Example independent variables that meet this criterion
include gender (2 groups: male or female), employment
status (2 groups: employed or unemployed), smoker (2
groups: yes or no), and so forth.
Assumption #3:
You should have independence of observations, which
means that there is no relationship between the observations
in each group or between the groups themselves.
12/29/2014 27
Assumptions cont…
Assumption #4:
There should be no significant outliers. Outliers are simply
single data points within your data that do not follow the usual
pattern
Assumption #5:
Dependent variable should be approximately normally
distributed for each category of the independent variable.
You can test for normality using the Kalmogorov/Shapiro-Wilk test
of normality, which is easily tested for using SPSS.
Assumption #6:
There needs to be homogeneity of variances. You can test this
assumption in SPSS using Levene’s test for homogeneity of
variances.
12/29/2014 28
Independent t Test
Paired-Sample Independent t Test
Two observations from each Single observation from each
participant participant from two
independent groups
The second observation is The observation from the
dependent upon the first second group is independent
since they come from the from the first since they come
same person. from different subjects.
Comparing the difference
Comparing a mean
between two means to a
difference to a distribution distribution of differences
of mean difference scores between mean scores .
12/29/2014 29
Scenario
Another aspect of the tumor volume study was trying
to compare the tumor volume among patients with
different forms of cancer. The average tumor size is
important to know the effect of treatment can be
determined.
12/29/2014 31
Hypothesis
1)
test
The null hypothesis is that there is no difference between the volume
of the tumor in the two forms of cancer
brain breast 0
H0: mean brain tumor size = mean breast tumor size
Ha: mean brain tumor size ≠ mean breast tumor size brain breast 0
12/29/2014 33
Analyze Compare means Independent samples t-test
We have to make
grouping variable
first, according to
given
independent
groups
12/29/2014 34
Analyze Compare means Independent samples t-test
12/29/2014 35
1
2 5
12/29/2014 36
SPSS Output
Conclusion:
• Since from t-test, p‐value (0.043) is less than α = 0.05
than we conclude that there is a significant difference
in the size of brain and breast cancer tumors.
• 95% Confidence Intervals (-3.30, -0.05)
12/29/2014 38