Dear listers. Platform: S-PLUS 2000 on Win98.
I estimated a logistic regression with treatment contrasts and wanted the
odds ratios, and did this:
>exp(coefficients(astma.glm))
But the reference categories were switched, e.g. I got an odds ratio of
0.33 instead of 3. After some fiddling around figuring the factors were
coded wrong etc., I discovered that you would have to do:
>exp(-coefficients(astma.glm))
In this respect, S+ is different from other stats packages (SPSS/Stata)
Does anybody have an explanation of why S+ does this ?
I thought that this would be of interest to some beginners. It's a small
problem but cost me some hours. The FAQ I found at
ftp://ftp.stat.math.ethz.ch/pub/Doc/S-faq.txt wasn't very helpful. Perhaps
this little problem could be added ?
Yours, Jan Brogger, MD
PhD student, Respiratory Epidemiology Group, University of Bergen, Norway
|