data handling & analysis bd7054 2012-2013 andrew jackson zoology, school of natural sciences...

10
Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences [email protected]

Upload: lily-tucker

Post on 16-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

Data Handling & AnalysisBD7054

2012-2013

Andrew JacksonZoology, School of Natural Sciences

[email protected]

Page 2: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

Introduction to Hypothesis Testing

An Experiment Flipping coins

Page 3: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

A simple experiment

• Question:– Does adding weight to a coin make it unfair?– Blu-tac added to head side

• Need to construct testable hypotheses– The null hypothesis

Page 4: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

Weighted coin toss

• Toss the coin 10 times• What is the hypothesis about how you

think your system will behave?– More likely to get heads– Less likely to get heads– Either more or less likely to get heads

• What are the corresponding null hypotheses?– That the coin is fair

Page 5: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

Behaviour of a fair coin

• The model is a fair 50:50 coin• How do we generate information about

how a fair coin behaves?– Toss an un-weighted

coin 10 times and repeat

Page 6: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

Behaviour of weighted coin

• Compare the weighted coin against the expected behaviour of a fair coin

• Question– How likely is it that our observed coin is fair?

Page 7: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

Behaviour of weighted coin

0 1 2 3 4 5 6 7 8 9 10

0.001 0.01 0.04 0.12 0.21 0.25 0.21 0.12 0.04 0.01 0.001

Page 8: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

Alternative hypotheses

• HA: coin is more likely to produce heads– One-tailed test in right tail

• HA: coin is less likely to produce heads– One-tailed test in left tail

• HA: coin is unfair (in either direction)– Two-tailed test including both left and right

tails

Page 9: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

P-values

• A p-value is the probability of your observed data or more extreme being generated according to the null hypothesis

• The less likely your data are, the less likely you would accept the null hypothesis as being true– We generally use a cut-off of p<0.05 to accept the

alternative hypothesis• One or two tailed tests refer to where you

predict your alternative hypotheses to lie before you do your experiment

Page 10: Data Handling & Analysis BD7054 2012-2013 Andrew Jackson Zoology, School of Natural Sciences a.jackson@tcd.ie

Summary

• Science is about constructing experiments or designing observations to test your ideas about how the world works

• Hypotheses must be falsifiable• Generally we construct null hypotheses

against which our alternative hypotheses can be tested

• p-values tell us how likely it is our data came from the null hypothesis and therefore allow us to accept or reject it (H0)