I’m currently running an HSMM model with 3 groups to get the probability of state transitions for all subjects (R code of O’Connell et al.). After that, I’d like to have the states for all subjects and observe the probability of state transitions for each group, but I’m not sure how to tinker with the code. enter image description here
testrun <- hsmmfit(Datanew, model1,mstep=mstep.mvnorm, lock.transition=FALSE, maxit=1000, lock.d=FALSE)
This code already runs the model with all subjects, so it can’t pull out subgroups. If I try to do the inverse based on the state sequence for each individual, the outcomes are strange. In the state transition model, the hsmmspec function does not allow the transition matrix to have a non-zero diagonal, but my result shows a value greater than or equal to 0.9.
EYOUNG JUNG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.