[R] Different LLRs on multinomial logit models in R and SPSS

David Winsemius dwinsemius at comcast.net
Thu Jan 6 18:03:17 CET 2011


On Jan 6, 2011, at 11:23 AM, Sören Vogel wrote:

> Thanks for your replies. I am no mathematician or statistician by far,
> however, it appears to me that the actual value of any of the two LLs
> is indeed important when it comes to calculation of
> Pseudo-R-Squared-s. If Rnagel devides by (some transformation of) the
> actiual value of llnull then any calculation of Rnagel should differ.
> How come? Or is my function wrong? And if my function is right, how
> can I calculate a R-Squared independent from the software used?

You have two models in that function, the null one with ".~ 1" and the  
origianl one and you are getting a ratio on the likelihood scale  
( which is a difference on the log-likelihood or deviance scale).

>
> Rfits <- function(mod) {
>  llnull <- deviance(update(mod, . ~ 1, trace=F))
>  llmod <- deviance(mod)
>  n <- length(predict(mod))
>  Rcs <- 1 - exp( (llmod - llnull) / n )
>  Rnagel <- Rcs / (1 - exp(-llnull/n))
>  out <- list(
>    "Rcs"=Rcs,
>    "Rnagel"=Rnagel
>  )
>  class(out) <- c("list", "table")
>  return(out)
> }


-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list