Ass1 Survival Analysis Due date: 08h00 am 21stMarch 2020 1 Question 1 The following are survival times for two treatment groups, * indicates a right censored obser- vation. All subjects are entered at...

1 answer below »
Can this please be done?



Ass1 Survival Analysis Due date: 08h00 am 21stMarch 2020 1 Question 1 The following are survival times for two treatment groups, * indicates a right censored obser- vation. 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 survival for the Placebo group. Include an intermediate calculation. b. Determine by hand or Excel the Logrank 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 corre- sponding 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. Dial- ysis 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. 2 Variable Description id Patient Identifier 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, categorise 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−λt ) (1− θe−λt) t > 0;λ > 0; 0 < θ="">< 1;="" 0="">< p="">< 1="" a.="" hence="" derive="" s(t),="" f(t)="" and="" h(t).="" b.="" graph="" f="" (t)="" ,="" s="" (t)="" and="" h="" (t)="" for="" λ="1" you="" should="" produce="" 2="" sets="" of="" graphs.="" the="" first="" should="" hold="" p="" fixed="" at="" 0.5="" and="" show="" 3="" values="" of="" θ,="" 0.1,="" 0.5,="" 0.9="" and="" the="" second="" should="" hold="" θ="" fixed="" at="" 0.5="" with="" 3="" values="" of="" p,="" 0.1,="" 0.5,="" 0.9.="" hint:="" 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="" calling="" 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 θ, assuming λ fixed. 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="" θ,="" assuming="" λ="">
Answered Same DayMar 20, 2021

Answer To: Ass1 Survival Analysis Due date: 08h00 am 21stMarch 2020 1 Question 1 The following are survival...

Naveen answered on Mar 21 2021
133 Votes
# ------ Q2 --------
df <- read.csv("dialysis-flbwvvwv.csv",sep=",")
stat <- df$stat1[df$stat1==0]
censored <- df$stat1[
df$stat1!=0]
# ----- 2b-----
da=sort(df$age)
576/3
192*2
G1 <- da[1:192]
G2 <- da[193:384]
G3 <- da[385:576]
install.packages("survival")
library(survival)
# ----- 2c-----
lower_ci = median(G1)-1.96*sd(G1)/mean(G1)
upper_ci = median(G1)+1.96*sd(G1)/mean(G1)
data.frame(lower=lower_ci,upper=upper_ci,row.names = "95% CI")
lower_ci = median(G2)-1.96*sd(G2)/mean(G2)
upper_ci = median(G2)+1.96*sd(G2)/mean(G2)
data.frame(lower=lower_ci,upper=upper_ci,row.names = "95% CI")
lower_ci = median(G3)-1.96*sd(G3)/mean(G3)
upper_ci = median(G3)+1.96*sd(G3)/mean(G3)
data.frame(lower=lower_ci,upper=upper_ci,row.names = "95% CI")
# ----- 2d-----
lower_ci = median(G1[1:10])-1.96*sd(G1[1:10])/mean(G1[1:10])
upper_ci = median(G1[1:10])+1.96*sd(G1[1:10])/mean(G1[1:10])
data.frame(lower=lower_ci,upper=upper_ci,row.names = "95% CI")
lower_ci = median(G2[1:10])-1.96*sd(G2[1:10])/mean(G2[1:10])
upper_ci = median(G2[1:10])+1.96*sd(G2[1:10])/mean(G2[1:10])
data.frame(lower=lower_ci,upper=upper_ci,row.names = "95% CI")
lower_ci = median(G3[1:10])-1.96*sd(G3[1:10])/mean(G3[1:10])
upper_ci =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here