R/methods_coxrobust.R

Defines functions p_value.coxr standard_error.coxr

#' @export
standard_error.coxr <- function(model, ...) {
  params <- insight::get_parameters(model)
  vc <- insight::get_varcov(model)
  .data_frame(
    Parameter = params$Parameter,
    SE = as.vector(sqrt(diag(vc)))
  )
}

## TODO add ci_method later?

#' @export
p_value.coxr <- function(model, ...) {
  stat <- insight::get_statistic(model)
  if (!is.null(stat)) {
    .data_frame(
      Parameter = stat$Parameter,
      p = as.vector(2 * stats::pnorm(abs(stat$Statistic), lower.tail = FALSE))
    )
  }
}

Try the parameters package in your browser

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

parameters documentation built on Nov. 2, 2023, 6:13 p.m.