I am using the mstate package with some personal data. I have 3 states that can happen subsequently and then the death state that can happen at anytime.
I created the transition matrix and everything as i should, but then when i try to use the probtrans() function, i receive the following warning :
> pt.ktc <- probtrans(msf.ktc, predt=0, method="greenwood")
Warning messages:
1: In probtrans(msf.ktc, predt = 0, method = "greenwood") :
Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
Whatever if i use the greenwood or aalen method, it happens.
I know it is better to have a reproducible example but i can't share publicly the data i am using, and i can't reproduce this error with some random public dataset. Maybe one knows what can cause this warning, so i could check. Before this the msfit() function worked fine without any error.
Also, beyond this error i still tried if the ELOS() function would work (it is supposed to calculate the Expected Length of Stay for each state transitions), and i get this warning:
Warning messages:
1: In ELOS(pt.ktc) :
negative transition probabilities present; ELOS may not be well defined
And yes i have in the result a negative length of stay, which is not convenient.
If anyone knows what can cause this so i could investigate, i didn't find any clear things on this subject.