R/calcNullDev.R

Defines functions calcNullDev

calcNullDev <- function(X, y, group, family) {
  form <- if (any(group==0)) formula(y~X[, group==0]) else formula(y~1)
  fit <- glm(form, family=family)
  mean(loss.grpreg(y, predict(fit, type="response"), family))
}

Try the grpreg package in your browser

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

grpreg documentation built on July 27, 2021, 1:08 a.m.