[R] Different result of multiple regression in R and SPSS
David Winsemius
dwinsemius at comcast.net
Thu Jul 21 16:47:07 CEST 2011
On Jul 19, 2011, at 7:19 PM, J. wrote:
> @Dimitri: I tried to enter it as numeric and still got the same
> outcome. I
> still wonder if there is any way to get the same result from both
> programs.
> @David, Bert: Yes, I found that the gender coefficient is R is
> exactly twice
> that of the one from SPSS. Need to study on parametrization.
Yes. I tested my own advice and did a google search with "different
parametrization of dummy variables spss and r".
1)
http://support.spss.com/productsext/spss/documentation/statistics/articles/catreg3.htm
2)
http://www.thejuliagroup.com/blog/?p=1531
3)
I'm not sure it should be in a publicly accessible site, but Google
links to a pdf of the full text of "Data Analysis and Graphics Using R
– an Example-Based Approach: Third Edition" by Maindonald % Braun
http://lib.dnu.dp.ua:8001/l/%D0%9A%D0%BE%D0%BF%D1%8C%D1%8E%D1%82%D0%B5%D1%80%D1%8B%D0%98%D1%81%D0%B5%D1%82%D0%B8/%D0%9F%D0%BE%D0%BF%D1%83%D0%BB%D1%8F%D1%80%D0%BD%D1%8B%D0%B5%20%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D1%8B/S-PLUS%20R/Data%20Analysis%20and%20Graphics%20Using%20R%203rd%20Edition.pdf
And chapter 7 would be where to look.
Bottom line. You should only be looking at coefficient values when you
know the coding of your factors. You cannot interpret the coefficients
of an SPSS run as differences between males and females, because they
are based on a -1 vs. 1 coding, what in R are called sum.contrasts. R
uses a default of treatment contrasts (0 versus 1) but will offer
sum.contrasts if asked nicely. (And you should never interpret "main
effects" coefficients when you are using interactions in models.
Always use predictions in that instance.)
> Thanks,
>
> Jay
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Different-result-of-multiple-regression-in-R-and-SPSS-tp3679423p3679590.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list