Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Nick Brown
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 vari

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Viechtbauer Wolfgang (SP)
Well, one correction -- the 'standardized coefficients' that SPSS shows are based on standardizing all variables separately (so x1, x2, and x1*x2 are all standardized). So with respect to that, the criticism certainly stands. -Original Message- From: Viechtbauer Wolfgang (SP) Sent: Frid

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Viechtbauer Wolfgang (SP)
Totally agree that standardizing the interaction term is nonsense. But in all fairness, SPSS doesn't do that. In fact, the 'REGRESSION' command in SPSS doesn't compute any interaction terms -- one has to first compute them 'by hand' and then add them to the model like any other variable. So some

Re: [Rd] A few suggestions and perspectives from a PhD student

2017-05-05 Thread Gabor Grothendieck
Regarding the anonymous-function-in-a-pipeline point one can already do this which does use brackets but even so it involves fewer characters than the example shown. Here { . * 2 } is basically a lambda whose argument is dot. Would this be sufficient? library(magrittr) 1.5 %>% { . * 2 } ##

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Fox, John
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. >

Re: [Rd] A few suggestions and perspectives from a PhD student

2017-05-05 Thread Ista Zahn
On Fri, May 5, 2017 at 1:00 PM, Antonin Klima wrote: > Dear Sir or Madam, > > I am in 2nd year of my PhD in bioinformatics, after taking my Master’s in > computer science, and have been using R heavily during my PhD. As such, I > have put together a list of certain features in R that, in my opin

[Rd] A few suggestions and perspectives from a PhD student

2017-05-05 Thread Antonin Klima
Dear Sir or Madam, I am in 2nd year of my PhD in bioinformatics, after taking my Master’s in computer science, and have been using R heavily during my PhD. As such, I have put together a list of certain features in R that, in my opinion, would be beneficial to add, or could be improved. The fir

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Nick Brown
>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! - Original Message - From: "peter dalgaard"

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread peter dalgaard
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

Re: [Rd] complex tests failure

2017-05-05 Thread Tomas Kalibera
Thanks for the report, handled in configure in 72661 (R-devel). I'll also port to R-patched. Best Tomas On 05/04/2017 03:49 PM, Tomas Kalibera wrote: > > There is no way to control this at runtime. > We will probably have to add a configure test. > > Best, > Tomas > > On 05/04/2017 03:23 PM, Kasp

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Viechtbauer Wolfgang (SP)
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 produ

[Rd] Possible bug in how POSIXct is printed

2017-05-05 Thread Deonarine, Ajay
Greetings R-devel group. When dealing with Inf dates, as.POSIXct seems to return Inf, but is printed as NA: > x1 <- as.POSIXct(Inf, origin = '1970-01-01') > print(x1) [1] NA > is.na(x1) [1] FALSE > is.infinite(x1) [1] TRUE > POSIXlt at least evaluates and prints the result consistently: > x1 <

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Nick Brown
Hi, Here is (I hope) all the relevant output from R. > mean(s1$ZDEPRESSION, na.rm=T) [1] -1.041546e-16 > mean(s1$ZDIVERSITY_PA, > na.rm=T) [1] -9.660583e-16 > mean(s1$ZMEAN_PA, na.rm=T) [1] -5.430282e-15 > > lm.ridge(ZDEPRESSION ~ ZMEAN_PA * ZDIVERSITY_PA, data=s1)$coef ZMEAN_PA >Z

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread peter dalgaard
I asked you before, but in case you missed it: Are you looking at the right place in SPSS output? The UNstandardized coefficients should be comparable to R, i.e. the "B" column, not "Beta". -pd > On 5 May 2017, at 01:58 , Nick Brown wrote: > > Hi Simon, > > Yes, if I uses coefficients() I