ka-fu wong © 2007 econ1003: analysis of economic data supplement8-1 additional real-life examples...

11
Supplement8-1 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement 8: Additional real-life examples Additional real-life examples (proportions) (proportions) *The part of biasedness (including the proof) is a result of a correspondence between Dr. Ka-fu Wong and YueShen Zhou. The example was drawn from a clip sent over by Nipun Sharma. Use it at your own risks. Comments, if any, should be sent to [email protected].

Post on 22-Dec-2015

224 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-1 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Supplement 8: Additional real-life examples Additional real-life examples (proportions)(proportions)

*The part of biasedness (including the proof) is a result of a correspondence between Dr. Ka-fu Wong and YueShen Zhou. The example was drawn from a clip sent over by Nipun Sharma. Use it at your own risks. Comments, if any, should be sent to [email protected].

Page 2: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-2 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Mean and variance (1)

Suppose a proportion p of the population is female. An observation is randomly drawn from the population. Code x = 1 if the drawn observation is female. Code x = 0 if the drawn observation is male. What is the population mean and variance of this random variable X?

E(X) = (1)Prob(x=1) + (0)Prob(x=0) = (1)p + (0)(1-p) = p

Var(X) = (1-p)2Prob(x=1) + (0-p)2Prob(x=0) = (1-p)2p + p2(1-p) = (1-p) p [1-p + p] = (1-p)p

Page 3: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-3 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Mean and variance (2)

Suppose a proportion p of the population is female. A sample of n observations is randomly drawn with replacement from the population. Code x = 1 if a drawn observation is female, 0 otherwise. What is the population mean and variance of m = (x1+…+xn)/n?

E(m) = E[(x1+…+xn)/n] = [E(x1) + E(x2) + … + E(xn)]/n= E(X) = p

Var(m) = Var[(x1+…+xn)/n] = Var[(x1+…+xn)]/n2 = [Var (x1)+…+Var(xn)]/n2 = Var(X)/n = (1-p)p/n

Page 4: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-4 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Central limit theorem of proportion

Let x1,…,xn be a iid sample from a population with p proportion of success.

(Failure coded as 0 and success as 1.)

∑xi/n is simply the proportion of success and hence the simple average of the outcomes from the n trials.

∑xi/n will be approximately normal according to CLT.

n

pppNp

n

xp

n

i i

)1(,~ˆ

ˆ 1

Page 5: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-5 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Do you think Chinese officials spent too much government money on the following?

Base on a poll of 18,000 persons.

Page 6: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-6 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Can we construct the 95% confidence intervals for the population proportion?

Standard error= [p(1-p)/n]1/2

n p std errorlower limit upper limit

18000 0.958 0.001495103 0.95507 0.9609303

18000 0.862 0.002570733 0.856961 0.8670385

18000 0.86 0.002586289 0.854931 0.865069

18000 0.85 0.002661453 0.844784 0.8552164

18000 0.807 0.00294157 0.801235 0.8127654

18000 0.802 0.002970185 0.796179 0.8078215

18000 0.679 0.003479775 0.67218 0.6858202

18000 0.5 0.00372678 0.492696 0.5073044

Page 7: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-7 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Why would some books used a different formula?

The population proportion is unknown. Thus, an estimate of the variance of sample proportion will be

n

pppVar

n

pppNp

n

xp

n

i i

)1()ˆ(

)1(,~ˆ

ˆ 1

?)ˆ1(ˆ

)ˆ(n

ppparEstimatedV

n

pp

n

ppE

n

pp

n

ppE

)1(

1

)ˆ1(ˆ

)1()ˆ1(ˆ

When n is large, the difference between two estimators of sample variance are negligible. This is why some books use n, some use (n-1).

Page 8: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-8 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Why would some books used a different formula?

n

pppVar

n

pppNp

nxp

)1()ˆ(

))1(

,(~ˆ

n

pp

n

ppE

n

pp

n

ppE

)1(

1

)ˆ1(ˆ

)1()ˆ1(ˆ

When n is large, the difference between two estimators of sample variance are negligible. This is why some books use n, some use (n-1).

is a biased estimator for n

pp )ˆ1(ˆ n

pp )1(

is an unbiased estimator for 1

)ˆ1(ˆ

n

ppn

pp )1(

Page 9: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-9 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Proof: A biased estimator

n

pp

n

n

n

ppn

pppnpn

npppnpn

pn

ppp

n

pEpVarpn

pEpEn

ppEnn

ppE

)1(1)1()1(

)1()1(1

)1(1

)1(1

])ˆ()ˆ([1

)]ˆ()ˆ([1

)ˆˆ(1)ˆ1(ˆ

2

2

22

2

2

2

2

Page 10: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-10 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

Proof: An unbiased estimator

n

pp

nn

ppn

pppnpnn

npppnpnn

pn

ppp

n

pEpVarpn

pEpEn

ppEnn

ppE

)1(

)1(

)1()1(

)1()1()1(

1

)1()1(

1

)1(

1

1

])ˆ()ˆ([1

1

)]ˆ()ˆ([1

1

)ˆˆ(1

1

1

)ˆ1(ˆ

2

2

2

2

2

Page 11: Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Supplement8-1 Additional real-life examples (proportions) Supplement 8: Additional real-life examples

Supplement8-11 Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data

- END -

Supplement 8: Supplement 8: Additional real-life examplesAdditional real-life examples