even if anova() command does not work for mlogit,
all necessary informaition
(residual deviance and degrees of freedom) is available in summary(z.out1).
Kosuke
--
Department of Politics
Princeton University
Thank you very much. I was assuming the
as.factor() was not necessary
when the variable already is a factor, but I should have read more
carefully.
Another question about the mlogit model: is it possible to perform
some kind of variance analysis on the predictors of the model? For
example, if I fitted the model <COLOR~AGE+RACE, model=mlogit> in which
color is someones favorite color, and I wish to answer the question:
does race significantly predict someones favorite color? So I would
like to do an omnibus test for all parameters fitted for the term
'race', which are (color-1)*(race-1) parameters in the mlogit case if
I'm not mistaken.
For normal and logit model I implemented this using the SS type 3,
using the drop1 function (which calculates the decrease in LR when the
term would be dropped from the model). For example:
data(mexico);
options(contrasts=c("contr.sum", "contr.poly"));
z.out1 <- zelig(age ~ pristr + factor(othcok) + othsocok,model =
"normal", data = mexico)
drop1(z.out1,attributes(z.out1$terms)$term.labels,test="Chisq");
z.out2 <- zelig(as.factor(vote88) ~ pristr + factor(othcok) +
othsocok, model = "mlogit", data = mexico)
drop1(z.out2,attributes(z.out2$terms)$term.labels,test="Chisq");
anova() and aov() give similar errors for mlogit models. Is there any
other way to perform a per-term variance analysis, or doesn't this
make any sense?
Thank you!
Jeroen
is it possible perform some kind of variance analysis on the
predictors of a fitted mlogit model?
On Fri, Sep 26, 2008 at 5:54 PM, Ferdinand Alimadhi
<falimadhi(a)iq.harvard.edu> wrote:
Hi Jeroen,
Can you try to use :
mymodel<- zelig(as.factor(RACE)~AGE+REGION,data=US1991,model="mlogit")
Zelig needs to know when the same formula is used for each level
(as.factor()) or different formulas for each level (id())
http://gking.harvard.edu/zelig/docs/mlogit.pdf
Thanks,
Ferdi
Jeroen Ooms wrote:
The mlogit model returns an error:
mymodel<- zelig(RACE~AGE+REGION,data=US1991,model="mlogit")
Error in attr(tt, "depFactors")$depFactorVar :
$ operator is invalid for atomic vectors
I think it is a problem with the VGAM package. According to this topic
<http://tolstoy.newcastle.edu.au/R/e3/help/07/12/5772.html> using $ on
an atomic vector raises a warning sinsce R2.5.0 and an error since R
2.7.2.
However, the VGAM package has been updated at 2008-05-14 so I
dont understand why it would not be fixed. Am I doing something wrong?
I am using R version 2.7.2 (2008-08-25), VGAM_0.7-7, Zelig_3.3-1.
VGAM is giving a lot of warnings when it is loaded, could there be
some conflict?
Attaching package: 'VGAM'
The following object(s) are masked from package:splines :
bs,
ns
The following object(s) are masked from package:boot :
logit,
simplex
The following object(s) are masked from package:stats :
biplot,
coefficients,
deviance,
df.residual,
effects,
fitted,
fitted.values,
poly,
predict,
resid,
residuals,
weights
The following object(s) are masked from package:graphics :
persp
The following object(s) are masked from package:base :
identity,
scale.default
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/