Statalist The Stata Listserver


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

Re: st: Inconsistency with the 5 year avarage panel data set


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: Inconsistency with the 5 year avarage panel data set
Date   Wed, 26 Apr 2006 16:54:34 -0400

To be honest, I didn't read through all your code, or try it out on a
sample dataset, but I suspect that the section labeled "Creates 5-year
period indicator" is introducing the error.  Try this instead (and
also investigate whether you have missing years or duplicate years
within ifscode values):

iis ifscode;
tsset ifscode year;
*** Creates 5-year period indicator;
gen indpd =year-mod(year,5);
**** Creates 5-year averages ;
collapse (min) year ifscode (mean)  tot_exp cap_exp
curr_exp odanet2 real_gdp_pc  mor_inf  agr_gdp lag_agr
litadu_pop system  allhouse yrcurnt exelec exconst
legelec pr military state yrsoffc oda_yr oda_sys
oda_house oda_ex oda_leg  oda_pr oda_mil oda_const
oda_st oda_offc , by(name indpd);

On 4/26/06, ilker kaya <[email protected]> wrote:
> Dear Austin,
>
> Here is the code that I am using for sorting and
> taking 5 year avarages. I hope this part would be
> enough to tell if there is anyting wrong.
> ifscode is unique for each country in my data file and
> year is between 1960-2002.
> Thank you very much.
> Regards,
>
> ilker

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