Hi,
Can you send us a code that replicates this error using the data set we
provide with coxph? That way, we can determine whether this error is
general or something specific to your data set. Also, it would be great
if you could send your queries to the zelig mailing list (cc'd) so that
other users can give you suggestions and/or benefit from the discussion.
Thanks,
Kosuke
--
Department of Politics
Princeton University
http://imai.princeton.edu
On Fri, 24 Jul 2009, Murtaza Haider, Professor wrote:
Greetings:
I apologize for the delay in this response. I've been away on vacation. Thank you
for suggesting multinomial probit. I have tested it and it works fine.
There is another way of using Zelig to estimate McFadden's Logit models. Because of
the similarities in the likelihood functions, one can trick Cox proportional hazards
model, which is available in your package, to estimate McFadden's Logit model.
When I used the coxph working in your package, I confronted two issues. First, the choice
variable in my data set was a factor variable with names. The algorithm did not work until
I stripped the value labels "yes/no" from the binary (1/0) variable.
Secondly, I've not been able to simulate using the s.out command. I get to the s.out
stage that returns the message: "subscript out of bounds." Here is the command I
ran:
z.out <- zelig(Surv(t,choice) ~ invt+twait+gc+aasc+tasc+ basc+hinca+ strata(id),
model = "coxph", data = h09,na.action=na.exclude)
x.out <- setx(z.out, strata = "id")
s.out <- sim(z.out, x = x.out)
Sincerely, Murtaza
-----Original Message-----
From: Kosuke Imai [mailto:kimai@Princeton.EDU]
Sent: Friday, July 03, 2009 11:29 AM
To: Gary King
Cc: Murtaza Haider, Professor
Subject: Re: Thank you for Zelig
Hi,
Yes, reorganization is a bit of pain and so we may have to add that
model. For the mean time, you can incorporate choice specific covariates
in a relatively straightforward manner into a multinomial probit model;
http://imai.princeton.edu/software/MNP.html The model is quite a bit more
demanding than multinomial logit, but you may be able to fit it to your
data.
Good luck,
Kosuke
---------------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics Fax: 609-258-1101
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012
http://imai.princeton.edu/
---------------------------------------------------------
On Fri, 3 Jul 2009, Gary King wrote:
> Thanks for your note. I think its possible to use our mlogit command to run
> this model by reorganizing the data, but it wouldn't be pleasant to do that
> reorganization. And so it probably does make sense to add a new model (or
> easy function to do the reorg) for this.
??>
> Gary
> ---
>
http://gking.harvard.edu
>
>
> On 07/02/2009 06:05 PM, Murtaza Haider, Professor wrote:
>
> Hi:
>
>
??>
> Thank you indeed for your response. The
Logit model I am
> referring to is also known as McFadden?s Logit (2000 Noble in
> Economics). The likelihood function of McFadden?s Logit is
> similar to the Cox Proportional Hazard Model. Stata uses clogit
> or asclogit
> (
http://www.ats.ucla.edu/stat/stata/seminars/stata10/choice_models.htm)
> to estimate this model.
>
>
??>
> In McFadden?s Logit model, the data are
conditioned differently,
> where each decision-maker is repeated multiple times in the data
> set. Using the Mexico data set as an example, each respondent
> will in fact be entered in three rows because there are three
> choices in the dependant variable vote88.
>
>
??>
> Let?s assume that we have a variable that
controls for the
> number of face to face meetings between the respondent and
> representatives of the three political parties. This variable
> value will then be different for each party for each respondent.
> This will then become a choice-specific attribute. To deal with
> such data where the attributes of choice differ for each
> respondent, one cannot use the conventional multinomial Logit
> model. I have looked at the options available in the mlogit
> model under Zelig and believe that this model cannot be fitted
> using Zelig.
>
>
??>
> Sincerely, Murtaza
>
>
??>
>
??>
>
??>
>> From: Gary King [mailto:king@harvard.edu]
>> Sent: Thursday, July 02, 2009 5:16 PM
>> To: Murtaza Haider, Ph.D.
>> Subject: Re: Thank you for Zelig
>>
>
??>
>>
>> doesn't the 'mlogit' model at
>>
http://gking.harvard.edu/zelig/docs/index.html do what you want?
>>
>> thanks for the kind words.
>>
>> Gary
>> ---
>>
http://gking.harvard.edu
>>
>>
>> On 07/02/2009 11:27 AM, Murtaza Haider, Ph.D. wrote:
>>
>> Dear Gary:
>>
>
??>
>> I m writing this message to express my deep gratitude for Zelig. It is
>> proving to be a great help in teaching econometrics to my students who
>> are usually uninitiated in statistics and probability.
>>
>
??>
>> I would like to suggest mlogit (with choice-specific attributes as
>> regressors) to be considered for Zelig. I believe it is not part of
>> Zelig yet. The package is available at the following URL:
>>
>>
http://cran.r-project.org/web/packages/mlogit/index.html
>>
>
??>
>
??>
>> Sincerely,
>>
>
??>
>> Murtaza
>>
>
??>
>> --
>> Murtaza Haider, Ph.D.
>> Associate Professor
>> Ted Rogers School of Retail Management, Ryerson University
>> Director, Institute of Housing & Mobility
>>
>> 350 Victoria Street (Street entrance: 55 Dundas Street West)
>>
>> Toronto, Ontario Canada M5B 2K3
>> Tel: 416.979.5000 x 2480, Fax: 416.979.5324
>>
>
??>