I have a dataset which shows the states (3 states) across 11 time points for each participant. I wanted to estimate the Markov Chain state transition probability matrices for time points 2-11 using R. I read both `markovchain`

and `HiddenMarkov`

package documentations, but did not see any examples similar to what I planned to do. The most relevant example is the one listed under `MarkovchainFit`

(in `markovchian`

package), but it seems to me the data entry is a sequence of states (not a sequence of states for an each individual participant), and there is only one transition matrix calculated. I appreciate any suggestions. That is also great if any other statistical software can support the calculation. Thank you!

**Contents**hide

#### Best Answer

The current version of markovchain package has implemented a function to address your issue.

`library(markovchain) data(holson) mcListFist<-markovchainListFit(data=holson[,2:12],name="holson") `

### Similar Posts:

- Solved – Creating a probability transition matrix
- Solved – EM algorithm to estimate discrete Markov chain transition probabilities
- Solved – EM algorithm to estimate discrete Markov chain transition probabilities
- Solved – How to draw state diagram for first order Markov chain for 10000bases from 2 chromosomes
- Solved – Markov chains that do not contain all the states in the model