search for: llmod

Displaying 2 results from an estimated 2 matches for "llmod".

Did you mean: nlmod
2011 Jan 06
4
Different LLRs on multinomial logit models in R and SPSS
Hello, after calculating a multinomial logit regression on my data, I compared the output to an output retrieved with SPSS 18 (Mac). The coefficients appear to be the same, but the logLik (and therefore fit) values differ widely. Why? The regression in R: set.seed(1234) df <- data.frame( "y"=factor(sample(LETTERS[1:3], 143, repl=T, prob=c(4, 1, 10))), "a"=sample(1:5,
2010 Dec 27
0
Nagelkerke R square for Prediction data
...R from a fitted model. I am no professional programmer by far, yet, I hope, that the code is okay and that it may be of some use to others -- or subject to useful improvement. Please let me know, if you find errors. Regards, S?ren Rcsnagel <- function(mod) { llnull <- mod$null.deviance llmod <- mod$deviance n <- length(mod$fitted.values) Rcs <- 1 - exp( (mod$deviance - mod$null.deviance) / n ) Rnagel <- Rcs / (1 - exp(-llnull/n)) out <- list('Rcs'=Rcs, 'Rnagel'=Rnagel) class(out) <- c("list", "table") return(out) } y &l...