Let's say that I have the following dataset containing information for 100 patients that have been followed up for a certain number of years to check if they develop a certain disease. We know up-front that they are at high risk of developing this disease due to their clinical characteristics.
- sample_id: ID for each of the samples in the study.
- sex: sex for each sample.
- visit_number: sequential number of visits that each patient has had. Both, number of visits and interval between visits vary across patients.
- age_at_enrollment: age when the patient entered the study.
- follow_up: number of years that the patient has been followed up since he entered the study.
- status: each of the different stages of the disease that the patient may be at.
- Healthy: patient shows no symptoms of disease.
- Prodromal signs: patient start to show initial symptoms of disease.
- Disease: patient has developed disease and meets some clinical disease criteria.
I want to analyze / plot which is the probability of subjects passing to the next stage of disease (progression), as well as knowing which is the probability that they are misdiagnosed at a certain point in their follow-up.
I'm using R 'msm' package to analyze this dataset, since I think that this is a case of multi-stage model analysis. Here you have a graphical picture of the study design:
In my model there is no final absorbing state, such as death. Patients can move from healthy to prodromal signs (1 -> 2, n = 35) if the symptoms worsen, but they can also move from prodromal signs to healthy (2 -> 1, n = 15) or from disease to prodromal signs (3 -> 2, n = 3) if they were misdiagnosed in their last visit according to the different clinical tests we perform. On top of that, healthy patients can convert into affected ones without having been evaluated in the prodromal state. They may have gone through this phase, but they were not evaluated during this period of time (1 -> 3, n = 1).
When I plot my transitions table I get something like this:
require(mgcv) model <- load("multistatemodel.rda") colnames(data) <- c("sample_id", "visit_number", "age_at_enrollment", "follow_up", "status")
My Q transitions matrix looks like this:
In certain cases, when I use some subsets of my data to apply the msm() function in the following way:
disease.msm <- msm(status ~ follow_up, subject = sample_id, data = data, qmatrix = Q, gen.inits = TRUE)
I get the error:
Optimisation has probably not converged to the maximum likelihood - Hessian is not positive definite.
On top of that, when I try to plot the results of the msm() prediction model, I always get the following error:
Error in plot.msm(disease.msm, from = 1, to = NULL, range = NULL) :
"to" not specified, and no absorbing state in the model
Of course, I know that my model has no absorbing states (Figure 1) since we are not evaluating the death of the patients, but the "reversible" change between disease stages.
I have checked several online tutorials and multi state model books by different authors, but I'm not able to figure out the way of doing the following plots:
- On the one side, plotting either separately or together the "survival curves" of getting worse for both stages of disease (prodromal signs [status = 2] and disease [status = 3])
- On the other side, the probability of getting a misdiagnosis.
I have been working further into this topic and after reviewing the "Ordered multiple events" chapter from the Book "Modeling survival data" by Dr. M.Therneau et al., it looks like I should be using something similar to the following Surv() code.
coxph(Surv(follow_up, as.numeric(status)) ~ sex + cluster(sample_id) + strata(as.numeric(visit_number)), data = data)
However, Surv() only allows for two status: 0 = alive and 1 = death, which is not valid in my case.
Thank you very much,
R version 3.5.1 (2018-07-02) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib locale:  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages:  stats graphics grDevices utils datasets methods base other attached packages:  mgcv_1.8-27 nlme_3.1-137 msm_1.6.7 survminer_0.4.3 ggpubr_0.2 magrittr_1.5 ggplot2_3.1.0  survival_2.43-3 dplyr_0.8.0.1 EnvStats_2.3.1 stringr_1.4.0 withr_2.1.2 data.table_1.12.0 loaded via a namespace (and not attached):  Rcpp_1.0.0 pillar_1.3.1 compiler_3.5.1 plyr_1.8.4 tools_3.5.1 tibble_2.0.1 gtable_0.2.0 lattice_0.20-38  pkgconfig_2.0.2 rlang_0.3.1 Matrix_1.2-15 rstudioapi_0.9.0 cmprsk_2.2-7 yaml_2.2.0 mvtnorm_1.0-9 expm_0.999-4  xfun_0.5 gridExtra_2.3 knitr_1.21 survMisc_0.5.5 generics_0.0.2 grid_3.5.1 tidyselect_0.2.5 glue_1.3.0  KMsurv_0.1-5 R6_2.4.0 km.ci_0.5-2 tidyr_0.8.3 purrr_0.3.1 backports_1.1.3 scales_1.0.0 splines_3.5.1  assertthat_0.2.0 xtable_1.8-3 colorspace_1.4-0 stringi_1.3.1 lazyeval_0.2.1 munsell_0.5.0 broom_0.5.1 crayon_1.3.4  zoo_1.8-4