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

2011-01-07 Thread sovo0815

On Thu, 6 Jan 2011, David Winsemius wrote:


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).


If this is the case, calculating 'fit' indices for those models 
must end up in different fit indices depending on software:


n <- 143
ll1 <- 135.02
ll2 <- 129.8
# Rcs
(Rcs <- 1 - exp( (ll2 - ll1) / n ))
# Rnagel
Rcs / (1 - exp(-ll1/n))
ll3 <- 204.2904
ll4 <- 199.0659
# Rcs
(Rcs <- 1 - exp( (ll4 - ll3) / n ))
# Rnagel
Rcs / (1 - exp(-ll3/n))

The Rcs' are equal, however, the Rnagel's are not. Of course, this 
is no question, but I am rather confused. When publishing results 
I am required to use fit indices and editors would complain that 
they differ.


Sören__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Catch separability problems in a (multinom) regression

2011-01-11 Thread sovo0815
So far I have "learned" that a binary logit model can either not 
converge or show linear separability (two different warnings). And 
so far I assume that this is also the case for multinomial models. 
For these models, if such errors occur, the coefficients are not 
very useful. In a loop (bootstrapping XYZ repetitions), I can 
catch the convergence problem via the $convergence variable 
(set to 1). But how can I catch cases of separability?


library(nnet)
y <- factor(rep(LETTERS[1:3], each=20))
a <- c(rep(1:4, each=10), rep(5:6, 10))
b <- c(rep(1:2, 20), rep(3:4, each=10))
mod <- multinom(y ~ a + b, model=T)


--
Sören Vogel, sovo0...@gmail.com, http://sovo0815.wordpress.com/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.