R/pearson2.R

pearson2 <- function(object, ...) {
  dispersion <-
    with(object, {
      y.hat <- predict(y, coefficients[1:p], X[,1:p], offset)
      a.hat <- predict_s(y, coefficients[-(1:p)], X[,-(1:p)])
      pearson <- sum(((y - y.hat)^2) /
                     variance(y, y.hat, a.hat))
      pearson / df.residual})
  return(dispersion)
}

Try the msme package in your browser

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

msme documentation built on May 2, 2019, 5:07 a.m.