9
$\begingroup$

I use mgcv package in R to build a Generalized Additive Model. When looking at results of (e.g., summary()), there are two indices shown, and they are not the same, though not too different:

R-sq.(adj) =  ...   Deviance explained = ...%

In ?summary.gam, definitions of these two terms are:

r.sq    
The adjusted r-squared for the model. Defined as the proportion of variance explained, where original variance and residual variance are both estimated using unbiased estimators. ... The proportion null deviance explained is probably more appropriate for non-normal errors. Note that r.sq does not include any offset in the one parameter model.

dev.expl    
The proportion of the null deviance explained by the model. The null deviance is computed taking account of any offset, so dev.expl can be substantially lower than r.sq when an offset is present.

It seems that r.sq is about "variance", while dev.expl is about "deviance". However, I still don't know which one is better, r.sq or dev.expl?

$\endgroup$
4
  • $\begingroup$ Better for what purpose? $\endgroup$ Commented Apr 4, 2019 at 1:54
  • $\begingroup$ You should make it clear that you are refering to functionality in the mgcv package, because the gam package itself does not output either of the indices you refer to. R-sq (adj) is not a usual measure for a generalized linear or generalized additive model, and it is not clear even for GLM experts how mgcv is computing it, so you could take that as a hint. $\endgroup$ Commented Apr 4, 2019 at 2:03
  • $\begingroup$ @GordonSmyth Should we use Deviance explained? But I noticed in some researches, R-sq (adj) is used as the goodness of fit measure, and for calculating relative importance. For example, Section 2.2 & 2.4 in this paper $\endgroup$
    – T X
    Commented Apr 4, 2019 at 2:16
  • $\begingroup$ There was no use of adjusted R-sq in the paper you link to. They used ordinary R-sq, and they computed it themselves rather than extracting it from the mgcv::gam output. Their use was specific to a cross validation context and would not necessarily be the right thing to do for a routine analysis. $\endgroup$ Commented Apr 4, 2019 at 2:42

1 Answer 1

5
$\begingroup$

In the most updated version of mgcv (1.8-37). Wood elaborated on the r.sq definition by stating "The proportion null deviance explained is probably more appropriate for non-normal errors." Therefore, deviance explained should be a more generalized measurement of goodness of fit especially for non-gaussian models.

More detailed explanation on deviance explained can be found at How I can interpret GAM results?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.