search for: nextt

Displaying 2 results from an estimated 2 matches for "nextt".

Did you mean: next
2006 Jan 23
0
Making a markov transition matrix - more progress
...specific values # of "year". markov <- table(tmp$prev, tmp$new) markov # Gabor's method -- transition.probabilities <- function(D, timevar="year", idvar="name", statevar="state") { stage1 <- merge(D, cbind(nextt=D[,timevar] + 1, D), by.x=timevar, by.y="nextt") v1 <- paste(idvar,".x",sep="") v2 <- paste(idvar,".y",sep="") stage2 <- subset(stage1, stage1[,v1]==stage1[,v2]) v1 <- paste(statevar,".x",sep="&qu...
2006 Jan 22
6
Making a markov transition matrix
Folks, I am holding a dataset where firms are observed for a fixed (and small) set of years. The data is in "long" format - one record for one firm for one point in time. A state variable is observed (a factor). I wish to make a markov transition matrix about the time-series evolution of that state variable. The code below does this. But it's hardcoded to the specific years that I