I run a null binomial generalized additive models (gam) using mgcv
and it gives negative deviance explained!
As far as I know deviance explained is analogue of R^2 so it should be between 0 and 1. So is this negative deviance explained occurred by the package error? If so, then how can I manually estimate deviance explained?
My code is given below
library(mgcv)
x1 = rnorm(100)
x2 = rnorm(100)
y = rbinom(100, 1, 0.5)
Data = data.frame(y, x1, x2)
model = gam(y ~ 1, data=Data, family=binomial)
summary(model)$dev.expl
output:
[1] -2.050785e-16