R/PLL.grpsurv.R

Defines functions PLL.grpsurv

Documented in PLL.grpsurv

PLL.grpsurv <- function(object, newdata, newtime, newstatus, complexity = NULL, ...) {
   .require_suggested_package("grpreg", "PLL.grpsurv()")

   lambda <- .peperr_complexity_value(
      complexity = complexity,
      default = attr(object, "peperr_lambda"),
      caller = "PLL.grpsurv()"
   )

   lp <- if (length(object$lambda) > 1L) {
      stats::predict(
         object,
         X = as.matrix(newdata),
         type = "link",
         lambda = lambda,
         ...
      )
   } else {
      stats::predict(
         object,
         X = as.matrix(newdata),
         type = "link",
         ...
      )
   }

   .peperr_pll_from_linear_predictor(
      linear.predictor = lp,
      time = newtime,
      status = newstatus
   )
}

Try the peperr package in your browser

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

peperr documentation built on March 25, 2026, 9:06 a.m.