You are on page 1of 46

COMPARING MEANS

Z-TEST LIMITATIONS
➤ We rarely have complete information about
the population of interest, especially σ. And we
need to have a sufficiently large sample.
➤ We estimate using the t-statistic!
T-TEST
➤ We need a good estimate of the missing
population parameter (𝜎)
➤ If our sample is randomly selected, sample s will
approximate the population 𝜎, but it is biased.
➤ The larger our sample size, the closer s will be
to the true population 𝜎.

2 2
∑ ( X − µ ) ∑ ( X − X )
σX = sX =
N N −1
T-DISTRIBUTIONS
➤ There are many t-distributions, one for each
possible df.

z
When df > 120, df = 120
the t-distribution
becomes just like a df = 60
standard normal
distribution df = 20
T-DISTRIBUTION

σx is known (z-test) σx is unknown (t-test)

Sampling
Sampling
distribution
distribution
of means sX̄
of means σX̄
-3σX̄ -2σX̄ -1σX̄ μ 1σX̄ 2σX̄ 3σX̄ -3sX̄ -2sX̄ -1sX̄ μ 1sX̄ 2sX̄ 3sX̄

X −µ ( X − µ)
z= tobt =
σX sX
s X2 sX
sX = =
N N
TYPES OF T-TESTS

Compares a single sample mean to the population


One Sample t-test
mean when σ is unknown

Two sample Compares the means of two independent samples


independent t-test (participants are in one sample or the other, not both)

Two sample Compares the means of two dependent samples


dependent t-test (participants are in both samples)
One Sample t-test
Assumptions of a one-sample t-test

➤ Random sampling
➤ Interval or ratio measure
➤ Relatively normally-distributed population
➤ Population µ is known
➤ Population σ is estimated by sample s
One Sample t-test
Assume a recent survey by AUB Tobacco-Free Task Force reported
the average number of cigarette breaks smokers take while on campus
was 9.8 and the standard deviation was 8.5. These data were based on
feedback from 55 UG tobacco smokers at AUB. Assume that prior to
the policy change, the population of tobacco smokers at AUB were
known to take 12.5 cigarette breaks while on campus. Has smoking
behavior changed since the university implemented the new policy?
Use hypothesis-testing to determine whether the average number of
cigarettes breaks taken by students on campus has changed since
AUB implemented the new policy.

What is μ? Is 𝜎 known?
One Sample t-test

Step 1: State the hypotheses

Step 2: Set up sampling distribution & critical t

Step 3: Compute obtained t

Step 4: Compare obtained t to critical t

Step 5: Report Results


One Sample t-test - Step 1
Assume a recent survey by AUB Tobacco-Free Task Force reported the average
number of cigarette breaks smokers take while on campus was 9.8 and the
standard deviation was 8.5. These data were based on feedback from 55 UG
tobacco smokers at AUB. Assume that prior to the policy change, the population
of tobacco smokers at AUB were known to take 12.5 cigarette breaks while on
campus. Has smoking behavior changed since the university implemented the new
policy? Use hypothesis-testing to determine whether the average number of
cigarettes breaks taken by students on campus has changed since AUB
implemented the new policy.

Alternative hypothesis (HA) Null hypothesis (H0)


The sample of UG tobacco smokers at AUB The sample of UG tobacco smokers at AUB
come from different population. They do come from the same population. They take
not take 12.5 cigarette breaks, on average, 12.5 cigarette breaks, on average, while on
while on campus. campus.

μ≠ 12.5 μ= 12.5
One Sample t-test - Step 2

μ=12.5

Rejection Region(s)
Critical Value(s)
⍺ = .05
tcrit = -2.02 and 2.02
One or two tailed? TWO
df = N-1 = 55 - 1 = 54
One Sample t-test - Step 2

μ=12.5

tcrit = -2.02 tcrit = 2.02

Rejection Region(s)
Critical Value(s)
⍺ = .05
tcrit = -2.02 and 2.02
One or two tailed? TWO
df = N-1 = 55 - 1 = 54
One Sample t-test - Step 3
Assume a recent survey by AUB Tobacco-Free Task Force reported the
average number of cigarette breaks smokers take while on campus was
9.8 and the standard deviation was 8.5. These data were based on
feedback from 55 UG tobacco smokers at AUB. Assume that prior to the
policy change, the population of tobacco smokers at AUB were known to
take 12.5 cigarette breaks while on campus. Has smoking behavior
changed since the university implemented the new policy? Use
hypothesis-testing to determine whether the average number of cigarettes
breaks taken by students on campus has changed since AUB implemented
the new policy.

s X2 s ( X − µ ) = 9.8 - 12.5
sX = = X = 8.5/ sqrt( 55) = 1.15
N N tobt =
sX 1.15
= -2.36
One Sample t-test - Step 4

