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

st: panel problems


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: panel problems
Date   Thu, 10 Nov 2005 01:24:49 -0000

Paola Pierina Lazarte Castillo [mailto:[email protected]] sent 
me this. I don't know why she [?] sent it privately. In her 
first question, I guess she hasn't installed -levels- and/or 
her version of Stata is too old to support it. -levelsof- 
is the official command in Stata 9. 

--------------------------
I�m trying to test electoral cycles in variables like social expenditure, expenditure on education and health for Latin america. As you will know, we don�t have databases as good as developed countries have, so i have an unbalanced panel data here. 
My dependent variable is expenditure (education, health, social) and independent variables are poverty (percentage of population under the poverty line) and GDP. I have two questions. 
I almost have 500 observations and for GDP i have to use hpfilter for detrending, i followed your code (changing for my variables of course)

gen hppredict = . 
levels country, local(C) 
qui foreach c of local C { 
	hpfilter myvar if country == `c' 
	replace hppredict = H_myvar if country == `c' 
	drop H_myvar 
}  

but stata tells me "invalid levels", what am i doing wrong, please? is the sequence ok?

My second question is related with the unbalanced panel data. i don�t know if unbalanced panel data are quite diferent than balanced in terms of commands, is the estimation  the same way as in the case of balanced panel data? I�m asking you because all my results are wrong, i�m trying with this: 

xtpcse salud tasapbi analfa elect new
xtpcse educa tasapbi analfa elect, het
xtpcse educa tasapbi analfa elect, het corr(ar1)
xtreg educa tasapbi analfa elect, be wls
xtreg educa tasapbi analfa elect, fe

Are there special comands for estimation with unbalanced panel data?

---------------------------------- 

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