Charles Berry <ccberry <at> ucsd.edu> writes:

> 
> Scherber, Christoph <cscherb1 <at> gwdg.de> writes:
> 
> > 
> > Dear all,
> > 
> > I am trying to express a multinomial GLM (using nnet) as a series of GLM
> models.

[deleted]

> 
> Doing the obvious comparison:
> 
> ggen.preds <- 
>     sapply( levels(multicats), 
>             function(x) predict(glm(I(multicats==x)~multiplan1,
>                          family=binomial),type="response"))
> 
> max(abs(ggen.preds-predict(m2,type="probs")))
> ## [1] 1.349607e-06

 
> The predictions are the same - up to numerical issues in the algorithms.
> 

But as John Fox points out this does not hold for the general case.

It worked here because the regressor has two categories.

HTH,

Chuck

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

Reply via email to