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 on April 23, 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   Robson Glasscock <glasscockrc@vcu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Tabulation of a variable against itself lagged
Date   Sat, 17 Sep 2011 17:48:38 -0400

Can you generate a new variable equal to the lag and then tabulate?

best,
Robson Glasscock

On Sat, Sep 17, 2011 at 3:53 PM, Iulian Ihnatov <iulian.ihnatov@uaic.ro> wrote:
> Dear Statalist user,
>
> After a day of research on forums, FAQ etc. I can't find a solution for my
> problem, so I ask for your help.
> I have a cross-section - 190 countries/ 12 years - of the categorical
> variable "regime" (takes 8 values).
> I need to tabulate this variable against itself but lagged one year. The
> table should look like this:
>
>                                                    2009
>  2010 |         1          2          3          4          5          6
>      7          8
> ----------------------------------------------------------------------------------------------
>         1 |        37
>         2 |                    8
>         3 |                              43
>            1
>         4 |                                          6
>            1
>         5 |                                                     5
>         6 |                                                                6
>                          1
>         7 |                               1
>            24           1
>         8 |         1                    1
>           1           48
>
> It seams simple, but I just can't figure out how to do it, so any idea would
> be highly appreciated.
>
> --
> Regards,
> Iulian Ihnatov
>
>
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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