R/ADcens.formula.R

Defines functions ADcens.formula

Documented in ADcens.formula

ADcens.formula <- function(formula, data, ...) {
  call <- match.call
  m <- match.call(expand.dots = FALSE)
  m[[1]] <- as.name("model.frame")
  m$... <- NULL
  m <- eval(m, parent.frame())
  Y <- model.extract(m, "response")
  if (!inherits(Y, "Surv")) {
    stop("The left-hand side of the formula must be a 'Surv' object.")
  }
  times <- Y[, 1]
  cens <- Y[, 2]
  output <- ADcens(times, cens, ...)
  class(output) <- "ADcens"
  output
}

Try the GofCens package in your browser

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

GofCens documentation built on Oct. 30, 2024, 9:13 a.m.