I am trying to make a Markov model to estimate transition intensities between three states. My dataset is a long dataset comprising 4,000 individuals, each with multiple visits. Both the number of visits per individuals and the interval between visits vary.
When I tsset my data using the code below, my dataset thus becomes an unbalanced panel dataset, with a time variable with gaps and a delta of 1 day.
When I try to run the mswitch using the code below, I get the error message: "sample may not include multiple panels".
Does anyone know what I am doing wrong? There are no missing values in either the idvariable, visitdate variable, or statusvariable. Morever, my data is sorted using "sort id visdt" and there are no duplicate dates for any id ('duplicates report idvariable visitdate' gives a surplus of zero). My idvariable is integer.
Many thanks in advance
When I tsset my data using the code below, my dataset thus becomes an unbalanced panel dataset, with a time variable with gaps and a delta of 1 day.
Code:
tsset idvariable visitdate
Code:
mswitch ar statusvariable, ar(1/3)
Many thanks in advance
Comment