[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Inconsistency with the 5 year avarage panel data set
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.
sort ifscode year;
tsset ifscode year;
*** Creates 5-year period indicator;
gen indpd = . ;
label var indpd "Indicates the period number of 5-year
replace indpd = 1 if year == 1960 ;
replace indpd = 1 if indpd[_n-5] == 1 & ifscode[_n-5]
== ifscode ;
sort ifscode indpd year ;
replace indpd = indpd[_n-1] + 1 if indpd == 1 &
ifscode == ifscode[_n-1];
sort name year ;
replace indpd = indpd[_n-1] if indpd == . & ifscode ==
**** 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);
--- Austin Nichols <firstname.lastname@example.org> wrote:
> Hard to know what is going on w/o more detail on the
> problem ("I
> checked the do file and it seems everthing is fine"
> is not enough
> detail) but I am guessing that it has something to
> do with your sort
> order when constructing five-year averages. What
> sequence of commands
> are you using?
> On 4/26/06, ilker kaya <email@example.com> wrote:
> > Dear All,
> > I have a panel data-time series data set between
> > 1960-2002. I am taking 5 yaer avarages and running
> > FE regreession. However each time the result is
> > changing. I checked the do file and it seems
> > is fine. When I run the same regressions with
> > data there is no such problem. Is any of you
> > experienced a similar problem previously. Thank
> you in
> > advance.
> > Regards,
> > ilker Kaya
> * For searches and help try:
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
* For searches and help try: