While looking for a R related solution I found some inconsistency between R and SPSS (ver. 24) in computing standardized residuals in a simple linear model.
It appears that what SPSS calls standarized residuals matches R studentized residuals
I'm far for assuming there is a software bug somewhere, but clearly things differ between those two programs.
Have a look at this example
#generate data in R
set.seed(111)
y = rnorm(20, 0, 1)
x = rnorm(20, 1, 1)
#calculate and standarized residuals
zresid<- rstandard(lm(y ~ x))
sresid<- rstudent(lm( y ~ x))
#make data frame
sampleData <- data.frame(y, x, zresid, sresid)
#save data for SPSS
library(foreign)
write.foreign(sampleData, "~/sampleData.sav", package="SPSS")
Then, in SPSS click your way through all the windows to import data and set up a linear regression ZRE and SRE residuals saved.
#load data to spss via syntax
GET DATA /TYPE=TXT
/FILE="~\sampleData.sav"
/DELCASE=LINE
/DELIMITERS=","
/ARRANGEMENT=DELIMITED
/FIRSTCASE=1
/DATATYPEMIN PERCENTAGE=95.0
/VARIABLES=
y F8.0
x F8.0
zresid F8.0
sresid F8.0
/MAP.
RESTORE.
#run a simple regression with standarized residuals (ZRESID) and studentized residuals (SRESID)
REGRESSION
/MISSING LISTWISE
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT y
/METHOD=ENTER x
/SAVE ZRESID SRESID.
Am I mad (or dumb) or indeed something is wrong here?
/method=enter
basically defines it – Derian