I'm new to R (used to work with SPSS), and looking for a function that will output the Cox & Snell and Nagelkerke R-Square measures of logistic regression. In SPSS they are displayed as part of the regular output, but in R I'm not sure what manipulation should I employ on the glm
summary to output those measures.
2 Answers
In the R rms
package the lrm
function outputs a large number of indexes including Nagelkerke (but not Cox-Snell). If you have $\LaTeX$ installed you can get the output automatically nicely typeset.
require(rms)
f <- lrm(y ~ rcs(age,4) * sex + race)
f # same as print(f)
print(f, latex=TRUE) # LaTeX markup, especially for use with knitr
The various statistics are defined in the binary logistic regression chapter in my online Regression Modeling Strategies course notes where you can also see lrm
output printed.
Eventually I found the following very helpful package which provides exactly the measures I was interested in:
http://www.inside-r.org/packages/cran/bayloredpsych/docs/PseudoR2