Fail to Reject
H0 Ha Reject H0
H0
tobt < tcrit The evidence
Left
μ≥ μ< The sample average is less than the supports the null
Tailed
population average. hypothesis.
tobt > tcrit The evidence
Right
μ≤ μ> The sample average is greater than the supports the null
Tailed
population average. hypothesis.
tobt more extreme than tcrit The evidence
Two
μ= μ≠ The sample average is different from supports the null
Tailed
the population average. hypothesis.
One Sample t-test - Step 5
Assume a recent survey by AUB Tobacco-Free Task Force reported the
average number of cigarette breaks smokers take while on campus was
9.8 and the standard deviation was 8.5. These data were based on
feedback from 55 UG tobacco smokers at AUB. Assume that prior to the
policy change, the population of tobacco smokers at AUB were known to
take 12.5 cigarette breaks while on campus. Has smoking behavior
changed since the university implemented the new policy? Use
hypothesis-testing to determine whether the average number of cigarettes
breaks taken by students on campus has changed since AUB implemented
the new policy.

Based on these data, I reject the null hypothesis. The average


number of cigarette breaks among UG smokers at AUB is
significantly lower than the population average prior to the new
policy, t(54) = -2.36, p< .05, two tailed.
One Sample t-test - follow up analyses
If the results of our analyses reveal a significant difference between the
sample mean and the null hypothesis mean, then the evidence suggests
that the true mean is not equal to the null hypothesis.

But we still don’t know what the true mean is!

Use confidence intervals to represent the probable range of the true


population mean.

A confidence interval is the range that includes the unknown population


mean (that our sample comes from) some proportion of the time
(typically (1 - ⍺) = .95 or 95% of the time)
CONFIDENCE INTERVALS

This results in one value below the


man, and one above it.

CI = X̄ ± tcrit (sX̄ )
The CI is centered on Standard error - variability
our sample mean associated with the sample
mean

T-statistic associated with our


desired level of certainty.
Always two tailed
CONFIDENCE INTERVALS
Going back to our example:

CIlower = 9.8 - 2.02(1.15) = 7.47


CIupper = 9.8 + 2.02(1.15) = 12.12

95% Confidence Interval for the true population mean is


[7.47, 12.12].

Is this interval is consistent with the results of our


hypothesis test?
EFFECT SIZE
We can also include an estimate of the effect size
associated with our hypothesis test.

Unstandardized effect size:


The difference between our sample mean and the null
hypothesis mean (i.e., X̄ - μ). It is in the units of the
raw data and can’t be compared with other effect sizes.

Standardized effect size:


The difference between our sample mean and the null
hypothesis mean in terms of standard deviation. We
have two types: Cohen's d and Pearson’s correlation
EFFECT SIZE FOR ONE SAMPLE T-TEST

Cohen’s d Standardized
Correlation Coefficient
X̄ - μ

d
d=
Sx r= √
r
t2
t2 + n -1

0.2 Small 0.1 Small


0.5 Medium 0.3 Medium
1.2 V. Large 0.5 V. Large
Two sample independent t-test
When researchers want to compare two
separate (independent) samples
- Commonly, comparing means.

Are two sample means statistically significantly


different from one another? How likely is it that
the two samples came from the same population?
Two sample independent t-test

μ=0

If there is no difference between the means, their difference would be


equal to ZERO.
Two sample independent t-test
How do we determine s X̄ 1 - X̄ 2 ?
We don’t know the population parameters ⍺1 or ⍺2 .

We use the sample standard deviations to estimate.


From which sample?
Two sample independent t-test
Our sampling distribution for H0 is constructed by the
difference between sample means from 2 populations,
so the variance of both samples must be accounted for.

Our variance calculation must be weighted by the


sample size.
WHY?
Larger samples are better estimates of variance!
Two sample independent t-test
The weighted average of the variances is called
pooled variance.
variance of sample 1 variance of sample 2
df of sample 1 df of sample 2
2 2
2 (n1 − 1) s + (n2 − 1) s
1 2
s pool =
(n1 − 1) + (n2 − 1)

Total df
Two sample independent t-test
Now we have pooled variance, but we need the
standard error of the difference in means

2 ⎛1 1⎞
s X 1 − X 2 = (s pool )⎜⎜ + ⎟⎟
⎝ n1 n2 ⎠

We now have all the pieces we need to conduct a


hypothesis test of the difference between 2 sample
means.
Two sample independent t-test
Assumptions of a two-sample independent t-test

➤ Random sampling
➤ Interval or ratio measure
➤ Relatively normally-distributed population
➤ Samples are independent
➤ Variances of the two samples are equal
Two sample independent t-test
A researcher is interested in evaluating whether there are SES differences
in young children’s preferential learning from an informant who uses a
passive voice vs an active voice. Thirty six children between 4 and 5 years
from low SES backgrounds and 29 children from high SES backgrounds
participated in a study in which two informants told a story. One
informant used passive voice and another used active voice. After the
story phase, the two informants provided conflicting testimony about the
names of novel objects over 6 trials. Children were asked to decide what
the novel object was called. The average number of trials in which
children trusted the informant who used a passive voice was calculated
for the two groups. Use a hypothesis test to evaluate whether there are
differences between groups. High SES Low SES
Mean 5.5 4.3
SD 1.2 1.4
Two sample independent t-test

Step 1: State the hypotheses

