#### An example of the Pfun (or Psi(s) or weight function) and calculation ####
mydgfun2 <- function(t){0.3*t*(10-t)*as.numeric(t<=10)}
N <- 3000
set.seed(12345)
itime <- sort(rexp(N, rate=0.1)) #### inspection times
Stime <- rexp(N, rate=0.1) #### survival times
delta <- as.numeric(Stime <= itime) #### current status censoring
el.CS.Hz(ti=itime, di=delta, Pfun=mydgfun2, thetaMU= -5) ## -5 is the true value of parameter.
#### You should get
## $`-2LLR`
## [1] 1.04782 #### and more.
Run the code above in your browser using DataLab