Dear Dan,
mlogit output is of the S4 class, use @ where you would use $.
Yours, Olivia
On 6/5/07, B. Dan Wood <bdanwood(a)polisci.tamu.edu> wrote:
The "names(model.out)" syntax does not seem to be working for the mlogit
procedure as it does for the other procedures. Also, the normal syntax given
on your website for calling particular outputs (model.out$output) does not
seem to work. However, an alternative syntax does work (output(model.out)).
For example here is some output that shows the difficulties.
library(Zelig)
mlogit.out <- zelig(as.factor(LETTERS) ~ GPA +
TUCE + PSI, model =
"mlogit", data = Spector)
There were 22 warnings (use warnings() to see them)
summary(mlogit.out)
Call:
zelig(formula = as.factor(LETTERS) ~ GPA + TUCE + PSI, model = "mlogit",
data = Spector)
Pearson Residuals:
Min 1Q Median 3Q Max
log(mu[,1]/mu[,3]) -0.61 -0.0012 -2.9e-07 1.9e-08 2.3
log(mu[,2]/mu[,3]) -1.67 -0.5765 -2.3e-01 6.6e-01 2.7
Coefficients:
Value Std. Error t value
(Intercept):1 53.007 30.26 1.752
(Intercept):2 5.746 3.66 1.570
GPA:1 -21.779 11.75 -1.853
GPA:2 -1.241 1.07 -1.160
TUCE:1 0.449 0.49 0.922
TUCE:2 -0.036 0.13 -0.283
PSI:1 -31.341 660.80 -0.047
PSI:2 -2.478 0.98 -2.537
Number of linear predictors: 2
Names of linear predictors: log(mu[,1]/mu[,3]), log(mu[,2]/mu[,3])
Dispersion Parameter for multinomial family: 1
Residual Deviance: 36.39 on 56 degrees of freedom
Log-likelihood: -18.19 on 56 degrees of freedom
Number of Iterations: 16
names(mlogit.out)
NULL
# Model Coefficients
beta <-coefficients(mlogit.out)
beta
(Intercept):1 (Intercept):2 GPA:1 GPA:2 TUCE:1
53.00740 5.74626 -21.77885 -1.24076 0.44857
TUCE:2 PSI:1 PSI:2
-0.03565 -31.34106 -2.47849
beta <- mlogit.out$coefficients
Warning message:
$ operator not defined for this S4 class, returning NULL in:
mlogit.out$coefficients
B. Dan Wood
Professor
Department of Political Science
Texas A&M University
4348 TAMU
College Station, TX 77843-4348
Office Phone: 979-845-1610
Office FAX: 979-847-8924
Web:
http://www-polisci.tamu.edu/bdanwood
Email: bdanwood(a)polisci.tamu.edu
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: