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: roll rates


From   Clive Nicholas <clivelists@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: roll rates
Date   Sat, 23 Apr 2011 18:13:01 +0100

Austin Nichols replied to Nick Cox and Argyn Kuketayev:

[...]

> webuse nlswork

Nick and Argyn no doubt guessed this for themselves, but for anyone
else playing along

xtset idcode year

should be inserted here for the code to work

> g lmsp=l.msp
> la var lmsp "last month's state"
> note lmsp: not last month, but actually year(s)
> bys idcode (year): g flmsp=msp[_n-1]
> la var flmsp "last observation's state"
> xttrans msp
> ta flmsp msp, nofr row
> * note equivalence above--not period-to-period transitions:
> ta lmsp msp, nofr row
> svyset, srs
> svy:ta lmsp msp, row
> * usually transition matrix has cols sum to 1:
> svy:ta msp lmsp, col
> test _b[p12]=_b[p21]
> test _b[p11]=_b[p22]
> * the above tests equality of cell proportions...
> * to test equality of transition rates use se or ci options:
> svy:ta msp lmsp, col se
> test _b[p12]=_b[p21]
> test _b[p11]=_b[p22]

-- 
Clive Nicholas

[Please DO NOT mail me personally here, but at
<clivenicholas@hotmail.com>. Please respond to contributions I make in
a list thread here. Thanks!]

"My colleagues in the social sciences talk a great deal about
methodology. I prefer to call it style." -- Freeman J. Dyson
*
*   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