Exercise

# Kaplan-Meier Analysis

In this exercise you are going to practice Kaplan-Meier Analysis - without and with a categorical covariate.

The `survival`

package is loaded to your workspace. Also, the survival object `survObj`

and your data `dataNextOrder`

are still in the environment. But now, the data contains an additional covariate called `voucher`

, which you will need in this exercise. This categorical variable tells you if the customer used a voucher in her first order. It contains the value 0 or 1.

Instructions

**100 XP**

- Compute a Kaplan-Meier Analysis (without covariates) using
`survfit()`

. Store the result in an object called`fitKMSimple`

. Remember, the dependent variable (variable to the*left*of the tilde`~`

) is again your survival object`survObj`

. Then, print`fitKMSimple`

. - Plot the result object
`fitKMSimple`

and add axis labels (`xlab`

and`ylab`

arguments). - Now go a step further: Compute a Kaplan-Meier Analysis with the
`survObj`

as dependent variable and the variable`voucher`

as covariate. Don't forget to specify the`data`

argument. - Again, plot the result of the new model and add axis labels.