Take the 2-minute tour ×

I'm running a logistic regression model in R. I've used both the Zelig and Car packages. However, I'm wondering if there is a simple way to get the model fit statistics for the model. (pseudo R-square, chi-square, log liklihood,etc)

share|improve this question
You can find a few examples here: ats.ucla.edu/stat/r/dae/mlogit.htm –  nico Nov 21 '10 at 11:51
Looks like you got an answer you liked (below), would you be willing to select it as your preferred answer? –  David James Jan 3 '11 at 1:33
You might find that this Q&A Site is better for stats questions: stats.stackexchange.com –  David James Jan 3 '11 at 1:36
add comment

4 Answers

Assume glm1 ist your model and your samplesize is n = 100.

Here are some goodness-of-fit-measures:

R2<-1-((glm1$deviance/-2)/(glm1$null.deviance/-2)) cat("mcFadden R2=",R2,"\n")

R2<-1-exp((glm1$deviance-glm1$null.deviance)/2*n) cat("Cox-Snell R2=",R2,"\n")

R2<-R2/(1-exp((-glm1$null.deviance)/n)) cat("Nagelkerke R2=",R2,"\n")

AIC<- glm1$deviance+2*2 cat("AIC=",AIC,"\n")

In this way you have an overview of how calculating the GoF-Measurements.

share|improve this answer
Just a short addition on this topic: The GoF-Measurements depend on the Loglikelihood-value, why they are treated not like "normal" R-Squares. A McFadden value of 0.2 doesn't mean, that 20 % of the variance is explained by the model, so it is not the same as R-Square calculated by OLS. But in most of the models a value of Pseudo R-Squares >= 0.2 is quiet good. –  Redfood Apr 11 '13 at 13:44
add comment

Typically this is done using the summary() function.

share|improve this answer
summary() provides me with the coefficients and regression parameters. That's important, but not what I'm looking for. Furthermore, with the Zelig output, I get the following output: Null deviance: 1068.24 on 772 degrees of freedom Residual deviance: 939.48 on 761 degrees of freedom (941 observations deleted due to missingness) AIC: 963.48 –  Tony Jul 26 '10 at 17:04
thanks!!! I also found that running the logistic regression using the lrm function from the Design package gives the pseudo-R^2 as an output. –  Tony Jul 26 '10 at 19:02
add comment

It's hard to answer this question without knowing what the model object is. I'm not sure what Zelig produces.

I would look at names(model), names(summary(model)) or names(anova(model,test = "Chisq")) to see if the stats you want are there. I know that for log-likelihood, logLik(model) will give you what you want.

share|improve this answer
add comment

While I'm no expert, model fit statistics for logistics regression models are not as straightforward in their interpretation as those in linear regression. Assuming you have a binary response, one method I've found useful is to group your data by predicted probability interval (0-10%, 10%-20%,....90%-100%) and comparing the actual probabilities to the predicted ones. This is very helpful because often your model will over predict at the low end or under predict at the high end. This may lead to a better model as well.

share|improve this answer
add comment

Your Answer


