[R] Different result of multiple regression in R and SPSS
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
> @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".
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
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.)
> 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
> 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