The survival object
Before you start any survival analysis, you need to transform your data into the right form, the survival object. Remember: daysSinceFirstPurch contains the time between first and second order. boughtAgain tells you if there was a second order or not.
The survival package is already loaded to your workspace.
Este exercício faz parte do curso
Machine Learning for Marketing Analytics in R
Instruções do exercício
- Create a survival object from
dataNextOrderusingSurv(). Store the result assurvObj. - Take a look at the object's structure.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Create survival object
survObj <- ___(dataNextOrder$___, dataNextOrder$___)
# Look at structure
___(survObj)