CTIS 365
APPLIED DATA ANALYSIS
Dr. Seyid Amjad Ali
[email protected] C202, 290 5335
CTIS 365: Applied Data Analysis
CTIS 365: Applied Data
Analysis
INDEPENDENT-SAMPLES T-TEST
INDEPENDENT T-TEST
yes
z-score test
one Is known?
no Single sample t-test
How many
seperate
samples?
independent
Independent t-test
Independent
two
or matched
samples? Related-samples
matched t-test
CTIS 365: Applied Data Analysis Slide 3
INDEPENDENT T-TEST
A study is designed to compare students’ achievement taught by
two different teaching methods. 20 students were randomly
selected and then randomly assigned to one of the two groups.
Students in group 1 was taught by method A, students in group 2
was taught by method B. Students’ test scores were obtained and
compared at the end of semester.
Is there a significant difference between the academic
achievement of two groups of students taught by different
teaching methods?
CTIS 365: Applied Data Analysis Slide 4
INDEPENDENT T-TEST
Do the achievement scores
for students taught by
method A differ from the
scores for students taught
by method B?
In statistical terms, are the
two population means the
same or different?
Ho: A=B or
Ho: A- B= 0
CTIS 365: Applied Data Analysis Slide 5
INDEPENDENT T-TEST
Formula for single sample t-test
M
t
standard error
Formula for independent-measures t-test
( M 1 M 2 ) ( 1 2 )
t
standard error
CTIS 365: Applied Data Analysis Slide 6
INDEPENDENT T-TEST
Estimated standard error
For single sample t-test, the standard error measures how
much error is expected between a sample mean and the
population mean.
For independent-measures t-test, the standard error of the
mean difference (sM1 – M2) measures the amount of error
expected when you use a sample mean difference (M1 – M2)
to represent a population mean difference (1- 2).
CTIS 365: Applied Data Analysis Slide 7
INDEPENDENT T-TEST
Estimated standard error of the mean difference
For each sample, the estimated standard error:
s2
sM
n
For independent-measures t-test, we want to know the total
amount of error involved in using two sample means to
represent two population means. To do this, we will add the
errors coming from each sample.
CTIS 365: Applied Data Analysis Slide 8
INDEPENDENT T-TEST
Estimated standard error of the mean difference
Thus, the resulting formula for the estimated standard error
of mean difference (sM1 – M2) is (see page 305 of the textbook
for the explanation):
2 2
s1 s2
sM 1 M 2
n1 n2
However, this formula is appropriate only when the two
samples are exactly the same size (n1= n2).
CTIS 365: Applied Data Analysis Slide 9
INDEPENDENT T-TEST
Estimated standard error of the mean difference
When n1 ≠ n2 , a pooled variance should be used, which is
obtained by “pooling” the two sample variances.
2 SS1 SS 2
sp
df1 df 2
Thus, the formula is:
2 2
sp sp
sM1 M 2
n1 n2
CTIS 365: Applied Data Analysis Slide 10
INDEPENDENT T-TEST
For independent measures t-test
The complete formula for test statistic is:
( M 1 M 2 ) ( 1 2 )
t
sM1 M 2
When n1= n2, When n1 ≠ n2 ,
2 2 2 2
s1 s2 sp sp
sM 1 M 2 sM1 M 2
n1 n2 n1 n2
CTIS 365: Applied Data Analysis Slide 11
INDEPENDENT T-TEST
For independent measures t-test
The complete formula for test statistic is:
( M 1 M 2 ) ( 1 2 )
t
sM1 M 2
The degrees of freedom is:
df = df1 + df2 = (n1 – 1) + (n2 – 1) = n1 + n2 - 2
CTIS 365: Applied Data Analysis Slide 12
INDEPENDENT T-TEST
√ √
2 2 2 2
𝑠
Prove that when n1 = n2 , 𝑝 𝑝 𝑠 𝑠1 𝑠2
+ = +
𝑛1 𝑛 2 𝑛1 𝑛2
√
𝑆𝑆1 +𝑆𝑆 2 𝑆𝑆1 + 𝑆𝑆2
𝑠( 𝑀 − 𝑀 ) =
1 2
√
𝑠 2𝑝 𝑠2𝑝
+ =
𝑛1 𝑛 2
𝑑𝑓 1 +𝑑𝑓 2
𝑛1
+
𝑑𝑓 1 + 𝑑𝑓 2
𝑛2
=
√
2 𝑆𝑆 1
+
2 𝑆𝑆 2
𝑛1 ( 𝑑𝑓 1+ 𝑑𝑓 2) 𝑛 2 (𝑑𝑓 1+ 𝑑𝑓 2 )
Replacing df1 and df2 with df we have
¿
√
2 𝑆𝑆1 2 𝑆𝑆2
+ =
𝑆𝑆1 𝑆𝑆2
+
2 𝑛1 𝑑𝑓 2𝑛 2 𝑑𝑓 𝑛1 𝑑𝑓 𝑛2 𝑑𝑓
and ,we have
√
¿
√𝑠 21 𝑠 22
+
𝑛1 𝑛2
CTIS 365: Applied Data Analysis
QED!!!
Slide 13
INDEPENDENT T-TEST
HYPOTHESIS TESTING WITH THE
INDEPENDENT-MEASURES t STATISTIC
Example. A study is designed to compare students’
achievement taught by two different teaching methods.
20 students were randomly selected and then randomly
assigned to one of the two groups. Students in group 1
was taught by method A, students in group 2 was taught
by method B. Students’ test scores were obtained and
compared at the end of semester.
CTIS 365: Applied Data Analysis Slide 14
INDEPENDENT T-TEST
HYPOTHESIS TESTING STEPS
STEP 1. State the hypotheses
STEP 2. Set the criteria for a decision
STEP 3. Collect data and compute test statistic
STEP 4. Make a decision
CTIS 365: Applied Data Analysis Slide 15
INDEPENDENT T-TEST
STEP 1: State the hypotheses
The null hypothesis H0: A - B = 0 or A = B
The alternative hypothesis H1: A - B ≠ 0 or A ≠ B
CTIS 365: Applied Data Analysis Slide 16
INDEPENDENT T-TEST
STEP 2: Set the criteria for the decision
This is an
independent
measures design. We
will use t distribution
and set as .05.
df = nA + nB – 2 = 10 + 10 - 2 = 18
CTIS 365: Applied Data Analysis Slide 17
INDEPENDENT T-TEST
STEP 3: Collect data and compute test statistic
Sample 1 Sample 2 2 SS1 SS 2 200 160
n1 = 10 n2 = 10
sp 20
df1 df 2 99
M1 = 25 M2 = 19
2 2
SS1 = 200 SS2 =160 sp sp
20 20
sM 1 M 2 2
n1 n2 10 10
( M 1 M 2 ) ( 1 2 ) (25 19) 0
t 3.00
sM 1 M 2 2
CTIS 365: Applied Data Analysis Slide 18
INDEPENDENT T-TEST
STEP 4: Make a decision
t-statistic = 3
The calculated t statistic (3.00) is greater than the critical t
value (2.101). Thus, we reject the null hypothesis.
CTIS 365: Applied Data Analysis Slide 19
INDEPENDENT T-TEST
STEP 4: Make a decision
Conclusion: The achievement scores for students taught by
different methods are significantly different. Specifically,
achievement scores of students taught by method A (M = 25,
SD = 4.71) is significantly higher than those taught by
method B (M = 19, SD = 4.22), t(18) = 3.00, p < .05, two-tailed
test.
CTIS 365: Applied Data Analysis Slide 20
INDEPENDENT T-TEST
EFFECT SIZE
Cohen’s d can be M1 M 2 25 19
calculated as: d 1.34
sp
2
20
Large effect size according to Cohen’s standards
CTIS 365: Applied Data Analysis Slide 21
INDEPENDENT T-TEST
EFFECT SIZE
Eta squared can be calculated as:
t2 9
eta squared 2 .33
t ( n1 n2 2) 9 18
33.3% of the variance in test scores is explained by teaching
method.
The guidelines proposed by Cohen (1988) are: .01 = small
effect, .06 = moderate effect, .15 = large effect
CTIS 365: Applied Data Analysis Slide 22
INDEPENDENT T-TEST
Reporting the results
An independent-measures t-test was used to compare
achievement scores for two teaching methods, and
results indicated that there was a statistical significant
difference in the average test scores between students
taught by Method A (M = 25, SD = 4.71) and those taught
by Method B (M = 19, SD = 4.22; t (18)=3.00, p < .05, d =
1.34).
CTIS 365: Applied Data Analysis Slide 23
INDEPENDENT T-TEST
ASSUMPTIONS OF THE INDEPENDENT
MEASURES t-TEST
• Independent observation
• Normality – the two populations from which the samples
are selected must be normal
• Homogeneity of variance – the two populations from
which the samples are selected must have equal
variances.
CTIS 365: Applied Data Analysis Slide 24
INDEPENDENT T-TEST
ASSUMPTIONS OF THE INDEPENDENT
MEASURES t-TEST
If the assumption of equal variance is violated, the results
from the hypothesis testing may be misleading. So before
we report and interpret the result, we should check this
assumption.
CTIS 365: Applied Data Analysis Slide 25
INDEPENDENT T-TEST
ASSUMPTION CHECK
Method to check the Homogeneity of variance
Hartley’s F-max = slargest2 /ssmallest2,
The F-max value computed from the sample data is
compared with the critical value in the F-max Table
(Table B.3, p.652).
CTIS 365: Applied Data Analysis Slide 26
INDEPENDENT T-TEST
ASSUMPTION CHECK
Method to check the Homogeneity of variance
Hartley’s F-max = slargest2 /ssmallest2 = 22.2 / 17.8 = 1.25
Critical F-max = 4.03 with = .05, k = 2, and df = 9
Because the obtained F-max is smaller than the critical
value, we conclude that the homogeneity of variance
assumption has not been violated.
CTIS 365: Applied Data Analysis Slide 27