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")
}

### Like this:

Like Loading...

*Related*

## About Philip Parker

I am a post doc in developmental and educational psychology at a Germany university. I did my PhD at the university of Sydney in stress and well-being. Most days I am hunched over a computer yelling at statistical software or responding to journal editors who seem to always want twice the amount of content but with half the words. For fun I like to read up on the latest developments in R and programming various functions.

Thanks for this! I modified your function a bit to take a model as an argument, although I couldn’t find an easily-accessible property on model objects for k. Still, it’ll output the McFadden’s pseudo-R^2 given a model for an argument.

PRsq<- function (x) {

a= 1- (x$deviance/x$null.deviance)

cat ("Pesudo R Square Estimates", "\n")

cat ("McFadden's: ", a, "\n")

}

The package pscl and the command pR2 work wonders on a range of things, have a look