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

st: panel problems

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

Paola Pierina Lazarte Castillo [] 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. 

Im trying to test electoral cycles in variables like social expenditure, expenditure on education and health for Latin america. As you will know, we dont 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 dont 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? Im asking you because all my results are wrong, im 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:

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