Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: question on bootstrapping of proportions


From   Ernest Berkhout <[email protected]>
To   [email protected], [email protected]
Subject   Re: st: question on bootstrapping of proportions
Date   Fri, 18 Mar 2005 11:49:16 +0100

At 11:31 18/03/2005, Gijs Dekkers wrote:
Now a classical poverty measure quite popular here in Europe is the headcount ratio. One is poor if one's income is below 60 percent of the median income. In stata-syntax

by jaar: summarize income [aweight=weight],detail
by jaar: gen byte poor=income < 0.6*r(p50)
by jaar: tabulate poor [aweight=weight]
For someone using Stata for only 4 days, you're already quite advanced in your code! :-)
The only problem is that the above does not do what you want. The 'r(p50)' is a very temporary thing, and it gets overwritten immediately when you do another summarize. So in practice, you are referring to the median of the last year in your dataset.

I think you want something like:

local beginjaar = 1994
local eindjaar = 2002
foreach jaar = `beginjaar' / `eindjaar' {
summarize income [aweight=weight] if jaar==`jaar',detail
gen byte poor=income < 0.6*r(p50) if jaar==`jaar'
tabulate poor [aweight=weight] if jaar==`jaar'
}

Now you use the r(p50) reference to the median DIRECTLY in your calculation.



Ernest Berkhout
SEO Amsterdam Economics
University of Amsterdam
******************************************************
For information on flexwork & research: www.tempworkresearch.nl ******************************************************
Room 3.08
Roetersstraat 29
1018 WB Amsterdam
The Netherlands

tel.:+ 31 20 525 1657
fax:+ 31 20 525 1686
http://www.seo.nl
===========================
A statistician: someone who insists
on being certain about uncertainty
===========================
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index