Two-sample t-tests
PSYC250
Lecture
Week 3
Readings
So … let’s master TWO sample tests!
Keypoints
1. Assumptions
2. Hypotheses
3. Design (IV/DV, number of levels of IV,
within/between, DV scale of measurement)
4. Choice of test: independent/paired
5. t-test formulas
6. t-distribution
7. Hand calcs and SPSS for both between and within
version of the t-test
8. APA for both tests
Two-sample t-tests in general …
Shared assumptions
• Independent and random sampling
• Dependent variable is measured on an
approximately interval (or better) measurement
scale
• Normality assumption
– Type I error rate changes when assumption not met
– e.g. If data skewed in opposite directions
• Field includes additivity and linearity as
assumptions (section 6.5)
Distinct assumptions
• Independent sample t-test
– homogeneity of variance
• Equal variance
– i.e. that the variance of the populations being
compared is similar
• Paired/Correlated/within samples
– The population of difference scores should be
normal (Field 10.6)
Robustness
• The t tests are robust to violations of their
assumptions
– i.e. Type I error rate does not change radically
– Be wary if the distribution in not unimodal
• Independent samples t test
– Be wary if the sample sizes are different
• especially if the smaller group has the larger variance
• Welch’s test better controls Type I error rate
The null hypothesis (H0)
RETAIN
THE NULL
HYPOTHESIS
MU
What would you expect the difference
in means to be for two samples from
the same population?
SAMPLE 1 SAMPLE 2
59 56 60 55
58 56 55 53
58 62 67 57
Hypotheses in symbols
HO 𝜇 1 −𝜇 2=0
H1 𝜇 1 −𝜇 2 ≠ 0
The paired samples t-test is expressed
slightly differently
The sampling distribution of the mean
difference
Independent vs Paired Distinction
Jargon buster (or more Confusius)?
• Independent ≈ between subjects ≈
Unrelated
• Paired ≈ correlated ≈matched ≈
repeated measures ≈ within
subjects ≈ related
Flux Mini-Test
• An experimenter wants to test if women have a
significantly higher IQ than men. She selects twenty
women and twenty men at random from the population
for testing.
• Q1 Is this an experimental, quasi experimental or observational design?
• Q2 What is the dependent variable (DV)?
• Q3 Is the DV quantitative or qualitative?
• Q4 Is the DV nominal, ordinal, interval, or ratio?
• Q4 What is the Independent variable (IV)?
• Q4 How many levels does the IV have?
• Q5 Does the IV vary between or within subjects?
• Q6 Which test could we use to analyse the results?
Independent samples
Paired samples
The underlying formula for all t-tests
score of interest – hypothesised mean of distribution
t=
estimated standard error of distribution
¯ −𝜇
𝑋
e.g. One sample t-test 𝑡=
𝑠^ 𝑋¯
J&B [eqn. 8.7]
Score of interest for two-sample t-
tests
Independent:
Paired: 𝐷
Hypothesised mean
Independent: =0
Paired: =0
Estimated standard error of the
sampling distribution
^𝑠( 𝑋 − 𝑋 )
1 2 Independent
^
𝑠𝐷 Paired
Formula
score of interest – hypothesised mean of distribution
t=
estimated standard error of distribution
Independent 𝑡 = 𝑋 1 − 𝑋 2 − ( 𝜇 1 −𝜇 2 )
samples 𝑠^𝑋 −𝑋
1 2
Paired 𝐷 −𝜇 𝐷
𝑡=
samples ^𝐷
𝑠
Formula Field (2018) style
FLD10.5
Independent FLD10.8
samples
Paired FLD10.6
samples FLD10.7
Estimate of standard error
Field (2018)
FLD10.15
FLD10.16
Paired samples t-test in detail
𝐷
Assumptions
1. Independent and random sampling
2. The scores are normally distributed
3. Approximately interval data
4. The difference scores should be normally
distributed
Calculations
score of interest – hypothesised mean of distribution
t=
estimated standard error of distribution
Correlated 𝐷 −𝜇 𝐷
𝑡=
samples ^𝐷
𝑠
One sample ¯ −𝜇
𝑋
𝑡=
test 𝑠^ 𝑋¯
Calculate D
59 56 58
56 58 62 D
-1 1 3
- 3 -9 5
60 55 55
53 67 57
Calculate
-1 1 3
3 -9 5
𝐷=
∑ 𝐷 2
= =0 . 3̇
𝑁 6
Sum of Squares (SS) Calcs
(∑ 𝐷 )
2
𝑆𝑆=∑ 𝐷 − =∑ ( 𝐷 − 𝐷 )
2 2
𝑁
D D-squared D-Dbar (D-Dbar)^2
-1 1 -1.33333 1.777778
1 1 0.666667 0.444444
3 9 2.666667 7.111111
3 9 2.666667 7.111111
-9 81 -9.33333 87.11111
5 25 4.666667 21.77778
∑ 𝐷=¿
Sum 2
∑ 𝐷 =¿ 2 126 SSIntuitive = 125.3333
( ∑Sum𝐷^)2 =¿ 4
2
SScomp = 126 - 4/6 = 125.3333
𝐷=¿
Mean 0.333333
Calculate and
-1 1 3
3 -9 5
^𝑠 =
2 𝑆𝑆 125 . 3̇
𝐷 = =25.0 6̇
𝑁 −1 5
^𝑠 𝐷= √ 𝑠^ =5.00662
2
𝐷
𝑠^ 𝐷
5.00 662
^𝑠 𝐷= = =2.043
√𝑁 √6
Calculate t, df and tcrit
𝐷 −𝜇 𝐷 − 0 . 3̇ −0
𝑡= = =0. 163
𝑠^ 𝐷 2.043961
df
df = N-1 = 6-1 = 5
For a
paired samples t-test
(and one sample t-test but NOT
for independent samples)
tcrit (2-tailed)
Decision rule
Is
|tobs|>|tcrit|?
YES: Reject the NO: Retain the
null hypothesis null hypothesis
SPSS/JAMOVI
Another example
A common belief held by laypersons is that smoking
marijuana affects a person’s pupil size. To study this issue,
Weil, Zinberg, and Nelson (1968) administered a high dose
of marijuana to ten men by having them smoke a potent
marijuana cigarette. These men were all 21 to 26 years of
age and all smoked tobacco cigarettes regularly but had
never tried marijuana. Pupil size was measured under
constant illumination before and after a man smoked the
marijuana cigarette. Measurements were taken with a
millimeter ruler with the man’s eyes focused on an object
at a constant distance. The data are presented in the table.
The data. Pupil size (mm)
Participant Before After
1 5 7
2 7 5
3 6 8
4 7 5
5 6 6
6 5 7
7 3 9
8 3 5
9 5 9
10 3 9
Design
• Experimental, quasi experimental or
observational?
• What is the IV? What is the DV?
• How many levels does the IV have?
• Is the DV quantitative?
• What scale is the DV measured on?
• N (Total participants) = ___.
• Degrees of freedom (df)?
Hypotheses
• Null hypothesis (H0): µD = 0
• Alternative hypothesis (H1): µD ≠ 0 (2-tailed)
– [Alternative hypothesis (H1): µD > 0 (1-tailed)]
Calculate Differences and make a
stem-and-leaf plot of them
Participant Before After Difference (D)
1 5 7 2
2 7 5 -2
3 6 8 2
4 7 5 -2
5 6 6 0
6 5 7 2
7 3 9 6
8 3 5 2
9 5 9 4
10 3 9 6
Stem and leaf diagram
-2 00
-1
0 0
1
2 0000
3
4 0
5
Stems
6 00are units
Leaves are the first decimal place
Calculate ∑D, and
Participant Before After Difference (D)
1 5 7 2
2 7 5 -2
3 6 8 2
4 7 5 -2
5 6 6 0
6 5 7 2
7 3 9 6
8 3 5 2
9 5 9 4
10 3 9 6
Σ 20
Calculate
Participant Before After Difference (D) D2
1 5 7 2 4
2 7 5 -2 4
3 6 8 2 4
4 7 5 -2 4
5 6 6 0 0
6 5 7 2 4
7 3 9 6 36
8 3 5 2 4
9 5 9 4 16
10 3 9 6 36
Σ 50 70 20 112
√ √
2
(∑ 𝐷 ) 2 02
∑𝐷 2
−
𝑁
11 2 −
10
^𝑠 𝐷= = =√ 8=2.828
𝑁 −1 10 − 1
Calculate
Participant Before After Difference (D) D2
1 5 7 2 4
2 7 5 -2 4
3 6 8 2 4
4 7 5 -2 4
5 6 6 0 0
6 5 7 2 4
7 3 9 6 36
8 3 5 2 4
9 5 9 4 16
10 3 9 6 36
Σ 50 70 20 112
^
𝑆𝐷 2.828
^𝑠 𝐷= = =0.8944
√ 𝑁 √10
Calculate t
Participant Before After Difference (D) D2
1 5 7 2 4
2 7 5 -2 4
3 6 8 2 4
4 7 5 -2 4
5 6 6 0 0
6 5 7 2 4
7 3 9 6 36
8 3 5 2 4
9 5 9 4 16
10 3 9 6 36
Σ 50 70 20 112
𝐷 −𝜇 𝐷 2 −0
𝑡= = =2.236
𝑠^ 𝐷 0.8944
tcrit (2-tailed)
tcrit (1-tailed)
Decision rule
Is
|tobs|>|tcrit|?
YES: Reject the NO: Retain the
null hypothesis null hypothesis
SPSS & APA write up
SPSS data entry
Using SPSS to compute difference: FLD
Self-test on p.463. Answers on companion
website? See also FLD 10.9.2
Checking assumptions
“It is unfortunate that just when the
assumptions behind the test are most
important, we have the least data for
making a reasonable assessment of those
assumptions. By the time we have enough
cases to make meaningful tests on
assumptions, the robustness of the test has
long since taken over and the assumptions
are far less important.” Howell
SPSS test selection
Jargon buster (or more Confusius)?
• Dependent ≈ within subjects ≈ related ≈
paired ≈matched ≈ repeated measures ≈
correlated ≈ within groups
• Independent ≈ between subjects ≈ unrelated
≈ unpaired ≈ unmatched ≈ uncorrelated ≈
between groups
SPSS Output
Differences calculated
opposite way around
i.e. D = (Before – After)
not D = (After – Before)
Gives negative t
Checks
c c t(df), p
APA style write-up
Examination of skewness and kurtosis statistics and of Q-Q
plots did not suggest that the assumption of normality
was violated for before, after or difference scores.
Random and independent sampling was assumed.
A correlated groups t-test with an alpha level of 5% was
used to compare the mean pupil diameter in millimetres
of 10 smokers before and after they smoked a marijuana
cigarette. There was a mean difference of 2.0mm (SD=2.8),
with pupil size larger after smoking, but this difference
was not statistically significant, t(9) = 2.236, p = .052 (two-
tailed).
APA checklist
1) State what test and why (e.g. 1st sentence)
2) Descriptive statistics (including N)
3) Degrees of freedom
4) Magnitude of test statistic
5) p-value, alpha value and whether one or two-tailed
6) Direction and interpretation
7) Say something about whether the assumptions of the
test were met or not
8) That “the nature of the effect being reported can be
understood by the reader”
APA style write-up (1-tailed)
• A correlated groups t-test with an alpha level
of 5% was used to compare the mean pupil
diameter in millimetres of 10 smokers before
and after they smoked a marijuana cigarette.
There was a mean difference of 2mm
(SD=2.8), with pupil size larger after smoking.
This difference was found to be statistically
significant, t(9) = 2.236, p = .026 (one-tailed).
Independent samples t-test in detail
Homogeneity of variance assumption
Pooled variance
df = N- 2
Assumptions
1. Independent and random sampling
2. The scores are normally distributed
3. Homogeneity of variance: =
Homogeneity of variance assumption
Calculation
score of interest – hypothesised mean of distribution
t=
estimated standard error of distribution
Independent 𝑡 = 𝑋 1 − 𝑋 2 − ( 𝜇 1 −𝜇 2 )
samples 𝑠^𝑋 −𝑋
1 2
^𝑠 𝑋 1 − 𝑋2 =
√( 𝑆𝑆 1+ 𝑆𝑆2
𝑛 1+ 𝑛2 − 2 )( 1 1
+
𝑛1 𝑛2 )
Calculate Another
^𝑠 𝑋 1 − 𝑋2 =
√( 𝑆𝑆 1+ 𝑆𝑆2
𝑛 1+ 𝑛2 − 2 )( 1 1
+
𝑛1 𝑛2 ) way!
^𝑠 𝑋
1
− 𝑋2 =
√( ( 𝑛1 − 1) 𝑠^ 21 +( 𝑛2 − 1) ^𝑠22
𝑛1 +𝑛2 −2 )( 1 1
+
𝑛 1 𝑛2 )
𝑆𝑆 1 ^ 2
^𝑠 = 2
1
∴ 𝑆𝑆 1=( 𝑛1 − 1) 𝑠 1
𝑛1 − 1
Estimate of standard error
Field (2018)
FLD10.15
FLD10.16
Not meaningful to
Calculate D
^
59 56 58
56 58 62
69 55 55
53 67 57
Instead Calculate and
59 56 58 69 55 55
56 58 62 53 67 57
Calculate
^𝑠 𝑋 1 − 𝑋2 =
√( 𝑆𝑆 1+ 𝑆𝑆2
𝑛 1+ 𝑛2 − 2 )( 1 1
+
𝑛1 𝑛2 ) 𝑆𝑆=∑ 𝑋 −
2 (∑ 𝑋 )
𝑁
2
59 56 58 69 55 55
56 58 62 53 67 57
2 2
349 34 7
𝑆 𝑆1=20325− =24. 8 3̇ 𝑆 𝑆2=20197 − =128 . 8 3̇
6 6
^𝑠 𝑋 − 𝑋 =
1 2
√( 6+6 −2 )( ) √(
24 . 8 3̇ +128 . 8 3̇ 1 1
+ =
6 6 10 )( )
153 . 6̇ 2
6
=2.2632
SPSS/JAMOVI
Calculate Another
^𝑠 𝑋 1 − 𝑋2 =
√( 𝑆𝑆 1+ 𝑆𝑆2
𝑛 1+ 𝑛2 − 2 )( 1 1
+
𝑛1 𝑛2 ) way!
^𝑠 𝑋
1
− 𝑋2 =
√( ( 𝑛1 − 1) 𝑠^ 21 +( 𝑛2 − 1) ^𝑠22
𝑛1 +𝑛2 −2 )( 1 1
+
𝑛 1 𝑛2 )
𝑆𝑆 1 ^ 2
^𝑠 = 2
1
∴ 𝑆𝑆 1=( 𝑛1 − 1) 𝑠 1
𝑛1 − 1
Calculate t, df and tcrit
Independent 𝑋 1 − 𝑋 2 − ( 𝜇 1 −𝜇 2 )
𝑡=
samples 𝑠^𝑋 −𝑋
1 2
58 .1 6̇ −57 . 8 3̇ −0 0 . 3̇
𝑡= = =0.147
2.26323 2.26323
df
df = 12-2 = 12-2 = 10
df = N - 2
for an
independent samples t-test
tcrit (2-tailed)
Decision rule
Is
|tobs|>|tcrit|?
YES: Reject the NO: Retain the
null hypothesis null hypothesis
Another example
• Dr. Johnson is studying the effects of aspirin
on heart rate. He believes that aspirin will
lower heart rate. He has 2 groups, the
treatment group receives 80mg of aspirin for a
week (n1=4), the control group received a
placebo (n2=4), and their heart rates are
compared. Below is his data in which heart
rate is beats per minute (bpm). He sets his
alpha level at 0.05 and uses a directional test
Design: IV, levels of IV, DV, N, H0, H1
Hypotheses
• Null (H0): µPlacebo ≤ µAspirin
• Heart rate will be the same for both Aspirin
and Placebo
• Alternative(H1): µPlacebo > µAspirin
• Heart rate will be lower for Aspirin
Do you think the data are normal?
Do you think variance is homogenous?
Do you think there is a significant difference?
What we need to calculate
𝑋 1 − 𝑋 2 − ( 𝜇 1 −𝜇 2 )
Independent 𝑡 =
samples 𝑠^𝑋 −𝑋
1 2
^𝑠 𝑋 1 − 𝑋2 =
√( 𝑆𝑆 1+ 𝑆𝑆2
𝑛 1+ 𝑛2 − 2 )( 1 1
+
𝑛1 𝑛2 )
𝑋 1− 𝑋 2
=66.75
=56.00
= 66.75 – 56.00
= 10.75
^
𝑠𝑋 − 𝑋
1 2
t
𝑋 1 − 𝑋 2 − ( 𝜇 1 −𝜇 2 )
𝑡=
𝑠^𝑋 −𝑋
1 2
𝑋 1 − 𝑋 2 =10.75
^𝑠 𝑋 − 𝑋2 = 2.561738
1
10.75 − 0
𝑡= =4.19637
2.561738
Degrees of Freedom
df = n1 +n2 – 2
=4+4-2
=6
tcrit (df=6; 1-tailed, α=.05)
APA style results
• An independent groups t test was used to
compare the effect of a Aspirin and a placebo
on heart rate. Heart rate for the Aspirin group,
56.00 bpm (SD= ???), was found to be
significantly lower at an alpha level of .05 than
for the Placebo group, 66.75 bpm (SD = ???),
t(6) = 4.20, p<.05 (1-tailed).
SD
Note homogeneity of variance
APA style results
• An independent groups t test was used to
compare the effect of a Aspirin and a placebo
on heart rate. Heart rate for the Aspirin group,
56.00 bpm (SD= 3.65), was found to be
significantly lower at an alpha level of .05 than
for the Placebo group, 66.75 bpm (SD = 3.59),
t(6) = 4.20, p < .05 (1-tailed).
SPSS: Data entry
SPSS
Box Plot
SPSS
SPSS
Test of homogeneity
of variance
t(df), p
APA style results
• An independent groups t test was used to
compare the effect of Aspirin and a placebo
on heart rate. Mean heart rate for the Aspirin
group, 56.00 bpm (SD= 3.65), was found to be
significantly lower at an alpha level of .05 than
for the Placebo group, 66.75 bpm (SD = 3.59),
t(6) = 4.20, p = .003 (1-tailed).
Preview: CI Calculation
¯ 1− 𝑋
¯ or 𝑋
1) Score of interest, 𝑋 ¯ 2or 𝐷
¯
2) Standard error of mean (SE),
𝜎 𝑋¯ ^𝑠 𝑋¯ ^𝑠 𝑋¯ − 𝑋¯ ^𝑠 𝐷¯
1 2
or or or
3) Two-tailed critical value of the statistic,
zcrit or tcrit
Upper limit =
VCritical score
value willofdepend
interest
on+confidence
(critical value)
level x SE
required and df (for tcrit)
Lower limit = score of interest - (critical value) x SE
CI Calculation
Independent groups t-test
¯ 1− 𝑋
𝑋
1) Score of interest, ____ ¯2
2) Standard error of distribution (SE), ^𝑠 𝑋¯ − 𝑋¯
1 2
3) Two-tailed critical value of the statistic,
tcrit(df) (alpha = 5%, ALWAYS 2-tailed)
Upper limit = score of interest + (critical value) x SE
Lower limit = score of interest - (critical value) x SE
CI Calculation
Independent groups t-test
¯
𝑋
1) Score of interest, ____
1 − ¯
𝑋 2 =10.75
^𝑠 𝑋¯ − 𝑋¯ =2.562
2) Standard error of distribution (SE),
1 2
3) Two-tailed critical value of the statistic,
tcrit(df) (alpha = 5%, ALWAYS 2-tailed)
tcrit(6) = 2.447 (α=.05, two-tailed)
Upper limit = score of interest + (critical value) x SE
= 10.75 + 2.447*2.562 = 17.019
Lower limit = score of interest - (critical value) x SE
= 10.75 - 2.447*2.562 = 4.481
CI Calculation
Correlated groups t-test
1) Score of interest, 𝐷 ¯
2) Standard error of distribution (SE), ^𝑠 𝐷 ¯
3) Two-tailed critical value of the statistic,
tcrit(df) (alpha = 5%, ALWAYS 2-tailed)
Upper limit = score of interest + (critical value) x SE
Lower limit = score of interest - (critical value) x SE
CI Calculation
Correlated groups t-test
Upper limit = score of interest + (critical value) x SE
Lower limit = score of interest - (critical value) x SE
¯
𝐷=2 ^𝑠 𝐷¯ =0.8944 tcrit(9)=2.262
Upper Limit
2+2.262 ∗ 0.8944=4.023
Lower limit
2 −2.262 ∗ 0.8944=− 0.023
SPSS Output
CI
APA style conclusion
• A correlated groups t-test with an alpha level of
5% was used to compare the mean pupil
diameter in millimetres of 10 smokers before and
after they smoked a marijuana cigarette. There
was a mean difference of 2mm (SD=2.8), with
pupil size larger after smoking, but this difference
was not statistically significant, t(9) = 2.236, p
= .052 (two-tailed). The 95% confidence interval
for the mean difference was -0.02 to 4.02 mm
EXTRAS (not covered in lecture)
• Might be use if you want to work through
another example in SPSS, Excel or by hand
A numerical example …
• Question: Should you buy generic or brand
name batteries?
• “A stats student” tests 6 batteries from a well-
known maker and 6 generics. He/she records
total playing time on his/her iPod with volume
set to maximum.
Example adapted from Bock, Velleman & De Veaux (2007)
“Stats: Modelling the world” Pearson Education
Design
• What is the DV? _________________
• Is it Nominal, Ordinal, Interval or Ratio?
• What is the IV? _________________
• Is IV varied within or between “participants”?
• How many levels does the IV have? _________
• What are they? _________ or __________
• N (Total no. of ‘participants’) = ___
• n1 (Group 1 ‘participants’) = ___
• n2 (Group 2 ‘participants’) = ___
Design
• What is the DV? Playing time (minutes)
• Is it Nominal, Ordinal, Interval or Ratio?
• What is the IV? Type of battery
• Is IV varied within or between “participants”?
• How many levels does the IV have? 2
• What are they? Brand name or Generic
• N (Total no. of ‘participants’) = 12
• n1 (Group 1 ‘participants’) = 6
• n2 (Group 2 ‘participants’) = 6
Independent samples
Hypotheses
• Null Hypothesis
• µgeneric= µbrand_name
• The mean playing time for generic batteries is the
same as for brand name batteries
• Alternative Hypothesis
• µgeneric ≠ µbrand_name
• The mean playing time for generic batteries is NOT
the same as for brand name batteries
Paying time (minutes)
Brand name Generic
194.0 190.7
205.5 203.5
199.2 203.5
172.4 206.5
184.0 222.5
169.5 209.4
Assumptions
• Independent and random selection?
• Normally distributed populations?
• Equal variances?
J&B p296-297
Box Plot
Box Plot
Max
Upper hinge
Median “Outlier”
Lower hinge
Min
What we need to calculate
¯ 1− 𝑋
𝑋 ¯ 2 −(𝜇 1 − 𝜇2 )
Independent 𝑡=
samples 𝑠^ ( 𝑋¯ − 𝑋¯ ) 1 2
^𝑠 𝑋 1 − 𝑋2 =
√( 𝑆𝑆 1+ 𝑆𝑆2
𝑛 1+ 𝑛2 − 2 )( 1 1
+
𝑛1 𝑛2 )
Descriptive statistics
• Mean Grp. 1, 𝑋¯ 1=¿ ¯= Σ ( 𝑋 )
¯ 2=¿ 𝑋
• Mean Grp. 2, 𝑋 𝑁
• SS1 =
• SS2 = ^𝑠 =√ 𝑠^ =
2
√
𝑆𝑆
𝑁 −1
(∑ 𝑋 )
2
𝑆𝑆=∑ 𝑋 −
2
𝑁
Data
Brand 2 Generic
name (X1) 𝑋 1 (X2) 𝑋
2
2
194.0 37636.00 190.7 36366.49
205.5 42230.25 203.5 41412.25
199.2 39680.64 203.5 41412.25
172.4 29721.76 206.5 42642.25
184.0 33856 222.5 49506.25
169.5 28730.25 209.4 43848.36
∑ 1124.60 211854.90 1236.10 255187.85
Descriptive statistics
• Mean Grp. 1, 𝑋¯ 1=¿ 187.433 ¯= Σ ( 𝑋 )
• Mean Grp. 2, ¯ 2=¿ 206.017 𝑋
𝑋 𝑁
(∑ 𝑋 )
2
𝑆𝑆=∑ 𝑋 −
2
𝑁
• SS1 = 211854.9 – (1126.6)2/6 = 1067.373
• SS2 = 255187.85 – (1236.1)2/6 = 530.648
• n1 = 6
• n2 = 6
√
^𝑠 =√ 𝑠^ =
2 𝑆𝑆
𝑁 −1
Standard deviation
^𝑠 =√ 𝑠^ =
2
√ 𝑆𝑆
𝑁 −1
• Variance = SS/(N-1)
=1067.373/5 = 213.475 (Group 1)
= 530.648/5 = 106.130 (Group 2)
• sd = √(Variance)
= √(213.475) = 14.611 (Group 1)
= √(106.130) = 10.302 (Group 1)
Check homogeneity of variance
Calculate
^𝑠 𝑋 1 − 𝑋2 =
√( 𝑆𝑆 1+ 𝑆𝑆2
𝑛 1+ 𝑛2 − 2 )( 1 1
+
𝑛1 𝑛2 )
𝑆 𝑆1=1067.373 𝑆 𝑆2=530.648 𝑛1=𝑛2=6
^𝑠 𝑋 − 𝑋 =
1 2 (√
1067.373+530.648
6+6 −2
1 1 2
)( ) √
+ = 159.8021 =7.29845
6 6 6 ()
Calculate t-value
¯ 1− 𝑋
¯ 2 −(𝜇 1 − 𝜇2 ) 𝑋 1=187.433
𝑋
𝑡= 𝑋 1=206.017
𝑠^ ( 𝑋¯ − 𝑋¯ )
1 2
^𝑠 𝑋 − 𝑋 =7.29845
1 2
187.433− 206.017
𝑡= =−2.546
7.29845
Degrees of freedom (df) and t-crit
𝑑𝑓 =𝑛1 +𝑛2 −2
= 10
• tcrit(10) two-tailed hypothesis, alpha = 5%
= _____
tcrit (2-tailed)
Decision rule
Is
|tobs|>|tcrit|?
YES: Reject the NO: Retain the
null hypothesis null hypothesis
APA style results
An independent groups t test was used to
compare the mean lifetime of brand name (M
= 187.4 min, SD = 14.6 min) and generic (M =
206.0 min, SD = 10.3 min) batteries. The
difference was found to be statistically
significant at an alpha level of .05, t(10) = -
2.55, p<.05, with generic batteries lasting 18.6
(SE 7.3) minutes longer on average.
SPSS Output
Descriptives
SPSS Output
Test of homogeneity of variance
Assumption violated if sig <.05
SPSS Output
t-value, df and p
APA style conclusion
• An independent groups t test was used to
compare the mean lifetime of brandname (M
= 187.4 min, SD = 14.6 min) and generic (M =
206.0 min, SD = 10.3 min) batteries. The
difference was found to be statistically
significant at an alpha level of .05, t(10) = -
2.55, p=.029 (two-tailed), with generic
batteries lasting 18.6 minutes longer on
average.
Preview: CI Calculation
¯ 1− 𝑋
¯or 𝑋
1) Score of interest, 𝑋 ¯ 2or 𝐷
¯
2) Standard error of mean (SE),
𝜎 𝑋¯ ^𝑠 𝑋¯ ^𝑠 𝑋¯ − 𝑋¯ ^𝑠 𝐷¯
1 2
or or or
3) Two-tailed critical value of the statistic,
zcrit or tcrit
Upper limit =
VCritical score
value willofdepend
interest
on+confidence
(critical value)
level x SE
required and df (for tcrit)
Lower limit = score of interest - (critical value) x SE
CI Calculation
Independent groups t-test
1) Score of interest, ____
2) Standard error of distribution (SE),
______
3) Two-tailed critical value of the statistic,
______ (df = _____) (alpha = 5%)
Upper limit = score of interest + (critical value) x SE
Lower limit = score of interest - (critical value) x SE
CI Calculation
Independent groups t-test
¯ 1− 𝑋
𝑋
1) Score of interest, ____ ¯2
2) Standard error of distribution (SE), ^𝑠 𝑋¯ − 𝑋¯
1 2
3) Two-tailed critical value of the statistic,
tcrit(df) (alpha = 5%, ALWAYS 2-tailed for
Conidence Intervals)
Upper limit = score of interest + (critical value) x SE
Lower limit = score of interest - (critical value) x SE
CI Calculation
Independent groups t-test
Upper limit = score of interest + (critical value) x SE
Lower limit = score of interest - (critical value) x SE
¯ 1− 𝑋
𝑋 ¯ 2 =18.58 3̇ ^𝑠 𝑋¯ − 𝑋¯ =7.298 tcrit(10)=2.228
1 2
Upper Limit
18.58 3̇+2.228 ∗7.29845=− 2.322
Lower limit
18.58 3̇ − 2.228∗ 7.296=−34.845
SPSS Output
CI
APA style conclusion
• An independent groups t test was used to
compare the mean lifetime of brandname (M =
187.4 min, SD = 14.6 min) and generic (M =
206.0 min, SD = 10.3 min) batteries. The
difference was found to be statistically significant
at an alpha level of .05, t(10) = -2.55, p=.03, with
generic batteries lasting 18.6 minutes longer on
average. The 95% confidence interval for the
mean difference was 2.3 to 34.9 minutes