STAT1301 Lecture 1: Introduction: Prof. Dirk P. Kroese
STAT1301 Lecture 1: Introduction: Prof. Dirk P. Kroese
Lecture 1: Introduction
I Dr Ian Wood
Course Coordinator and Lecturer — second half
I Mr John Cohen
Course Administrator
I 1 hour exam
I Multiple choice
There are typically seven steps taken for any scientific study. Let’s
introduce these steps via a toy example.
1. Research question:
2. Design experiment:
1 50 100
Figure 1: The dark bars indicate when Heads (=1) appears.
1 50 100
Figure 1: The dark bars indicate when Heads (=1) appears.
1 50 100
Figure 1: The dark bars indicate when Heads (=1) appears.
Does this mean that the coin is not fair, or is this outcome simply
due to chance?
Prof. Dirk P. Kroese Lecture 1 18/27
Example: Is a given coin fair?
5. Model for data: A key concept in Statistics is to realise that our
single dataset from a single experiment is one of many datasets
we could have seen (but just didn’t get to see).
1 50 100
6. Analyse model:
We will learn a formula later that tells us that for a fair coin the
probability that X takes a value of 60 or more, is about 0.028.
We will learn a formula later that tells us that for a fair coin the
probability that X takes a value of 60 or more, is about 0.028.
[1] 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0
[29] 1 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 0 1 0 0 0 0
[57] 0 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 1 0 0
[85] 1 0 1 0 0 0 0 0 1 1 1 1 0 0 1 1
[1] 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0
[29] 1 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 0 1 0 0 0 0
[57] 0 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 1 0 0
[85] 1 0 1 0 0 0 0 0 1 1 1 1 0 0 1 1
[1] 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0
[29] 1 0 0 1 0 0 1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 1 1 1 0 0 1 1
[1] 48
[1] 54
[1] 38
Prof. Dirk P. Kroese Lecture 1 22/27
Example: Is a given coin fair?
> data.we.could.have.seen
= replicate(1000, sum(sample(coin, 100, replace = T)))
> data.we.could.have.seen
= replicate(1000, sum(sample(coin, 100, replace = T)))
> data.we.could.have.seen
[1] 43 47 56 54 49 45 46 51 41 47 48 44 54 53 43 54 46 49
[19] 48 44 47 52 53 39 44 52 53 45 52 57 49 54 48 56 42 47
[37] 42 46 44 47 49 46 51 53 59 57 50 45 51 55 50 53 60 53
...
[973] 45 49 42 53 54 51 56 46 49 48 53 46 55 37 47 49 51 54
[991] 50 49 49 50 57 35 44 49 45 52
> data.we.could.have.seen
= replicate(1000, sum(sample(coin, 100, replace = T)))
> data.we.could.have.seen
[1] 43 47 56 54 49 45 46 51 41 47 48 44 54 53 43 54 46 49
[19] 48 44 47 52 53 39 44 52 53 45 52 57 49 54 48 56 42 47
[37] 42 46 44 47 49 46 51 53 59 57 50 45 51 55 50 53 60 53
...
[973] 45 49 42 53 54 51 56 46 49 48 53 46 55 37 47 49 51 54
[991] 50 49 49 50 57 35 44 49 45 52
> data.we.could.have.seen
= replicate(1000, sum(sample(coin, 100, replace = T)))
> data.we.could.have.seen
[1] 43 47 56 54 49 45 46 51 41 47 48 44 54 53 43 54 46 49
[19] 48 44 47 52 53 39 44 52 53 45 52 57 49 54 48 56 42 47
[37] 42 46 44 47 49 46 51 53 59 57 50 45 51 55 50 53 60 53
...
[973] 45 49 42 53 54 51 56 46 49 48 53 46 55 37 47 49 51 54
[991] 50 49 49 50 57 35 44 49 45 52
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[10] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[19] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[28] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[46] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
...
[991] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[1000] FALSE
[1] 21
[1] 21
[1] 21
[1] 0.021
[1] 21
[1] 0.021
We can either:
I accept that the coin is fair and that we just happened to see a
rather rare occurrence;
We can either:
I accept that the coin is fair and that we just happened to see a
rather rare occurrence; or
I do not accept that we’ve been so unlucky, and instead
suspect that the coin is rigged.
You have already carried out your first scientific study and
statistical hypothesis test!
You have already carried out your first scientific study and
statistical hypothesis test!
You have already carried out your first scientific study and
statistical hypothesis test!