Fitting probability models to frequency data - PowerPoint PPT Presentation

About This Presentation
Title:

Fitting probability models to frequency data

Description:

Degrees of freedom for day of birth. df = 7 - 1 - 0 = 6. Finding the P-value. Critical value ... with respect to the day of the week. Assumptions of c2 test ... – PowerPoint PPT presentation

Number of Views:67
Avg rating:3.0/5.0
Slides: 61
Provided by: michaelw93
Category:

less

Transcript and Presenter's Notes

Title: Fitting probability models to frequency data


1
Fitting probability models to frequency data
2
Review - proportions
  • Data discrete nominal variable with two states
    (success and failure)
  • You can do two things
  • Estimate a parameter with confidence interval
  • Test a hypothesis

3
Estimating a proportion
4
Confidence interval for a proportion
where Z 1.96 for a 95 confidence interval
The Agresti-Couli method
5
Hypothesis testing
  • Want to know something about a population
  • Take a sample from that population
  • Measure the sample
  • What would you expect the sample to look like
    under the null hypothesis?
  • Compare the actual sample to this expectation

6
not so weird
weird
7
Sample
Null hypothesis
Test statistic
Null distribution
compare
How unusual is this test statistic?
P gt 0.05
P lt 0.05
Reject Ho
Fail to reject Ho
8
Binomial test
9
Test statistic
  • For the binomial test, the test statistic is the
    number of successes

10
Binomial test
11
The binomial distribution
12
Binomial distribution, n 20, p 0.5
x
13
Binomial distribution, n 20, p 0.5
Test statistic
x
14
P-value
  • P-value - the probability of obtaining the data
    if the null hypothesis were true
  • as great or greater difference from the null
    hypothesis

15
P-value
  • Add up the probabilities from the null
    distribution
  • Start at the test statistic, and go towards the
    tail
  • Multiply by 2 two tailed test

16
Binomial distribution, n 20, p 0.5
P 2(Pr16Pr17Pr18 Pr19Pr20)
x
17
Sample
Null hypothesis
Test statistic
Null distribution
compare
How unusual is this test statistic?
P gt 0.05
P lt 0.05
Reject Ho
Fail to reject Ho
18
N 20, p0 0.5
This is a pain.
19
Calculating P-values
  • By hand
  • Use computer software like jmp, excel
  • Use tables

20
Sample
Null hypothesis
Test statistic
Null distribution
compare
How unusual is this test statistic?
P gt 0.05
P lt 0.05
Reject Ho
Fail to reject Ho
21
Discrete distribution
  • A probability distribution describing a discrete
    numerical random variable

22
Discrete distribution
  • A probability distribution describing a discrete
    numerical random variable
  • Examples
  • Number of heads from 10 flips of a coin
  • Number of flowers in a square meter
  • Number of disease outbreaks in a year

23
c2 Goodness-of-fit test
  • Compares counts to a discrete probability
    distribution

24
Hypotheses for c2 test
25
Test statistic for c2 test
26
(No Transcript)
27
(No Transcript)
28
Hypotheses for day of birth example
29
(No Transcript)
30
The calculation for Sunday
31
(No Transcript)
32
The sampling distribution of c2 by simulation
Frequency
c2
33
Sampling distribution of c2 by the c2 distribution
34
Degrees of freedom
  • The number of degrees of freedom specifies which
    of a family of distributions to use as the
    sampling distribution

35
Degrees of freedom for c2 test
df Number of categories - 1 - (Number of
parameters estimated from the data)
36
Degrees of freedom for day of birth
df 7 - 1 - 0 6
37
Finding the P-value
38
Critical value
The value of the test statistic where P a.
39
12.59
40
(No Transcript)
41
(No Transcript)
42
Plt0.05, so we can reject the null
hypothesis Babies in the US are not born
randomly with respect to the day of the week.
43
(No Transcript)
44
Assumptions of c2 test
  • No more than 20 of categories have Expectedlt5
  • No category with Expected ? 1

45
c2 test as approximation of binomial test
  • If the number of data points is large, then a c2
    goodness-of-fit test can be used in place of a
    binomial test.
  • See text for an example.

46
The Poisson distribution
  • Another discrete probability distribution
  • Describes the number of successes in blocks of
    time or space, when successes happen
    independently of each other and occur with equal
    probability at every point in time or space

47
(No Transcript)
48
Poisson distribution
49
Example Number of goals per side in World Cup
Soccer
Q Is the outcome of a soccer game (at this
level) random? In other words, is the number of
goals per team distributed as expected by pure
chance?
50
World Cup 2002 scores
51
Number of goals for a team(World Cup 2002)
52
Whats the mean, m?
53
Poisson with m 1.26
54
Finding the Expected

Too small!
55
Calculating c2
56
Degrees of freedom for poisson
df Number of categories - 1 - (Number of
parameters estimated from the data)
57
Degrees of freedom for poisson
df Number of categories - 1 - (Number of
parameters estimated from the data)
Estimated one parameter, ?
58
Degrees of freedom for poisson
df Number of categories - 1 - (Number of
parameters estimated from the data) 5 - 1 - 1
3
59
Critical value
60
Comparing c2 to the critical value
So we cannot reject the null hypothesis. There
is no evidence that the score of a World Cup
Soccer game is not Poisson distributed.
Write a Comment
User Comments (0)
About PowerShow.com