The documentation says that the r2 function computes R² of a linear model or pseudo-R² of a generalized linear model.
But if we call r2 with any glm fitted model, it throws an error. I have come across a lot of debates on r2, nulldeviance etc for GLM in the forum.
It would be better if we remove the pseudo-R² part from the documentation until the same is implemented for GLM.
The documentation says that the
r2
function computesR²
of a linear model or pseudo-R² of a generalized linear model. But if we callr2
with anyglm
fitted model, it throws an error. I have come across a lot of debates onr2
,nulldeviance
etc forGLM
in the forum. It would be better if we remove thepseudo-R²
part from the documentation until the same is implemented forGLM
.