R/coef.slmfit.R

Defines functions coef.slmfit

Documented in coef.slmfit

#' Extract Model Coefficients from a \code{\link{slmfit}} object
#'
#' @param object a \code{\link{slmfit}} object
#' @param ... further arguments passed to or from other methods.
#' @return a vector of fitted model coefficients.
#' @examples
#' data(exampledataset) ## load a toy data set
#' slmobj <- slmfit(formula = counts ~ pred1 + pred2, data = exampledataset,
#' xcoordcol = 'xcoords', ycoordcol = 'ycoords', areacol = 'areavar')
#' coef(slmobj)
#' @export

coef.slmfit <- function(object, ...) {
  coef.vec <- object$CoefficientEsts
  names(coef.vec) <- object$PredictorNames
  return(coef.vec)
}

Try the sptotal package in your browser

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

sptotal documentation built on July 6, 2021, 5:07 p.m.