Session Ready
Exercise

The UnempDur dataset

The UnempDur dataset contains information on how long people stay unemployed. In this case, the event (finding a job) is something positive. This information is stored in the censor1 variable, which has a value of 1 if an individual was re-employed at a full-time job. The spell variable indicates the length of time an individual was unemployed in number of two-week intervals.

In this exercise, you'll explore these censored values and create a Surv object, just as you did in the previous exercises with the GBSG2 dataset.

Instructions
100 XP
  • Load the UnempDur dataset from the Ecdat package.
  • Count the number of censored and uncensored observations.
  • Create a barplot of the number of censored and uncensored observations.
  • Create a Surv object using censor1 and the variable describing duration.