s-news
[Top] [All Lists]

Options(contrasts=..) in glm

To: s-news@wubios.wustl.edu
Subject: Options(contrasts=..) in glm
From: "Arsad Tanjung" <arsad_tanjung@hotmail.com>
Date: Sat, 28 Apr 2001 18:25:37 +0700
Dear s-ers,

When I fit a model using glm (e.g. low birth weight dataset, V&R pp
234-235), I found the results when stating this option:

options(contrasts=c("contr.treatment", "contr.poly"))

exactly the same as in the book:

Coefficients:
                 Value  Std. Error    t value
(Intercept)  0.82301258 1.244073209  0.6615467
       age -0.03723398 0.038677748 -0.9626718
       lwt -0.01565297 0.007075944 -2.2121383
raceblack  1.19240920 0.535745758  2.2256998
raceother  0.74068107 0.461460949  1.6050785
     smoke  0.75552501 0.424764466  1.7786916
       ptd  1.34376082 0.480444518  2.7969115
        ht  1.91316170 0.720434406  2.6555668
        ui  0.68019467 0.464215580  1.4652560
      ftv1 -0.43637856 0.479161054 -0.9107138
     ftv2+  0.17900705 0.456209017  0.3923795

BUT... when I do not state this option, the results are:

Coefficients:
                 Value  Std. Error    t value
(Intercept)  3.72790660 1.344892247  2.7718998
       age -0.03723398 0.038677748 -0.9626718
       lwt -0.01565297 0.007075944 -2.2121383
     race1  0.59620460 0.267872879  2.2256998
     race2  0.04815882 0.144406014  0.3334960
     smoke  0.37776250 0.212382233  1.7786916
       ptd  0.67188041 0.240222259  2.7969115
        ht  0.95658085 0.360217203  2.6555668
        ui  0.34009734 0.232107790  1.4652560
      ftv1 -0.21818928 0.239580527 -0.9107138
      ftv2  0.13239878 0.148931932  0.8889885

QUestion: Why do we need to state the option in order to get the correct
result?

Best regards,
Arsad



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


<Prev in Thread] Current Thread [Next in Thread>