R/predict.R

Defines functions predict.rlmmodel

Documented in predict.rlmmodel

#' @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 June 4, 2018, 5:04 p.m.