Re: [R] ML Estimation Differences with R and SAS

From: Rolf Turner <r.turner_at_auckland.ac.nz>
Date: Tue, 11 Mar 2008 08:38:18 +1300

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

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 10 Mar 2008 - 19:42:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 10 Mar 2008 - 20:30:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive