Pseudo R Square Values in R

January 26, 2011
By

(This article was originally published at Adventures in R, and syndicated at StatsBlogs.)

R does not give a Pseudo R square value and neither does Mplus. As such, here is a real quick R function to calculate McFadden’s and Adjusted McFadden’s Pseudo R square value:

 

#Pesudo R square
#x = full model
#y = null model
#k = number of parameters
 
PRsq<- function (x, y, k ) {
a= 1- (x/y)
b= 1- ((x-k)/y)
cat ("Pesudo R Square Estimates", "\n")
cat ("McFadden's:          ", a, "\n")
cat ("adjusted McFadden's: ", b, "\n")
}




Please comment on the article here: Adventures in R

Tags:

Subscribe

Email:

  Subscribe