Date: Thu, 6 Jan 2005 14:10:52 -0800
Reply-To: Dale McLerran <stringplayer_2@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dale McLerran <stringplayer_2@YAHOO.COM>
Subject: Re: Clustering with conditional logit model -- NLMIXED
In-Reply-To: <200501052346.j05Nkv8t013339@listserv.cc.uga.edu>
Content-Type: text/plain; charset=us-ascii
Noreen,
I have no expertise with the procedure MDC. I took a brief look
at the description of the MDC procedure and noticed that for
conditional logit models, the MDC procedure includes a random
error term in eta{ij} with Gumbel distribution. Could this be
why the results from the MDC procedure and the procedure NLMIXED
do not match each other?
Your NLMIXED code looks like code which I have seen for brand
choice modeling. I believe that the random effects model which
you specify is overparameterized in that you have included a
random intercept term for each of the three choices. Note that
you only have fixed effect intercept terms for walking and
taking the bus. You don't include a fixed effect intercept for
driving because that would result in overparameterization, right?
Well, by the same token, including a random effect intercept
term for each of the choices would also result in
overparameterization. Thus, I believe that you want to fit the
model
proc nlmixed data=mnlplay;
parms beta 1=-.1 beta2=-.1 beta3=-.1 busdum=-1 walkdum=2
/*starting values are from proc mdc results*/;
eta1 = beta1*timeauto;
eta2 = busdum + beta2*timebus + u_bus;
eta3 = walkdum + betae*timewalk + u_walk;
prob1 = eta1 / (eta1 + eta2 + eta3);
prob2 = eta2 / (eta1 + eta2 + eta3);
prob3 = eta3 / (eta1 + eta2 + eta3);
if mode=1 then loglike=log(prob1); else
if mode=2 then loglike=log(prob2); else
if mode=3 then loglike=log(prob3);
model mode ~ general(loglike);
random u_bus u_walk ~
normal([0,0], [exp(2*s_bus),
exp(s_bus+s_walk),
exp(2*s_walk)]) subject=houseID;
run;
Dale
>
--- Noreen McDonald <noreen@BERKELEY.EDU> wrote:
> I am developing a relatively standard multinomial model to predict
> travel
> mode (auto, walk, bus). I've used proc mdc to estimate the basic
> conditional logit model and get reasonable results (see below for
> code).
> My problem is that I sample multiple members of the same household
> and
> want to account for this clustering in order to get appropriate std
> errors. There appears to be no simple 'repeated' statement available
> in
> proc mdc. I've been looking at proc nlmixed, but have been utterly
> flummoxed by the syntax.
>
> I would like to estimate the probabilities of choosing each mode with
> a
> random effect based on household membership(ie Ua=b1*timeauto+u1;
> Ub=a1*busdum+b2*timebus+u2; Uw=a2*walkdum+b3*timewalk+u3, where u1-u3
> are
> re with subject=houseid). I have tried to play around with the
> nlmixed
> syntax simply to replicate my proc mdc results and have been
> unsuccessful. I'd really appreciate help on:
> 1. how to formulate multinomial logit models for nlmixed (see my
> very
> weak attempts below),
> 2. how to introduced a random effect based on household id, and
> 3. how the data should be set up for nlmixed (ie is it the same as
> for
> proc mdc with a conditional logit model)
>
> Thanks so much !!! Noreen McDonald
>
> /*working conditional logit code*/
> proc mdc data=logit.mnl3std;
> model decision = busdum walkdum timeauto timebus timewalk
> / type=clogit optmethod=qn covest=hess choice=(mode 1 2 3);
> id pid;
> title 'MDC Simple: Car Bus Walk';
> run;
>
> /*non-working attempts to generate nlmixed model which replicates
> proc mdc
> results*/
> proc nlmixed data=mnlplay;
> parms beta 1=-.1 beta2=-.1 beta3=-.1
> busdum=-1 walkdum=2/*starting values are from proc mdc results*/;
> prob1 = exp(beta1*timeauto) /
> (exp(beta1*timeauto) +
> exp(busdum +beta2*timebus) +
> exp(walkdum + beta3*timewalk) );
> prob2 = exp(busdum+beta2*timebus ) /
> (exp(beta1*timeauto) +
> exp(busdum+beta2*timebus ) +
> exp(walkdum + beta3*timewalk) );
> prob3 = exp(walkdum + beta3*timewalk) /
> (exp(beta1*timeauto) +
> exp(busdum +beta2*timebus) +
> exp(walkdum + beta3*timewalk) );
>
> if mode=1 then loglike=log(prob1); else
> if mode=2 then loglike=log(prob2); else
> if mode=3 then loglike=log(prob3);
> model mode ~ general(loglike);
> run;
>
=====
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com