Message-ID: <1220611486.31551.5.camel@prometheus.geog.ucl.ac.uk>
Date: 2008-09-05T10:44:46Z
From: Gavin Simpson
Subject: Fitted probabilities in conditional logit regression
In-Reply-To: <7fdde3030808310649j139baf95s1e12ea03c2e86318@mail.gmail.com>
On Sun, 2008-08-31 at 09:49 -0400, Min Chen wrote:
> Dear R-help,
>
> I'm doing conditional logit regression for a discrete choice model.
> I want to know whether there's a way to get the fitted probabilities. In
> Stata, "predict" works for clogit, but it seems that in R "predict" does
> not.
>
> Thank you very much!
>
> Best wishes.
Can you explain/demonstrate how/why "predict" doesn't work for clogit? I
can get predictions from a clogit model:
## from ?clogit
mod <- clogit(case~spontaneous+induced+strata(stratum),data=infert)
predict(mod)
predict(mod, type = "expected")
all work for that example to give the "fitted" values.
See ?predict.coxph for details of the predict function. I'm not familiar
with either the code or the methods, but 'type = "expected"' seems to
give what you want.
HTH
G
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Dr. Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%