Bookmark and Share

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

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

Re: st: roll rates

From   Austin Nichols <>
Subject   Re: st: roll rates
Date   Sat, 23 Apr 2011 08:48:05 -0400

Nick Cox <>, Argyn Kuketayev

-xttrans- does not seem to respect gaps in time within panel, where
someone estimating transition probabilities would want to, but -tab-
works fine if you define the appropriate lag variable, and -svy:tab-
works better, if you have weighted and/or clustered data, or you want
to test something.

webuse nlswork
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]

On Fri, Apr 22, 2011 at 7:58 PM, Nick Cox <> wrote:
> . h xttrans
> On Sat, Apr 23, 2011 at 12:25 AM, Argyn Kuketayev
> <> wrote:
>> i wonder if Stata has a package for pool roll rate analysis.
>> the roll rates are probabilities of transitions between asset's
>> states, such as credit grades. let's say, we have N assets, each can
>> be in one of the states S. some of these states are end-states, i.e.
>> once an asset gets into this state, it exits the pool.
>> so we can observe monthly asset states, and transitions between them.
>> the assumptions is that all assets have the same state transition
>> probabilities, and that these probabilities remain constant over time
>> (stationary). i need to estimate the probabilities of transitions
>> between states. one can think of a matrix with rows corresponding to
>> an asset state this month, and the columns are states in next month.
>> so sum of columns in each row is 100%. each cell is a probability of
>> transition from row state to column state.
>> what would be the most straightforward way to estimate the transition
>> probability matrix (roll rates) in Stata?
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index