SPSS Syntax for Mediation Bootstrap Example
Note: In the /OUTFILE lines, edit the folder to indicate where you want to save the output files on your computer.
SET RNG=MT MTINDEX=54321 .
MODEL PROGRAM b0=.000 b1=.390 .
COMPUTE PRED = b0 + b1*comz .
CNLR attz
/OUTFILE='C:\TEACHING\LANCASTER\MEDIATE\ATTZ1.SAV'
/BOOTSTRAP=1000 .
SET RNG=MT MTINDEX=54321 .
MODEL PROGRAM b0=.000 b1=.262 b2=.295 .
COMPUTE PRED = b0 + b1*comz + b2*attz .
CNLR idez
/OUTFILE='C:\TEACHING\LANCASTER\MEDIATE\IDEZ12.SAV'
/BOOTSTRAP=1000 .
SET RNG=MT MTINDEX=54321 .
MODEL PROGRAM b0=.000 b1=.579 .
COMPUTE PRED = b0 + b1*comz .
CNLR truz
/OUTFILE='C:\TEACHING\LANCASTER\MEDIATE\TRUZ1.SAV'
/BOOTSTRAP=1000 .
SET RNG=MT MTINDEX=54321 .
MODEL PROGRAM b0=.000 b1=.047 b2=.218 b3=.424 .
COMPUTE PRED = b0 + b1*comz + b2*attz + b3*truz .
CNLR idez
/OUTFILE='C:\TEACHING\LANCASTER\MEDIATE\IDEZ123.SAV'
/BOOTSTRAP=1000 .
SET RNG=MT MTINDEX=54321 .
MODEL PROGRAM b0=.000 b1=.508 b2=.182 .
COMPUTE PRED = b0 + b1*comz + b2*attz .
CNLR truz
/OUTFILE='C:\TEACHING\LANCASTER\MEDIATE\TRUZ12.SAV'
/BOOTSTRAP=1000 .
SET RNG=MT MTINDEX=54321 .
MODEL PROGRAM b0=.000 b1=.552 .
COMPUTE PRED = b0 + b1*idez .
CNLR ocbz
/OUTFILE='C:\TEACHING\LANCASTER\MEDIATE\OCBZ4.SAV'
/BOOTSTRAP=1000 .
SET RNG=MT MTINDEX=54321 .
MODEL PROGRAM b0=.000 b1=.253 b2=.183 b3=-.191 b4=.486 .
COMPUTE PRED = b0 + b1*comz + b2*attz + b3*truz + b4*idez .
CNLR ocbz
/OUTFILE='C:\TEACHING\LANCASTER\MEDIATE\OCBZ1234.SAV'
/BOOTSTRAP=1000 .