[R] explained deviance in multinom

alexbri alexbri at netcabo.pt
Fri Jul 8 20:07:38 CEST 2005


Hi:

 

I'm working with multinomial models with library nnet, and I'm trying to get the explained deviance (pseudo R^2) of my models.

I am assuming that:

pseudo R^2= 1 - dev(model) / dev (null)

where dev(model) is the deviance for the fitted model and dev(null) is the deviance for the null model (with the intercept only).

 

library(nnet)

full.model<- multinom(cbind(factor1, factor2 ,., factor5) ~ x1 + x2 + x3, weights=total, data=mydata)

null.model<- multinom(cbind(factor1, factor2 ,., factor5) ~ +1, weights=total, data=mydata)

 

Then I calculated 

pseudoR^2 = 1 - full.model$deviance / null.model$deviance

 

I'm obtaining very low values for pseudoR^2 (there is not much difference between the deviances of the two models). full.model fits (graphically) very well to the data , so I think that the problem is in the null.model (maybe it is not well defined) or with the calculus of pseudoR^2.

 

Can someone please give me some suggestions about this?

Thanks in advance

alex




More information about the R-help mailing list