Ass1
Survival Analysis
Question 1 The following are survival times for two treatment groups, * indicates a right censored observation. All subjects are entered at time 0.
ID Group Time 1 Placebo 1 2 Placebo 2 3 Placebo 7* 4 Placebo 8 5 Placebo 12 6 Drug 4 7 Drug 6* 8 Drug 9 9 Drug 10 10 Drug 13
a. Determine by hand or Excel the Kaplan-Meier survivalfor the Placebo group.Include an intermediate calculation.
b. Determine by hand or Excel the Log rank test statistic.Use a table and show at least one intermediate calculation.
c. Determine the risk set (this means the ids of the subjects) at time=10 and the corresponding term in the partial likelihood assuming that the data is coded Placebo=0 and Drug=1 and the parameter is β .
d. If the subject with id 10 was entered at time=11, that is there is delayed entry, how would this change the results of (c).
Question 2 The following data set (dialysis.csv) concerns the survival of patients after starting peritoneal dialysis. [Dialysis is a blood filtering treatment that replaces the function of the kidneys. Dialysis is started when an individuals kidneys stop working]. The interest is in modelling the time to death, but we will also do one analysis for transplant. This is not real data but is based on a real data set.
Variable Description id Patient Identify stat1 Status at end of followup (0=Dead, 1=Dialysis, 2=Transplant, 3=Lost to Followup) yrstotal Total years of followup gender Gender (1=Male,0=Female) diabetes Diabetes (1=Yes, 0=No) startyr Year started dialysis age Age starting dialysis
Analyses should be performed in Stata. a. Death i. Setup the data for survival analysis for death as the event, that is stat1=0 with all other outcomes considered censored.Show the command.Note:Think about what the value for censoring should be. ii. Using the covariate age,categorize into 3 equal,as possible,groups.Produce a Kaplan-Meier plot for each age group.Comment. iii. Determine the median survival with 95% CI for each age group.Why can’t the median survival be obtained for the lowest age group? iv. Determine the survival at 10 years with 95% CI for each age group. v. Perform a logrank test, and a test for trend for age group. Comment. vi. Fit a Cox model for age group and test for evidence of an effect of age group using a Wald test. vii. Using the covariates continuous age and diabetes, fit a Cox model, produce a table of results suitable for publication (suitable for publication means correctly formatted with irrelevant output removed and appropriate p -values), and comment including interpreting the results. b. Fit a Cox model for transplant as the event,with all other events as censoring with covariates continuous age and diabetes and comment on the results. Question 3 A cumulative density function is given by
F ( t ) =(1 − p ) (1 − e − λtt ) (1 − θee − λtt )
t > 0; λt > 0; 0 < θe < 1; 0 < p < 1
a.hence derive S(t), f(t) and h(t). b.Graph f ( t ) ,
S ( t ) and h ( t ) for λt = 1 You should produce 2 sets of g r a p h s . The first should hold p fixed at 0.5 and show 3 values of θe , 0.1, 0.5, 0.9 and the second should hold θe fixed
at 0.5 with 3 values of p , 0.1, 0.5, 0 . 9 . H i n t : You may use any method, but this is easiest done in R or STATA (Excel may work as well) by defining functions for each and then them eg:
3
t <- seq(0,5,0.01) f <- function(t,p,theta,lambda) { return(????) } plot(t,f(t,0.1,0.5,1),ylim=c(0,2),type=”l”,col=”red”) c. Describe the effect of parameters p and θe , assuming λt fixed.