“…# Obtaining the ML estimates mle <-c() mle <-maxLik(logLik=log.f,start=c(0.08,0.6)) summary(mle) betaDB <-mle$estimate [1] etaDB <-mle$estimate [2] s <-vcov(mle) # The 95% confidence intervals llimDB <-round(betaDB -qnorm(0.975) * sqrt(s[1,1]),4) 1186 DISCRETE BILAL DISTRIBUTION WITH RIGHT-CENSORED DATA ulimDB <-round(betaDB + qnorm(0.975) * sqrt(s[1,1]),4) llimDBe <-round(etaDB -qnorm(0.975) * sqrt(s[2,2]),4) ulimDBe <-round(etaDB + qnorm(0.975) * sqrt(s[2,2]),4) cat("n = ",n,"\n") cat("Beta = ",betaDB, "95%CI: (",llimDB,",",ulimDB, ") \n") cat("Eta = ",etaDB, "95%CI: (",llimDBe,",",ulimDBe, ") \n") # Calculating AIC, BIC and AICC aic <-AIC(mle) bic <-AIC(mle,k = log(n)) aicc <-aic + (2 * Kˆ2+2 * K)/(n-K-1) cat("AIC = ",aic,", BIC = ",bic,", AICC = ",aicc,"\n") This is the R code for the Bayesian model for survival data with a cure fraction based on the DB distribution, as presented in subsection 2.4: <-dgamma(beta,0.001,0.001) * dbeta(eta,1,1) log.prior <-log(prior) L <-log.like + log.prior if (is.na(L)==TRUE) {return(-Inf)} else {return(L)} } # Obtaining the MCMC estimates posterior <-MCMCmetrop1R(log.post,theta.init=c(beta=0.05,eta=0.6), burnin=10000, mcmc=1000000, thin=200, logfun=T, t=t, d=d, verbose=100000, tune = 1) varnames(posterior) <-c("beta","eta") summary(posterior) # Obtaining the HPD intervals HPDinterval(posterior, prob = 0.95) # Geweke z scores geweke.diag(posterior)…”