Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error "sample may not include multiple panels" for mswitch after tsset

    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.
    Code:
    tsset idvariable visitdate
    When I try to run the mswitch using the code below, I get the error message: "sample may not include multiple panels".
    Code:
    mswitch ar statusvariable, ar(1/3)
    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

  • #2
    I don't see that mswitch supports panel data. Is that a model in the literature? What would the model look like?

    mswitch supports being called with by: and perhaps that is a way to fit a separate model for each panel. I really don't know.

    Comment

    Working...
    X