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))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.