心理学研究方法研修材料(4): 变量中心化SPSS程序
AGGREGATE
/OUTFILE=*
MODE=ADDVARIABLES
OVERWRITEVARS=YES
/PRESORTED
/BREAK=GroupNo
/mY1 = MEAN(Y1) / mY2 = MEAN(Y2) / mY3 = MEAN(Y3)
/mX1 = MEAN(X1) / mX2 = MEAN(X2) / mX3 = MEAN(X3)
/mX4 = MEAN(X4) / mX5 = MEAN(X5) / mX6 = MEAN(X6)
* GroupNo is a variable to classify samples.
* GroupNo = 1 for all cases when there is only one group of samples.
COMPUTE Y1C=Y1 – mY1. COMPUTE Y2C=Y2 – mY2.
COMPUTE Y3C=Y3 – mY3. COMPUTE X1C=X1 – mX1.
COMPUTE X2C=X2 – mX2. COMPUTE X3C=X3 – mX3.
COMPUTE X4C=X4 – mX4. COMPUTE X5C=X5 – mX5.
COMPUTE X6C=X6 –mX6. COMPUTE X1CX4C=X1C * X4C.
COMPUTE X2CX5C=X2C * X5C. COMPUTE X3CX6C=X3C * X6C.
EXECUTE.
SAVE OUTFILE = ‘D:\ filename.sav’
/KEEP = GroupNo Y1C Y2C Y3C X1C X2C X3C X4C X5C X6C X1CX4C X2CX5C X3CX6C
/COMPRESSED.
参考文献:温忠麟, 刘红云, & 侯杰泰. (2012). 调节效应和中介效应分析. 教育科学出版社.p.103-104.