R/spPredict.R

Defines functions spPredict

spPredict <- function(mod, newdata, intercept = FALSE) {
  beta <- coef(mod)
  if ( intercept ) {
    X <- cbind(1 , newdata)
  } else {
    X <- newdata
  }
  as.numeric(X %*% beta)
}

Try the simPop package in your browser

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

simPop documentation built on Nov. 10, 2022, 5:43 p.m.