> On 6 May 2017, at 01:49 , Nick Brown wrote:
>
> Hi John,
>
> Thanks for the comment... but that appears to mean that SPSS has a big
> problem. I have always been told that to include an interaction term in a
> regression, the only way is to do the multiplication by hand. But then it
> seems to be impossible to stop SPSS from re-standardizing the variable that
> corresponds to the interaction term. Am I missing something? Is there a way
> to perform the regression with the interaction in SPSS without computing the
> interaction as a separate variable?
Just look at the unstandardized coefficients in SPSS. The standardized ones are
of some usefulness, but it is limited in the case of syntesized regressors like
product terms. I imagine that the interpretation also goes whacky for squared
terms, dummy coded groupings, etc.
(Does SPSS really still not have an automated way of generating interaction
terms? 1977 called googling Looks like GLM understands them, REGRESS
not.)
-pd
>
> Best,
> Nick
>
> From: "John Fox"
> To: "Nick Brown" , "peter dalgaard"
> Cc: r-devel@r-project.org
> Sent: Friday, 5 May, 2017 8:22:53 PM
> Subject: Re: [Rd] lm() gives different results to lm.ridge() and SPSS
>
> Dear Nick,
>
>
> On 2017-05-05, 9:40 AM, "R-devel on behalf of Nick Brown"
> wrote:
>
> >>I conjecture that something in the vicinity of
> >> res <- lm(DEPRESSION ~ scale(ZMEAN_PA) + scale(ZDIVERSITY_PA) +
> >>scale(ZMEAN_PA * ZDIVERSITY_PA), data=dat)
> >>summary(res)
> >> would reproduce the SPSS Beta values.
> >
> >Yes, that works. Thanks!
>
> That you have to work hard in R to match the SPSS results isn’t such a bad
> thing when you factor in the observation that standardizing the
> interaction regressor, ZMEAN_PA * ZDIVERSITY_PA, separately from each of
> its components, ZMEAN_PA and ZDIVERSITY_PA, is nonsense.
>
> Best,
> John
>
> -
> John Fox, Professor
> McMaster University
> Hamilton, Ontario, Canada
> Web: http://socserv.mcmaster.ca/jfox/
>
>
> >
> >
> >- Original Message -
> >
> >From: "peter dalgaard"
> >To: "Viechtbauer Wolfgang (SP)"
> >, "Nick Brown"
> >
> >Cc: r-devel@r-project.org
> >Sent: Friday, 5 May, 2017 3:33:29 PM
> >Subject: Re: [Rd] lm() gives different results to lm.ridge() and SPSS
> >
> >Thanks, I was getting to try this, but got side tracked by actual work...
> >
> >Your analysis reproduces the SPSS unscaled estimates. It still remains to
> >figure out how Nick got
> >
> >>
> >coefficients(lm(ZDEPRESSION ~ ZMEAN_PA * ZDIVERSITY_PA, data=s1))
> >
> >(Intercept) ZMEAN_PA ZDIVERSITY_PA ZMEAN_PA:ZDIVERSITY_PA
> >0.07342198 -0.39650356 -0.36569488 -0.09435788
> >
> >
> >which does not match your output. I suspect that ZMEAN_PA and
> >ZDIVERSITY_PA were scaled for this analysis (but the interaction term
> >still obviously is not). I conjecture that something in the vicinity of
> >
> >res <- lm(DEPRESSION ~ scale(ZMEAN_PA) + scale(ZDIVERSITY_PA) +
> >scale(ZMEAN_PA * ZDIVERSITY_PA), data=dat)
> >summary(res)
> >
> >would reproduce the SPSS Beta values.
> >
> >
> >> On 5 May 2017, at 14:43 , Viechtbauer Wolfgang (SP)
> >> wrote:
> >>
> >> I had no problems running regression models in SPSS and R that yielded
> >>the same results for these data.
> >>
> >> The difference you are observing is from fitting different models. In
> >>R, you fitted:
> >>
> >> res <- lm(DEPRESSION ~ ZMEAN_PA * ZDIVERSITY_PA, data=dat)
> >> summary(res)
> >>
> >> The interaction term is the product of ZMEAN_PA and ZDIVERSITY_PA. This
> >>is not a standardized variable itself and not the same as "ZINTER_PA_C"
> >>in the png you showed, which is not a variable in the dataset, but can
> >>be created with:
> >>
> >> dat$ZINTER_PA_C <- with(dat, scale(ZMEAN_PA * ZDIVERSITY_PA))
> >>
> >> If you want the same results as in SPSS, then you need to fit:
> >>
> >> res <- lm(DEPRESSION ~ ZMEAN_PA + ZDIVERSITY_PA + ZINTER_PA_C,
> >>data=dat)
> >> summary(res)
> >>
> >> This yields:
> >>
> >> Coefficients:
> >> Estimate Std. Error t value Pr(>|t|)
> >> (Intercept) 6.41041 0.01722 372.21 <2e-16 ***
> >> ZMEAN_PA -1.62726 0.04200 -38.74 <2e-16 ***
> >> ZDIVERSITY_PA -1.50082 0.07447 -20.15 <2e-16 ***
> >> ZINTER_PA_C -0.58955 0.05288 -11.15 <2e-16 ***
> >> ---
> >> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> >>
> >> Exactly the same as in the png.
> >>
> >> Peter already mentioned this as a possible reason for the discrepancy:
> >>https://stat.ethz.ch/pipermail/r-devel/2017-May/074191.html ("Is it
> >>perhaps the case that x1 and x2 have already been scaled to have
> >>standard deviation 1? In that case, x1*x2 won't be.")
> >>
> >> Best,
> >> Wolfgang
> >>
> >> -Original Message-
> >> From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Nick
> >>Brown
> >> Sent: Friday, May 05, 2017 10:40
> >> To: peter dalgaard
> >> Cc: r-devel@r-project.org
> >> Subject: Re: [Rd] lm() gives different r