[R] Fitted probabilities in conditional logit regression

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Sep 5 12:44:46 CEST 2008


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
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list