[R] ML Estimation Differences with R and SAS

Rolf Turner r.turner at auckland.ac.nz
Mon Mar 10 20:38:18 CET 2008


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}}



More information about the R-help mailing list