R/coefficents.sc_plm.R

Defines functions coef.sc_hplm coef.sc_plm

Documented in coef.sc_hplm coef.sc_plm

#' Extract coefficients from plm/hplm objects
#'
#' @param object plm or hplm object
#' @param ... not implemented
#'
#' @return data frame with coefficient table
#' @export
#'
#' @examples
#' coefficients(plm(exampleAB$Johanna))
#' 
coef.sc_plm <- function(object, ...) {
  summary(object$full.model)$coef
}

#' @describeIn hplm Extract model coefficients
#' @order 4
#' @param casewise Returns the estimations for each case
#' @inheritParams coef.sc_plm
#' @export
coef.sc_hplm <- function(object, casewise = FALSE, ...) {
  if (casewise) {
    out <- coef(object$hplm)
    names(out) <- .plm.row.names(names(out), object)
    out <- cbind(Case = row.names(out), out)
    row.names(out) <- NULL
    return(out)
  } else {
    summary(object$hplm)$tTable
  }
}
jazznbass/scan_develop documentation built on Sept. 9, 2024, 6:23 a.m.