1. Learn
  2. /
  3. Courses
  4. /
  5. Machine Learning for Marketing Analytics in R

Connected

Exercise

Model assumptions

You already had a look at the Cox PH model in the last coding exercise. In this exercise, you are going to find out if your model is appropriate at all. Your model is still stored in the object fitCPH.

Instructions

100 XP
  • Check the proportional hazard assumption of the model fitCPH using cox.zph(). Store the test result in an object called testCPH and print it.
  • The assumption seems to be violated for one variable at the 0.05 alpha level. Which one? Plot the coefficient beta dependent on time for this variable.
  • Validate the model using cross validation in the validate() function from the rms package.