Biometry Lecture 6 Posted
Biometry Lecture 6 Posted
testing
Hypothesis testing
• Hypothesis testing, like
estimation, uses sample data to
make inferences about the
population
• Unlike estimate, hypothesis
testing asks only whether the
__________________________
__________________________
Hypothesis testing
• Estimation asks, “how large is
the effect?”
https://youtu.be/lgs7d5saFFc
Hypothesis testing
• Hypothesis testing involves
comparing results with two
expectations (hypotheses)
1. The null hypothesis (Ho) –there
is no relationship, no effect
• Null mean “nothing”, nada, no
association
• This is your default, or primary
expectation
Hypothesis testing
• The assumption of the null is
intended to protect the integrity
of your conclusions
• By forcing you to consider the
idea of no relationship or no
effect, you should be less likely
to jump to a positive conclusion
Hypothesis testing
• Hypothesis testing involves
comparing results with two
expectations (hypotheses)
2. The alternative hypothesis (Ha)
________________________
________________________
________________________
Hypothesis testing
• An example of hypothesis testing
• Polio vaccine was developed by
Jonas Salk
• At one time polio was considered
one of the most frightening public
health problems in the world
Hypothesis testing
• Polio is an infectious disease
caused by the poliovirus
• Effects range from no symptoms
to death
• Can result in life-long disability
Hypothesis testing
• Salk and his team developed an
experiment to test their polio
vaccine
• Their null hypothesis was that the
vaccine didn’t work
• The alternative hypothesis was
that it would work
Hypothesis testing
• Salk’s vaccine was tested on
elementary school students
• 401,974 randomly into two groups
• Treatment group – students who
received the vaccine
• Control group – students who
received a saline injection
• Student were unaware which group
they were in
Hypothesis testing
• Realize that:
• Most students did not get polio,
regardless of what treatment
group they were in
• Vaccines don’t work 100%
Hypothesis testing
• Of those who received the
vaccine, 64 (0.016%) students
developed polio
• While, 229 (0.057%) student in
the control group developed
the disease
Hypothesis testing
• Did the vaccine work, or did
this relatively small difference
arise purely by chance?
• To answer this question requires
evaluating the null hypothesis
• You evaluate the null and not the
alternate because you are starting
from the premise that there is no
effect, the vaccine did not work
Hypothesis testing
• So, to test their null hypothesis
Salk et. al. calculated a
probability
• This probability related the
likelihood that they got their
results____________________
_________________________
Hypothesis testing
• They found the probability was
very small
P-values 1
2
0.00007
0.0006
3 0.0031
4 0.0117
• This is the same data, but in 5 0.0327
table form 6 0.0708
7 0.1214
8 0.1669
9 0.1855
10 0.1669
11 0.1214
12 0.0708
13 0.0327
14 0.0117
15 0.0031
16 0.0006
17 0.00007
18 0.000004
Total 1
Number of right-handed Probability
toads
0 0.000004
P-values 1
2
0.00007
0.0006
3 0.0031
4 0.0117
• This is the same data, but in 5 0.0327
table form 6 0.0708
7 0.1214
8 0.1669
9 0.1855
10 0.1669
11 0.1214
12 0.0708
13 0.0327
14 0.0117
15 0.0031
16 0.0006
17 0.00007
18 0.000004
Total 1
Number of right-handed Probability
toads
0 0.000004
P-values 1
2
0.00007
0.0006
3 0.0031
4 0.0117
• The P-value is the probability 5 0.0327
of obtaining the observed test 6 0.0708
P-values 1
2
0.00007
0.0006
3 0.0031
4 0.0117
• Shown with the table 5 0.0327
6 0.0708
7 0.1214
8 0.1669
9 0.1855
10 0.1669
11 0.1214
12 0.0708
13 0.0327
14 0.0117
15 0.0031
16 0.0006
17 0.00007
18 0.000004
Total 1
Number of right-handed Probability
toads
0 0.000004
P-values 1
2
0.00007
0.0006
3 0.0031
4 0.0117
• All of values summed 5 0.0327
= our P-value = 0.031 6 0.0708
7 0.1214
8 0.1669
9 0.1855
10 0.1669
11 0.1214
12 0.0708
13 0.0327
14 0.0117
15 0.0031
16 0.0006
17 0.00007
18 0.000004
Total 1
P-values
• This means that the probability of an outcome as
extreme or more extreme than 14 out of 18 toads being
right handed is 0.031
Draw the appropriate conclusion
• Is 0.031 small enough?
• By convention, we set our cut off to 0.05
Draw the appropriate conclusion
• In other words, if P is less than or equal to 0.05, then
we reject the null hypothesis
• If P is >0.05, we do not reject
Draw the appropriate conclusion
• In this case, 0.031 is smaller than 0.05, thus we reject
the null that this sample of toads uses both arms
equally as frequent
P-values and confidence intervals
Y axis
5 Does not
include 0
and lower bonds do not 4
3
include 0 2
0 is down
here
P-values and confidence intervals
• You then perform a
hypothesis test with an 10
appropriate statistical 9
<0.05 6
Does not
Y axis
5
3
the time 2
0 is down
here
P-values and confidence intervals
• Thus, if you are interested
in if your estimate is 10
confidence intervals do no 8
Y axis
significant
5
include 0
4
0 is down
here
P-values and confidence intervals
• Imagine your null is that
two means are the
same 18
16
10
Does not
Y axis
overlap
both means, 8
respectively 6
confidence intervals do 0
not overlap
P-values and confidence intervals
• You then apply an
appropriate statistical
model and find that the 18
P = <0.05
16
14
10
Does not
Y axis
overlap
intervals don’t overlap 8
4
likely significant 2
0
Errors in hypothesis testing
• Rejecting or the null hypothesis does not necessarily
mean that the null hypothesis is false
• Likewise, one could fail to reject, when in reality a
difference does exist
Errors in hypothesis testing
• Chance may influence sampling in ways that are difficult
to predict
• Some uncertainty can be quantified, through, if the
data are a random sample, so making rational decisions
is possible
Errors in hypothesis testing
There are two kinds of errors in hypothesis testing
stats)!
• Extensively justify this
decision, and many
would never accept that
justification
Type II error
• Type II error – failing to reject a false null
hypothesis
• In other words, you conclude there is no difference
when there actually is…
• Probability of a Type II errors is directly related to
power
Power
P >0.05 P <0.05
Problems with hypothesis testing
• Science is predicated on the idea that:
1. That you make a statement (a hypothesis) upfront (a priori),
before you have analyzed the data
2. You apply a specific statistical test to evaluate your specific
hypothesis
Do not go on fishing expeditions!
Problems with hypothesis testing
• How to data dredge (do not do this!!!)
• Collect data
• Correlate all your data, looking for relationships that are
significant
• Makeup a story explain your correlations
• Data dredging is a huge problem which undermines the
value of science
https://youtu.be/42QuXLucH3Q
Problems with hypothesis testing
• How to prevent data dredging
• State your hypothesis before you collect data
• If you cannot reject the null you can consider another
hypothesis and test it with the data
• Do not just see what has a relationship, and make-up a story
Problems with hypothesis testing
• There is nothing
biologically relevant
about α = 0.05
https://cran.r-project.org/web/packages/compute.es/index.html
https://cran.r-project.org/web/packages/bootES/index.html