Eric R. Schmidt
2011-Feb-25 02:14 UTC
[R] Markov chain transition model, data replication project
Hello all, I am currently attempting to replicate data from a political science article that utilized a Markov chain transition model to predict voter turnout intention at time *t*; the data was separated into two different models based on whether prior intent was to vote or not to vote. The details don't really matter. Mostly I am curious how to run a Markov chain transition model in R, estimating different coefficients for two prior conditions. I have tried installing and running numerous packages, including elrm and MCMC, but I don't think this calls for Monte Carlo simulation. (The transition matrix in this case, after all, would be only 2 x 2, and the models are pretty simple). If someone could point me in the right direction I would greatly appreciate it.... ES [[alternative HTML version deleted]]
Giovanni Petris
2011-Feb-25 21:47 UTC
[R] Markov chain transition model, data replication project
On Thu, 2011-02-24 at 21:14 -0500, Eric R. Schmidt wrote:> Hello all, > > I am currently attempting to replicate data from a political science article > that utilized a Markov chain transition model to predict voter turnout > intention at time *t*; the data was separated into two different models > based on whether prior intent was to vote or not to vote. The details don't > really matter. > > Mostly I am curious how to run a Markov chain transition model in R, > estimating different coefficients for two prior conditions. I have tried > installing and running numerous packages, including elrm and MCMC, but I > don't think this calls for Monte Carlo simulation. (The transition matrix > in this case, after all, would be only 2 x 2, and the models are pretty > simple). If someone could point me in the right direction I would greatly > appreciate it.... >There may be a package that does the calculations for you, but it is a simple matter of normalizing each row of the matrix of observed transition counts to a probability. Something like> prop.table(X, margin = 1)should do, where X is the 2x2 matrix of transition counts. Hope this helps, Giovanni> ES > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Giovanni Petris <GPetris at uark.edu> Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris/