R/predict.R

#' @rdname rlm.summaries
#' 
#' @method predict rlmmodel
#' @export
predict.rlmmodel <- function(object, newdata, ...) {
  if(missing(newdata) || is.null(newdata)) {
    return(fitted(object))
  } else{
    tt <- terms(object)
    Terms <- delete.response(tt)
    x <- model.matrix(Terms, newdata)
    return(as.matrix(x) %*% coef(object))
  }
}

Try the rcane package in your browser

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

rcane documentation built on May 1, 2019, 10:11 p.m.