Step 2: Set up sampling distribution & critical t

Step 3: Compute obtained t

Step 4: Compare obtained t to critical t

Step 5: Report Results


Two sample independent t-test - Step 1

H0: There is no difference between the 2 sample


means. (μ1 - μ2 = 0)

H1: There is a difference between the 2 sample


means. (μ1 - μ2 ≠ 0)
Two sample independent t-test - Step 2

μ=0

Rejection Region(s)
Critical Value(s)
⍺ = .05
tcrit = ±2.00
One or two tailed? TWO
df =(n1-1) + (n2 - 1) = (36-1) + (29-1) =63
Two sample independent t-test - Step 2

μ=0

tcrit = -2.00
tcrit = 2.00
Rejection Region(s)
Critical Value(s)
⍺ = .05
tcrit = ±2.00
One or two tailed? TWO
df =(n1-1) + (n2 - 1) = (36-1) + (29-1) =63
Two sample independent t-test - Step 3
1. Compute pooled variance 2 2
2 (n1 − 1) s + (n2 − 1) s
1 2
s pool =
(n1 − 1) + (n2 − 1)
4. Compute standard error

2 ⎛1 1⎞
s X 1 − X 2 = (s pool )⎜⎜ + ⎟⎟
⎝ n1 n2 ⎠
8. Compute the t-statistic (tobt).
̄1- X
X ̄2
tobt =
s X̄ 1 - X̄ 2
Two sample independent t-test - Step 4

tobt = 3.72 > tcrit = 2.00


Reject H0

Two sample independent t-test - Step 5


1. Based on these data, I reject the null hypothesis. Children
from high SES backgrounds trust passive speakers(M=5.5,
SE=0.2) significantly more than children from low SES
backgrounds (M=4.3, SE=0.26), t(63) = 3.72, p<.05, two
tailed.
Two sample independent t-test - Follow up
̄1- X
95% CI = (X ̄ 2) ± tcrit(spooled)(
√ 1
n1
+
1
n2
)

Cohen’s d

̄1- X
d= (X ̄ 2)
spooled
Two sample dependent t-test
When researchers want to compare two related
samples.
- Commonly, repeated measures where the
same individuals are in both “groups”.
Why would a researcher want to test the
same individuals on multiple occasions?
1. Minimizes the differences “between” groups
2. Increases power
Two sample dependent t-test
Like independent sample t-tests, related sample
t-tests are used to assess whether there is a
statistically significant difference between two
group means.

In the context of a two sample dependent t-


test, the hypotheses are about the mean
difference between groups (μD).
Two sample dependent t-test
Assumptions of a two sample dependent t-test

➤ Random sampling
➤ Interval or ratio measure
➤ Relatively normally-distributed population
➤ Samples are dependent, related
➤ Variances of the two samples are equal
Two sample dependent t-test
TYPES OF T-TESTS
Ten randomly selected psychology
X1 X2 X2 - X1
10 9 -1
students were asked how
7 9 2
important they thought statistics is
3 6 3
for their future careers before and
7 8 1 after taking their first course in
1 5 4 statistics. Conduct a dependent
3 7 4 samples t-test to assess whether
5 9 4 students’ attitudes towards
6 10 4 statistics changed after taking their
4 7 3 first course.
2 5 3
D 2.70
SD 1.64
Two sample dependent t-test

Step 1: State the hypotheses

Step 2: Set up sampling distribution & critical t

Step 3: Compute obtained t

Step 4: Compare obtained t to critical t

Step 5: Report Results


Two sample dependent t-test - Step 1
H0: Students attitudes will not change.(μD = 0)

H1: Students attitudes will change. (μD ≠ 0)


Two sample dependent t-test - Step 2

μD=0

Rejection Region(s)
Critical Value(s)
⍺ = .05
tcrit = ±2.26
One or two tailed? TWO
df =N-1 = 9
Two sample dependent t-test - Step 2

μD=0

tcrit = -2.26
tcrit = 2.26
Rejection Region(s)
Critical Value(s)
⍺ = .05
tcrit = ±2.26
One or two tailed? TWO
df =N-1 = 9
Two sample dependent t-test - Step 3


2
s 453 .
1.64
D 40
2
sD = == 50.38 = 7.10
= 0.52
N 9
10

D − µ D + 37.98 − 0
tobt = == 2.70 - 0 = 5.19= 5.35
sD 7
0.52
.10
Two sample dependent t-test - Step 4

tobt=5.19 > tcrit = ±2.26

Two sample dependent t-test - Step 5


Based on these data, we reject the null
hypothesis. Appreciation for statistics was
significantly higher after students took a statistics
course (M=7.5, SE=0.56) compared to before
(M=4.8, SE=0.87), t(9)=5.19, p<.05, two-tailed.
Two sample dependent t-test - Follow-up
Cohen’s d 95% Confidence Interval

D
D D ± tcrit(sD)
d= =
sD sD
2
2.70 - 2.26(0.52) = 1.52

=2.70 =1.65 2.70 + 2.26(0.52) = 3.88


1.64
[1.52, 3.88]

You might also like