R/glm-comprisk.r

Defines functions prep.glm.comprisk

Documented in prep.glm.comprisk

#' @export
prep.glm.comprisk <- function(out,time="time",cause="cause",times,censmod=0,cens.code=0,type=1)
{ ## {{{
    ###
    out$id <- 1:nrow(out)
    mm <- c()
    for (h in times)
    {
        i2out  <- prep.comp.risk(out,time=time,cause=cause,times=h,cens.code=cens.code)
        Nt <- (i2out[,time] < h)*(i2out[,cause]==type)
        nocens <- (i2out[,time] < h)
        mm <- rbind(mm,cbind(i2out,Nt,h,nocens))
    }
    return(mm)
} ## }}} 

Try the timereg package in your browser

Any scripts or data that you put into this service are public.

timereg documentation built on Sept. 11, 2024, 8:35 p.m.