Title: Inference for Proportions
1Inference for Proportions
- Cord Heuer
- EpiCentre, Massey University
2counts proportions
3Herd level mastitis data
4Normal, so why bother??
5(No Transcript)
6Plot this
7Better create intervals
8 and plot again
9Proportions
- disease prevalence
- test 200 sheep
- 76 positive
- 76/200 0.38 or 38
- Bernoulli process 2 possible outcomes
- follows a binomial distribution
10Binomial Distribution
P of x positive in a sample of 18 when p0.178
P
x
11Binomial Distribution n100
P 0.3
n 100
12Binomial Distribution n10
P 0.3
n 10
13Distributions for statistics
- 3 Parameters
- population ?,
- sample p,
- sampling distribution ?,
14Normal approximations to binomial distribution
- provided sample size is large enough
or
t
15Normal approximation to binomial distribution
- how big is big enough?
- If np ? 9 or 10
- AND
- n(1 - p) ? 9 or 10
16Confidence interval
- confidence interval for mean proportion
17n Z2 variance / L2
L 0.2P
18L may overlap zero
19Source J.L. Fleiss, 1981 Statistical methods
for rates and proportions. 2nd ed. John Wiley
Sons Inc., New York
20Single proportion hypothesis test
- Assume population proportion p0
- Collect a single sample (n) and measure
proportion p-hat
21Look up P-value for z (or t)
1-sided or 2-sided
22Two proportions
23Two proportions
- H0 p1 p2 HA p1 ? p2
- need a pooled variance
- first find
assumption of equal variances
24Two proportions
- then get SEM for the difference p1 - p2
- then estimate a z-statistic
assumption of equal variances
252 proportions unequal variances
26Small sample binomial procedures
- when sample size is small, normal approximations
dont hold - have to use the exact binomial distribution -
awkward to deal with
27Binomial distribution - exact
- B(n,p) n number of trials
- p proportion of success in each trial
Probability of exactly f successes
28Miscarriage in chip workers
- Population miscarriage rate 0.178
- H0 p ? 0.178
- HA p gt 0.178
- n18 number of miscarriages7
- p 0.389
how likely is this to occur if the true rate is
0.178?
29- need to use
- complicated formula
- and sum possible
- outcomes
- p lt 0.05
302 x 2 table
- Alternative to normal approximation
- Very widely used
- Example
P 10/500 0.02
Ho 2 proportions are equal
312 x 2 table
- Want to compare the observed 2x2 table with a
table expected by chance alone - Difference is chi-square distributed
- D ?(obs exp)2 / exp
32D is Chi2 distributed
df3
?2df1 Z2
33Review
or
One sample tests
DF n-1
34Two sample t-tests
Equal variances
DF n1 n2 - 2
Pooled variance
352-Sample t-test
Unequal variances
or use smaller of n1-1 and n2-1
361 proportion inference
Proportion
Confidence interval
One sample inference
372 proportion inference
Pooled variance estimate assuming equal variances
382 proportion inference
Unequal variances denominator made up of
individual variances
39Binomial distribution - exact
- B(n,p) n number of trials
- p proportion of success
- in each trial
Probability of exactly f successes