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))
    )
  }
}
easystats/parameters documentation built on April 27, 2024, 7:28 p.m.