BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Machine Learning for Marketing Analytics in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • 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.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Check proportional hazard assumption and print result
___ <- ___(fitCPH)
___(testCPH)

# Plot time-dependent beta
plot(___, var = "___")

# Load rms package
library(rms)

# Validate model
___(fitCPH, method = "___",
         B = 10, dxy = TRUE, pr = FALSE)
Kodu Düzenle ve Çalıştır