Statistics, Data Science, Analytics, Business Intelligence, Machine Learning.
= n, family = 'binomial' ) summary(model) R mistakenly thinks that 3 rows = 3 observations even though we have 30 observations. The residual deviance should have 28 degrees of freedom. binom_deviance <- -2 * sum( log(choose(dat$n, dat$y * dat$n)) + log(fitted(model)) * dat$y * dat$n +