I am looking to get a pseudo $R^2$ metric from a beta-regression model fit using JAGS in the runjags package for R. To do so I have calculated the deviance of the fitted model, and the deviance of a null model. I plan to calculate McFadden's pseudo $R^2$ as

$$1-\frac{\text{Residual Deviance}}{\text{Null Deviance}}$$.

Where residual deviance is the deviance of the fitted model, and null deviance is the deviance of the null model. However, both of my deviance values are negative. Residual deviance = -6622.103 ans null deviance = -5939.539. So, 1 - (-6622.103/-5939.539) = -0.1149187. Negative $R^2$ values don't seem right.


The deviance should usually not become negative. Maybe you should check that all computations are correct.

Furthermore, the usual recommended pseudo $R^2$ for beta regression is not McFadden which is designed for categorical responses. Ferrari and Cribari-Neto (2004, p. 806) recommend to use the squared sample correlation between the linear predictor $\hat \eta$ and the link-transformed response $g(y)$. This is also what betareg computes.

  • $\begingroup$ Thankyou, this is helpful. I read Ferrari and Cribari-Neto 2004, and noted their suggestion to use $\hat \eta$ and the link-transformed response $g(y)$. However, I could not figure out how these were calculated in their manuscript. Could you provide an example of how to calculate them in R? I need to implement this on the output of a JAGS model, rather than in betareg. $\endgroup$ – colin Aug 24 '16 at 0:45
  • 1
    $\begingroup$ Sure, I just included the pointer to betareg in case you wanted to look up the underlying R code. To compute $\hat \eta$ you just need x %*% beta (linear predictor for the mean equation) and if you use a logit link then $g(y)$ is log(y/(1 - y)) (or equivalently qlogis(y)). Thus, the pseudo $R^2$ is cor(log(y/(1 - y)), x %*% beta)^2. $\endgroup$ – Achim Zeileis Aug 24 '16 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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