Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Stata 9 --> sepov is not recongnizing the svyset variables. Any ideas?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Stata 9 --> sepov is not recongnizing the svyset variables. Any ideas?
Date   Thu, 19 Oct 2006 22:22:25 +0100

Jeff Pitblado has kindly confirmed my guess that if you 
want -sepov- to be up-to-date it needs to use 
a call to -svy: mean-. 

Here is a second version of -sepov2- (still
untested!): 

*! 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

Nick 
n.j.cox@durham.ac.uk 

Nick Cox 
 
> -sepov- has this provenance: 
> 
> STB-51  sg117 . . Robust std errors for 
> Foster-Greer-Thorbecke poverty indices
>         (help sepov if installed) . . . . . . . .  D. 
> Jolliffe and A. Semykina
>         9/99    pp.34--36; STB Reprints Vol 9, pp.200--203
>         provides estimates of standard errors for the Foster-Greer-
>         Thorbecke class of poverty indices; handles complex survey
>         designs including stratification and multi-stages
> 
> As such, the problem may lie in the fact that the program authors 
> were not aware of changes to Stata to be introduced in 2005. 

< snip > 
 
> *! sepov2 NJC 19 Oct 2006 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index