s-news
[Top] [All Lists]

Treatment coding "reversed" (solved)

To: "S-PLUS Newsgroup (E-mail) (E-post)" <s-news@lists.biostat.wustl.edu>
Subject: Treatment coding "reversed" (solved)
From: Jan Brogger <Jan.Brogger@med.uib.no>
Date: Fri, 15 Dec 2000 23:08:25 +0100
Reply-to: "Jan.Brogger@med.uib.no" <Jan.Brogger@med.uib.no>
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

<Prev in Thread] Current Thread [Next in Thread>
  • Treatment coding "reversed" (solved), Jan Brogger <=