Search code examples
rmarkov-chainsmarkov-models

The R mstate package takes data that has a "status" variable. The "status" can either be 0 or 1. What does 0 mean and what does 1 mean?


Example data

This is some example data. Below is a quote from the paper (Wreede et al 2010) regarding the "status" variable:

"We need one line for each individual for each transition for which he/she is at risk, containing data about her/his identity (id), the current transition (from, to, trans), the time of entry in the current state (Tstart), the time when he/she stops being at risk for the transition (Tstop), either due to an event or to censoring, as indicated by status."


Solution

  • In general:

    In the setting of time-to-event analysis which a Kaplan-Meier survival analysis in essence is you need core variables. One of this needed variables is an event variable. In your example depicted with status:

    status == 0 means no event occured. status == 1 means event occured.

    event in this setting can be everything like: death, accident, success, .... -> then status 0 says no death and status 1 says death.

    In the original documentation: https://cran.r-project.org/web/packages/mstate/mstate.pdf

    status is either:

    1. a vector describing status at end of follow-up, having the same length as Tstop,

    or

    1. a character string indicating the column name that contains this information.