R/methods_sarlm.R

Defines functions standard_error.Sarlm ci.Sarlm p_value.Sarlm

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


#' @export
ci.Sarlm <- function(x, ci = 0.95, ...) {
  .ci_generic(model = x, ci = ci, ...)
}


#' @export
standard_error.Sarlm <- function(model, ...) {
  params <- insight::get_parameters(model)
  s <- summary(model)
  # add rho, if present
  if (!is.null(s$rho)) {
    rho <- as.numeric(s$rho.se)
  } else {
    rho <- NULL
  }
  .data_frame(
    Parameter = params$Parameter,
    SE = c(rho, as.vector(s$Coef[, 2]))
  )
}

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.