Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: roll rates


From   Clive Nicholas <[email protected]>
To   [email protected]
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
<[email protected]>. 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index