#Example #1
data(alloauto)
time<-alloauto$time
delta<-alloauto$delta
z<-alloauto$type
MLEPO(init = c(1.0,0.40,1.0,0.50),times = time,status = delta,n=nrow(z),
basehaz = "GLLPO",z = z,method = "BFGS",hessian=TRUE, conf.int=0.95,maxit = 1000,log=FALSE)
#Example #2
data(bmt)
time<-bmt$Time
delta<-bmt$Status
z<-bmt$TRT
MLEPO(init = c(1.0,1.0,0.5),times = time,status = delta,n=nrow(z),
basehaz = "SLLPO",z = z,method = "BFGS",hessian=TRUE, conf.int=0.95,maxit = 1000,log=FALSE)
#Example #3
data("gastric")
time<-gastric$time
delta<-gastric$status
z<-gastric$trt
MLEPO(init = c(1.0,0.50,1.0,0.75),times = time,status = delta,n=nrow(z),
basehaz = "PGWPO",z = z,method = "BFGS",hessian=TRUE, conf.int=0.95,maxit = 1000,
log=FALSE)
#Example #4
data("larynx")
time<-larynx$time
delta<-larynx$delta
larynx$age<-as.numeric(scale(larynx$age))
larynx$diagyr<-as.numeric(scale(larynx$diagyr))
larynx$stage<-as.factor(larynx$stage)
z<-model.matrix(~ stage+age+diagyr, data = larynx)
MLEPO(init = c(1.0,1.0,0.5,0.5,0.5,0.5,0.5,0.5),times = time,status = delta,n=nrow(z),
basehaz = "ATLLPO",z = z,method = "BFGS",hessian=TRUE, conf.int=0.95,maxit = 1000,log=FALSE)
Run the code above in your browser using DataLab