Dear Nick, Jeff and Stephen,
Thank you for your prompt replies. They helped me in answering how to use the command estimating poverty -sepov- under the revised svyset command in stata 9. Here's a summary of your responses:
-calling svyset under the old version
Jeff proposed the following solution (if this can address your survey design):
version 8.2: svyset [pw=repweight_s], strata(strata_unique) psu(psu)
The call to -sepov- remains unchanged.
-New version of the program
Nick proposed the following updated version to the program (STILL UNTESTED, LET US KNOW IF YOU HAVE A CHANCE TO FINALIZE IT):
*! sepov2 1.1.0 NJC 19 Oct 2006
* !!! note: assumes variables p0, p1, p2, p`alpha' do not exist !!!
* sepov 1.1.0 27/09/99 sepov.ado [STB-51: sg117]
* Dean Jolliffe, Anastassia Semykina
program sepov2
version 9
syntax varlist [pweight iweight] [if] [in] [, ///
Povline(string) Alpha(real 0) * ]
marksample touse
qui count if `touse'
if r(N) == 0 error 2000
if `alpha' < 0 {
di as err "negative alpha is not allowed"
exit 198
}
foreach v of local varlist {
if `"`: variable label `v''"' != "" {
local lbl `": `: variable label `v''"'
}
else local lbl
gen p0 = `v' < `povline'
gen p1 = p0 * (1 - `v'/`povline')
gen p2 = p0 * (1 - `v'/`povline')^2
di as txt _n(2) "Poverty measures for `v'`lbl'"
if !inlist(`alpha', 0, 1, 2) {
gen p`alpha'= p0 * (1 - `v'/`povline')^`alpha'
local svyvars p0 p1 p2 p`alpha'
}
else local svyvars p0 p1 p2
svy : mean `svyvars' if `touse' [`weight'`exp'], `options'
drop `svyvars'
}
end
-Not use the program at all
Stephen proposed that I just use svy: mean poor rather than going through sepov. More explanation in:
http://econpapers.repec.org/paper/bocasug06/16.htm
Another idea is to add strata, psu, etc. directly into the calling of the program as in
sepov consumption [pw=pweight], p(povline) strata(strata) psu(psu) fcp(samplesize)
(again that will not take into accoutn a very complex survey design)
Thank you all for your time! All my colleagues are using sepov so hopefully this will be useful to a lot of people.
Best,
Anna
*
* 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/