Kosuke --
Any hints on obtaining the coefficient vector from the zelig
mlogit model?
Apparently it is not of the form
m1$coef, or variants thereof, as documented.
Thanks,
Dan
%%%%%%%%%%%%%%%%%%%%%%%%
Daniel A. Powers, Ph.D.
Department of Sociology
University of Texas at Austin
1 University Station A1700
Austin, TX 78712-0118
phone: 512-232-6335
fax: 512-471-1748
dpowers(a)mail.la.utexas.edu
-----Original Message-----
From: owner-zelig(a)latte.harvard.edu
[mailto:owner-zelig@latte.harvard.edu]On Behalf Of Kosuke Imai
Sent: Friday, August 12, 2005 1:49 PM
To: Alejandro Buren
Cc: zelig(a)latte.harvard.edu; olau(a)fas.harvard.edu
Subject: Re: [zelig] Re: mlogit help
Hi Alejandro,
We have the documentation at
_TT_mlogit_TT__Multino.html In the next version, we will add the
fact
that the last level of the outcome variable is used as the base
category in the multinomial logit model. If there is anything else
unclear about the documentation, please let us know since our
goal is
to write a self-contained
As for the likelihood, I would follow Gary's suggestion of doing
something very simple - using a simulated data set where you know
the
truth for example. I would also double-check the log-likelihood
formula you are using: make sure you do all the calculation on the
log-scale - sometimes multiplying and dividing by very small or
large
numbers make the computer calculation incorrect. Doing all the
calculation on the log-scale should help.
Good luck,
Kosuke
---------------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics Fax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012
---------------------------------------------------------
On Aug 12, 2005, at 9:02 AM, Alejandro Buren wrote:
Dear Kosuke,
thanks for the tip, I've run the example, but there is something
I'm still missing.
Running the example, mlogit yields a set of parameters and a
LogLikelihood; when I use
that set of parameters to calculate the LogLikelihood myself (by
hand) I get a completely
different value.
mlogit is not working as I thougt it was, is there any document
which explains in more detail
than "Zelig: Everyone's statistical software" how it's working?
I would really appreciate it, since it's crucial for my research to
be able to fit these
multinomial logit models.
Thanks for your time and consideration,
-----------------------------------------------------
Alejandro Daniel Buren
Graduate Student
Memorial University of Newfoundland
St. John's, Newfoundland A1B 3X9 Canada
-----------------------------------------------------
----- Original Message ----- From: "Kosuke Imai"
<kimai(a)Princeton.Edu>
To: "Alejandro Buren" <aled38(a)yahoo.com.ar>
Cc: <zelig(a)latte.harvard.edu>du>; "Olivia Lau" <>
Sent: Thursday, August 11, 2005 6:44 PM
Subject: Re: [zelig] Re: mlogit help
> Dear Alejandro,
> The *last* level (rather than the first level) is the base
> category. In
> our mexico example (type demo(mexico)), for example, "3" is the
> base
> category.
> As for the difference between the two results, if you find
> another
> estimate that gives a greater value of the log-likelihood, your
> estimate
> is definitely not MLE!! From your mesasge, it seems that VGAM
> results are
> giving a better answer. Just to make sure they are calculating the
> same
> log-likelihood (sometimes, different software drops different
> constants),
> you might want to evaluate the log-likelihood for both estimates
> by hand.
> Good luck,
> Kosuke
>
> -----------------------------------------------------
> Kosuke Imai Office: Corwin Hall 041
> Assistant Professor Phone: 609-258-6601
> Department of Politics eFax: 973-556-1929
> Princeton University Email: kimai(a)Princeton.Edu
> Princeton, NJ 08544-1012
http://imai.princeton.edu
> -----------------------------------------------------
>
> On Thu, 11 Aug 2005, Alejandro Buren wrote:
>
>
>
>> Dear Olivia and Kosuke,
>> thank you very much for your kindness.
>> mlogit is taking the base-line category exactly as I thought
>> it was doing it.
>> But my problem remains, since the output is
>>
>>
>>> z.out <- zelig(food ~ small + han + okl + tra, model =
>>>
>> "mlogit", data = > alligator)
>>
>>> z.out
>>>
>> Call:
>> zelig(formula = food ~ small + han + okl + tra, model = "mlogit",
>> data = alligator)
>>
>> Coefficients:
>> (Intercept):1 (Intercept):2 (Intercept):3 (Intercept):4
>> small:1 small:2 small:3 small:4 han:1
>> han:2 han:3
>> -0.6931 -13.4332 -13.4332 -13.4332
>> -0.2178 0.5949 -1.0014 -1.0256 1.7697
>> 12.0783 12.6985
>> han:4 okl:1 okl:2 okl:3
>> okl:4 tra:1 tra:2 tra:3 tra:4
>> 13.2221 2.5126 14.9878 14.5858
>> 13.3380 1.0514 13.6991 13.5604 12.8731
>>
>> Degrees of Freedom: 636 Total; 616 Residual
>> Residual Deviance: 418.9
>> Log-likelihood: -209.5
>>
>>
>> I assume that (for example) intercept1 refers to the intercept
>> for the
>> first level which is not the base-line category (invertebrate).
>> If that
>> is so,
>> and I plug these estimates in the calculus of the log likelihood
>> yields
>> Log-likelihood: -284. Besides, the estimates are quite different
>> from
>> those reported by Agresti (2002):
>>
>> AGRESTI (2002) mlogit
>> intercept Size Hancock Oklawaha Trafford intercept Size
>> Hancock Oklawaha Trafford
>> Invertebrate -1.55 1.46 -1.66 0.94 1.12 Invertebrate
>> -0.6931 -0.2178 1.7694 2.5126 1.0514
>> Reptile -3.31 -0.35 1.24 2.46 2.94 Reptile -13.433 0.5949
>> 12.0783 14.9878 13.6991
>> Bird -2.09 -0.63 0.7 -0.65 1.09 Bird -13.433 -1.0014
>> 12.6985 14.5858 13.5604
>> Other -1.9 0.33 0.83 0.01 1.52 Other -13.433 -1.0256
>> 13.2221 13.338 12.8731
>>
>>
>>
>> I believe I'm missing something really important here but I don't
>> know what it is, could you please give me a hint?
>>
>> Thanks a lot in advance,
>>
>> Alejandro
>>
>> -----------------------------------------------------------------
>> ---
>> ------------
>>
>>
>> Dear Alejandro,
>>
>> All models that take a factor response (mlogit, oprobit, ologit,
>> etc) as
>> the dependent variable use the first level as the base case.
>>
>> Now you ask: What's the first level? For a numeric vector, the
>> first
>> level is the smallest level. For a vector of character strings,
>> the first
>> level is the first string value in alphabetical order.
>>
>> Best,
>>
>> Olivia
>>
>> On Thu, 11 Aug 2005, Alejandro Buren wrote:
>>
>>
>>> Dear all,
>>> I'm new to Zelig, I found it looking for a way to fit
>>>
>> multinomial logit > models with R.
>>
>>> I still haven't been able to figure out how "mlogit" chooses
>>>
>> the > base-line category.
>>
>>> I tried running an example I'm familiarized with (Alligator
>>>
>> Food Choice > Example, Ex 7.1.2
>>
>>> from Agresti 2002 "Categorical Data Analysis"), but that
>>>
>> didn't help > me to understand how it is working.
>>
>>> Could anyone help me out?
>>> I'm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0,0,0,0,0,0,0,0,0,0
>> ,0,
>> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>> ,0,
>> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
>>
>>> okl = > c
>>>
>> (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
>> 0,0
>> ,
>> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1
>> ,1,
>> 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
>> ,1,
>> 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>> ,0,
>> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
>>
>>> tra = > c
>>>
>> (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
>> 0,0
>> ,
>> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>> ,0,
>> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>> ,0,
>> 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
>> ,1,
>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
>>
>>>
>>>
>>>
>>>
>>>> z.out <- zelig(food ~ small + han + okl + tra, model =
>>>>
>> "mlogit", data > > = alligator)
>>
>>>
>>> --
>>> Alejandro Daniel Buren
>>> Graduate Student
>>> Memorial University of Newfoundland
>>> St. John's, Newfoundland A1B 3X9 Canada
>>>
>>> e-mail: aburen@xxxxxx
>>>
>>
>>
>>
>>
___________________________________________________________ 1GB
gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del
mundo
http://correo.yahoo.com.ar
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)latte.harvard.edu
[un]subscribe Options:
http://lists.hmdc.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)latte.harvard.edu
[un]subscribe Options:
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)latte.harvard.edu
[un]subscribe Options: