Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Tabulation of a variable against itself lagged


From   Iulian Ihnatov <iulian.ihnatov@uaic.ro>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Tabulation of a variable against itself lagged
Date   Sun, 18 Sep 2011 22:56:57 +0300

I managed to solve the issue. Thank you very much, your help was very valuable.
Here is the code I wrote:

*********************************
insheet using regimuri.csv, delimiter(";")
gen id=_n
reshape long y, i(id) j(year)
encode indicatorname, gen(varnum)
drop id indicatorname
egen id=group(countrycode year)
reshape wide y, i(id) j(varnum)
rename y1 regime
label var regime "Regime"
encode countrycode, gen(wbcode)
xtset wbcode year
order id wbcode year country countrycode regime
gen regime_2=L.regime
label var regime_2 "Regime (previous year)"
by year, sort : tabulate regime regime_2
***********************************

--
Regards,
Iulian Ihnatov


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index