##### Survival analysis ###################### ##### Parametric model ###################### library(survival) library(MASS) ovarian ###Ovarian Cancer Survival Data### attach(ovarian) ###Weibull regression####### fit1=survreg(Surv(futime, fustat)~age+resid.ds+rx+ecog.ps, dist="weibull", data=ovarian) aic1=AIC(fit1) bic1=BIC(fit1) ###Loglogistic regression##### fit2=survreg(Surv(futime, fustat)~age+resid.ds+rx+ecog.ps, dist="loglogistic", data=ovarian) aic2=AIC(fit2) bic2=BIC(fit2) ###Lognormal regression##### fit3=survreg(Surv(futime, fustat)~age+resid.ds+rx+ecog.ps, dist="lognormal", data=ovarian) aic3=AIC(fit3) bic3=BIC(fit3) fit4=survreg(Surv(futime, fustat)~age+resid.ds+rx+ecog.ps, dist="exponential", data=ovarian) aic4=AIC(fit4) bic4=BIC(fit4) aic=c(aic1,aic2,aic3,aic4) aic bic=c(bic1,bic2,bic3,bic4) bic ###Both AIC and BIC indicate that lognormal is the selected model############