Skip to content
Back to formatted view

Raw Message

Message-ID: <208B2BA3-FFAA-4C2E-BDB1-D05F6A8E9F04@auckland.ac.nz>
Date: 2008-03-10T19:38:18Z
From: Rolf Turner
Subject: ML Estimation Differences with R and SAS
In-Reply-To: <000001c882d1$73288430$59798c90$@net>

On 11/03/2008, at 6:09 AM, Patrick Richardson wrote:

> List,
>
> I'm working on fitting a logistic model for a well known dataset  
> (which is
> given below in case anyone wants to try to reproduce).  I used both  
> R and
> SAS to fit the model and have some differences in the parameter  
> estimates.
> I'm wondering if R calculates the ML estimates differently.  I'm  
> making NO
> accusations as to which program is "right or wrong".  That is not  
> the focus
> of this posting.  As a "newer" R user I'm trying to understand the  
> algorithm
> that R might use to calculate ML estimation.  The largest  
> difference seems
> to with the race factors.  R gives a p-value of 0.46995 for  
> race=black and
> SAS gives a p-value of 0.0753 for race=black.  Clearly one is  
> borderline
> significant and the other is not.  Many thanks to all who might be  
> able to
> offer any insight on this.  Both R and SAS code and output are  
> included in
> this message (along with the dataset).

Try setting

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

before you run your analysis in R.

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}