From our textbook (Ex. 6.5.3.) (Stanford library link):
For the dataset hodgkins
in package npsm
, plot Kaplan-Meier estimated survival curves for both treatments. Note treatment code 1 denotes radiation of affected node and treatment code 2 denotes total nodal radiation.
From our textbook (Ex. 6.5.4.) (Stanford library link):
To simulate survival data, often it is useful to simulate multiple time points. For example the time to event and the time to end of study. Then, events occurring after the time to end of study are censored. Suppose the time to event of interest follows an exponential distribution with mean 5 years and the time to end of study follows an exponential distribution with a mean of 1.8 years. For a sample size \(n = 100\) simulate survival times from this model. Plot the Kaplan-Meier estimate.
Please email your solutions in the form of a Rmd file to Nan Bi and Lexi Guan.
This homework is due on Thursday, May 19th at 1:30 pm.
You are encouraged to work through this homework with your peers. But write your own code and explain the results in your own words.