Professional Documents
Culture Documents
Hypothesis Testing (T-Test and ANOVA)
Hypothesis Testing (T-Test and ANOVA)
Hypothesis Testing (T-Test and ANOVA)
A D V A N C E D D ATA A N A LY S I S
ANNOUNCEMENTS
IN PSYCHOLOGY
The Psychological Health Society is organizing a Research
LECTURE #3: Outreach Workshop on Thursday, January 28th. The workshop
HYPOTHESI S TESTI NG: T- TESTS & ANOVA will be highlighting critical email writing skills to help students
successfully achieve research opportunities. All attendees will
also receive a free booklet with a directory of all psychology
professors, emails and lab websites.
Link: https://www.eventbrite.ca/e/research-outreach-workshop-
tickets-136754571605
ANNOUNCEMENTS ANNOUNCEMENTS
Unrelated to the course:
Contact: aa.thesis.study@outlook.com
3 4
1
1/27/21
5 6
2
1/27/21
T-TESTS
Today, we will learn about the differences between a z-test and a
t-test, as well as the three types of t-tests that exist:
3. Paired-samples t-test
The fix: t-tests!
9 When you come back to this slide to study for your exams, ask yourself:
10
Is it better to use a t-test or a z-test, if given the option to choose either. Explain.
REVIEW
3
1/27/21
ONE-SAMPLE T-TEST
3. Check assumptions. (Finally!)
When you come back to this slide to study for your exams, ask yourself:
13 14
How might small Ns influence assumptions? What about outliers?
15 16
4
1/27/21
17 18
19 20
5
1/27/21
21 When you come back to this slide to study for your exams, ask yourself:
22
How might small Ns influence assumptions? What about outliers?
REVIEW
17.17 25.66
'$& '&& +
+ 10 10 sample
($ (& sample
sample
sample
5. Compare to the critical value (1.96...?); reject or fail-to-reject H0. sample
sample
sample sample
sample Population
sample
sample
sample
sample sample
sample
sample
23 24
6
1/27/21
REVIEW REVIEW
Frequency
$
!" =
%
Sample Means
REVIEW
27 28
7
1/27/21
-1.96 1.96
The t distribution will change depending
on your sample size.
Remember: The larger the sample size, the smaller the variability
will be within the sampling distribution
29 30
t distribution (df = 2)
31 When you come back to this slide to study for your exams, ask yourself:
32
What are the similarities and differences between the normal and t distributions?
8
1/27/21
-4.303 4.303
When you come back to this slide to study for your exams, ask yourself: When you come back to this slide to study for your exams, ask yourself:
33 34
If you didn’t adjust the critical values when using a t-test, how would this affect statistical errors? Why is normality a necessary assumption for testing a hypothesis using a t-test?
35 36
9
1/27/21
When you come back to this slide to study for your exams, ask yourself:
37 38
What are the z and t distributions the same? Are they ever the same?
... therefore, the area under the curve is also not static...
39 40
(Appendix D, Page 620 in the textbook)
10
1/27/21
3. Find your
degrees of
freedom.
For an
independent-
sample t-test,
df = N - 2.
41 42
11
1/27/21
45 46
Children who underwent musical training did not have significantly Since we rejected the null hypothesis, one of two things
different dyslexia scores than the children who did not receive musical could have actually happened:
training, t(18) = -0.90, p > .05.
REJECT H0
In this case, we have evidence that the deviation between the
sample and population means was not different than what would
be expected due to chance or random error.
... But are you sure of this finding? There is an effect of music training There is no effect of music training
on dyslexia in reality, and you have on dyslexia in reality, and you have
... Can you ever be 100% sure of anything in statistics...?
correctly rejected the null. committed a Type I error.
47 48
12
1/27/21
A Type I Error is when you incorrectly reject the null hypothesis. A Type I Error is when you incorrectly reject the null hypothesis.
This is when you find a significant difference but you are not supposed to. This is when you find a significant difference but you are not supposed to.
A false positive. A false positive.
#$
49 50
A Type I Error is when you incorrectly reject the null hypothesis. Likewise, if you were to fail-to-reject the null hypothesis, one
of two things could have actually happened:
This is when you find a significant difference but you are not supposed to.
A false positive.
FAIL-TO-REJECT H0
μ0 μ1 Critical cut-off
Using this sample mean, you
would reject the null
hypothesis, even though you
shouldn’t have rejected it. There is no effect of music training There is an effect of music training
TYPE I ERROR. on dyslexia in reality, and you have on dyslexia in reality, and you have
correctly failed-to-reject the null. committed a Type II error.
!"
51 52
13
1/27/21
A Type II Error is when you incorrectly fail-to-reject the null hypothesis. A Type II Error is when you incorrectly fail-to-reject the null hypothesis.
This is when you do not find a significant difference when you were supposed to. This is when you do not find a significant difference when you were supposed to.
A false negative. A false negative.
In this case, would you reject What about now? Would you
the null hypothesis? reject the null hypothesis?
Yes! μ1 falls into the critical No! !" does not falls into the
region. critical region.
53 54
This is when you do not find a significant difference when you were supposed to.
TYPE I – yes. The Type I error rate for an experiment is equal to
A false negative. the alpha criterion (default = 0.05)
Critical cut-off TYPE II – yes, but only indirectly. You can figure out your Type II
μ0 μ1 error rate by calculating your statistical power:
Using this sample mean, you
would fail-to-reject the null Type II error = 1 - Power
hypothesis, even though you
should have rejected it. Power: the probability of rejecting the null hypothesis when the
alternative hypothesis is true.
TYPE II ERROR.
! Increasing power reduces your Type II error rate.
When you come back to this slide to study for your exams, ask yourself:
How do the assumptions (or violations to the assumptions) affect Type I and Type II error rates? 55 56
14
1/27/21
Fail To Reject H0 Correct Failure to Type II Error Fail To Reject H0 Correct Failure to Type II Error
Reject (β) Reject (β)
(1-α) (1-α)
Alpha (α) is 0.05 (i.e., the default cut off If you have a 5% chance of making a
we use). You have a 5% chance of Type I error, then you are 95% sure your
making a Type I error in an experiment. results are not an error (100% minus 5%).
This is your confidence interval.
57 58
Fail To Reject H0 Correct Failure to Type II Error Fail To Reject H0 Correct Failure to Type II Error
Reject (β) Reject (β)
(1-α) (1-α)
Unfortunately, there is no way of calculating the This is power (1- β). This is the chance of
probability of making a Type II error…You can finding an existing effect. Researchers try
minimize this by increasing the probability of to aim for a minimum power of 0.8 (80%).
correctly rejecting a false H 0 (i.e., power).
59 60
15
1/27/21
α (one-tailed)
α/2 (two-tailed)
To help you visualize the relationships, move the critical value to the left and to the right.
When you come back to this slide to study for your exams, ask yourself:
How do alpha, beta, confidence and power change? 61 62
How do the assumptions (or violations to the assumptions) affect power?
POWER POWER
Power can be increased in three ways: Power can be increased in three ways:
1. By increasing the size of the difference between the 2. By increasing the number of observations, or sample size.
expected and the observed (i.e., effect size). • An increase in sample size will result in a smaller SEM, resulting
• The larger the difference between your experimental groups, in a “skinnier” distribution. Critical values are also less strict.
the more likely it is that you will find significant results (duh).
• Not feasible
Critical cut-off Critical cut-off
μ0 μ1 μ0 μ1
When you come back to this slide to study for your exams, ask yourself: When you come back to this slide to study for your exams, ask yourself:
63 64
How do the assumptions (or violations to the assumptions) affect power? How do the assumptions (or violations to the assumptions) affect power?
16
1/27/21
POWER POWER
Power can be increased in three ways: Power can be increased in three ways:
2. By increasing the number of observations, or sample size. 3. By reducing the error variance in the dependent variable.
• An increase in sample size will result in a smaller SEM, resulting • The smaller the variance/noise the greater the power.
in a “skinnier” distribution. Critical values are also less strict.
• Feasible – easiest/quickest resolution! Power analysis (next week!)
Critical cut-off Critical cut-off
μ0 μ1 μ0 μ1
When you come back to this slide to study for your exams, ask yourself: When you come back to this slide to study for your exams, ask yourself:
65 66
How do the assumptions (or violations to the assumptions) affect power? How do the assumptions (or violations to the assumptions) affect power?
POWER T-TESTS
Power can be increased in three ways: Today, we will learn about the differences between a z-test and a
3. By reducing the error variance in the dependent variable. t-test, as well as the three types of t-tests that exist:
• The smaller the variance/noise the greater the power.
1. One-sample t-test
• Feasible – Use a paired-samples t-test.
2. Independent-samples t-test
Critical cut-off
μ0 μ1
3. Paired-samples t-test
When you come back to this slide to study for your exams, ask yourself: When you come back to this slide to study for your exams, ask yourself:
67 68
How do the assumptions (or violations to the assumptions) affect power? Is it better to use a t-test or a z-test, if given the option to choose either. Explain.
17
1/27/21
71 72
18
1/27/21
When you come back to this slide to study for your exams, ask yourself:
73 74
How might small Ns influence assumptions? What about outliers?
19
1/27/21
77 78
79 80
20
1/27/21
81 82
When the null is true, these two estimates will be the same.
But when the null is false… let’s see! X
Non-Musicians Musicians
21
1/27/21
Frequency
X X
Non-Musicians
Musicians Non-Musicians Musicians
85 86
87 88
22
1/27/21
No Training Musical Training There are two ways of estimating population variance:
Mean 18.94 20.8 ∑ &'(
Variance 17.17 25.66 !"# = ü Error estimate (σ2e )
)
SD 4.14 5.07
+,.+, .(#0.11)
SEM 1.31 1.60 = 2. Treatment estimate (σ2t)
#
N 10 10
= 21.415
This is MSError What the heck is the treatment estimate?!
89 90
You need to quantify how much the sample means deviate μNM μGRAND μM
from the overall mean, also known as the grand mean.
∑("'()*),
/0# = 1!"# !"# =
Frequency
-(.
91 92
23
1/27/21
YES!
Frequency
93 94
95 96
24
1/27/21
97 98
99 100
25
1/27/21
= 19.87
101 102
Descriptive Statistics: How much does 18.94 deviate How much does 20.8 deviate
from the grand mean? from the grand mean?
No Training Training
Mean 18.94 20.8 How much does 20.8 (18.94 − 19.87)* = 0.8649 (20.8 − 19.87)* = 0.8649
Variance 17.17 25.66 deviate from the grand
SD 4.14 5.07
mean? 0.8649 * 10 = 8.649 0.8649 * 10 = 8.649
SEM 1.31 1.60 (19.87 − 20.8)
N 10 10 = 0.93 Sum the squared deviations (SS): 8.649 + 8.649 = 17.298
23.*45
Find the average squared deviations (MS):
672
= 17.298 This is MSTreatment
Note: What we are calculating here is really just the formula for variance,
103 104
except with means instead of scores.
26
1/27/21
EXAMPLE – ANOVA
Going back to our original example…
F = t2
$%&'()*+(,* /0.234
F = $%-''.'
=
2/.5/6
= 0.81
105 106
27