Markov multi-state models to longitudinal data

80 Views Asked by At

I am trying to use the MSM package to model transition rates. I have data at two time periods: baseline and then at follow-up. The participants could be in any of the 3 stages at baseline and then either remain in the same stage, transition forward or backward, or died/LoF at the follow-up period. I am using the MSM r package, but I am not sure if this analysis is correct for my data (based on what I have read). I am not sure if the MSM Markov model allows people to be in different stages at baseline or does everyone have to be in the same stage at baseline? Another question that I have is whether I can run this analysis with only two follow-up periods since all examples that I have come across have multiple follow-up times?

Here is the code that I used to run my model. For context, I am interested in the hazard rate of transition where people either remain in the same stage or transition forward (i.e., excluded people that transition backwards from stage 3-2, 3-1, or 2-1).

Any help is much appreciated.


library(msm)

Q <- rbind (c(0, 1, 1, 1),
            c(0, 0, 1, 1),
            c(0, 0, 0, 1),
            c(0, 0, 0, 0))

psor.msm <- msm(Stages_status ~ time,
                subject = ID,
                data = newdata, 
                qmatrix = Q,
                covariates = ~ age + sex + education, 
                control = list(maxit = 100000), hessian = TRUE,
                exacttimes=TRUE, censor=999,
                gen.inits=TRUE)
print(psor.msm)

I have tried the code pasted above. While I am getting the results, the numbers seem to not make much sense. For example: For the covariate age, I have 3 categories: young (ref), middle-age, older age. Here are the raw number of people transitioning from stage 2 to 3 by age categories: 86 in younger, 186 in middle age, and 120 in older. Overall, there are 4052 younger, 6298 middle age, and 1756 older people. However, for this particular transition, the results showed that the hazard rate of transitioning from stage 2 to 3 is lower in middle and older age groups compared to younger. I am not sure why I am getting such results since I should be excepting to get a higher hazard rate in the oldest age group compared to the younger group.

0

There are 0 best solutions below