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

Using the Surv() function for GBSG2

In the video, we learned about the Surv() function, which generates a Surv object. Let's look a little deeper into what a Surv object actually is. We will use the GBSG2 data again.

The survival package and GBSG2 data are loaded for you in this exercise.

Bu egzersiz

Survival Analysis in R

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

Egzersiz talimatları

  • Create a Surv object with the two variables describing the duration and censoring information of the GBSG2 dataset.
  • Look at the first 10 elements of the object (using indexing with squared brackets []).
  • Look at the summary (summary()) and structure (str()) of the object.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create Surv-Object
sobj <- Surv(___, ___)

# Look at 10 first elements
___[___:___]

# Look at summary
___(sobj)

# Look at structure
___(___)
Kodu Düzenle ve Çalıştır