/* HOW TO USE. */ /* Run this macro once (i.e., Run All) in the session you are doing cross-product regression. */ /* After that, you may run cross products using this syntax. */ /* !CrossProduct DV IV1 IV2 . */ /* Take out the slashes and asterisks and the beginning and the end and substitute your dependent variable for DV and your first predictor for IV1 and your moderator variable for IV2. */ /* For example if you were predicting test performance with a speed varible moderated by an accuracy varible, the syntax would be: */ /* !CrossProduct TestPerformance Speed Accuracy . */ /* You would, of course remove the /* at the begining and end of the line. */ /* You don't need to run the "!CrossProduct" function in this syntax window after you have run this macro once for each SPSS session. */. /* What does the macro do? First, it creates duplicate varibles. Then it centers the variables. Then it creates the interaction term. */ /* The cross-product regression is run by entering the first predictor as model 1 then adding in the moderator variable as model 2. */ /* The interaction term is added last as model 3. The "main effects" of the first predictor and the moderator are the simple slopes when the other variable is average. */ /* If the R squred change is significant for model 3, it is reasonable to examine the follow-up analyses that appear below. */ /* A standard deviation is subtracted from the centered moderator so the that 0 falls at the 1 SD above the mean mark. */ /* This rescaling of the moderator changes the meaning of the main effect of the first predictor so that it is the simple slope of the first predictor when the moderator is 1 SD above the mean. */ /* A standard deviation is added to the centered moderator so that 0 now falls at the 1 SD below the mean mark. */ /* Running the regression again produces the simple slope of the first predictor when the moderator is 1 SD below the mean. */ DEFINE !CrossProduct (!POSITIONAL !TOKENS(1) / !POSITIONAL !TOKENS(1) / !POSITIONAL !TOKENS(1)) . COMPUTE Dep = !1 . COMPUTE PR1 = !2 . COMPUTE Moderator = !3 . COMPUTE UniBreaker = 1 . EXECUTE . APPLY DICTIONARY /FROM * /SOURCE VARIABLES = !1 /TARGET VARIABLES = Dep /FILEINFO /VARINFO ALIGNMENT FORMATS LEVEL MISSING VALLABELS = REPLACE ATTRIBUTES = REPLACE VARLABEL WIDTH . APPLY DICTIONARY /FROM * /SOURCE VARIABLES = !2 /TARGET VARIABLES = PR1 /FILEINFO /VARINFO ALIGNMENT FORMATS LEVEL MISSING VALLABELS = REPLACE ATTRIBUTES = REPLACE VARLABEL WIDTH . APPLY DICTIONARY /FROM * /SOURCE VARIABLES = !3 /TARGET VARIABLES = Moderator /FILEINFO /VARINFO ALIGNMENT FORMATS LEVEL MISSING VALLABELS = REPLACE ATTRIBUTES = REPLACE VARLABEL WIDTH . AGGREGATE /OUTFILE=* MODE=ADDVARIABLES OVERWRITEVARS=YES /BREAK=UniBreaker /Moderator_sd = SD(Moderator) /PR1_mean = MEAN(PR1) /Moderator_mean = MEAN(Moderator). COMPUTE CPR1 = PR1 - PR1_mean . COMPUTE CModerator = Moderator - Moderator_mean . EXECUTE . COMPUTE Interaction = CPR1 * CModerator . EXECUTE . APPLY DICTIONARY /FROM * /SOURCE VARIABLES = !2 /TARGET VARIABLES = CPR1 /FILEINFO /VARINFO ALIGNMENT FORMATS LEVEL MISSING VALLABELS = REPLACE ATTRIBUTES = REPLACE VARLABEL WIDTH . APPLY DICTIONARY /FROM * /SOURCE VARIABLES = !3 /TARGET VARIABLES = CModerator /FILEINFO /VARINFO ALIGNMENT FORMATS LEVEL MISSING VALLABELS = REPLACE ATTRIBUTES = REPLACE VARLABEL WIDTH . TITLE 'Cross-product regression when both predictors are centered.' . REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA CHANGE /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT Dep /METHOD=ENTER CPR1 /METHOD=ENTER CModerator /METHOD=ENTER Interaction . COMPUTE CModerator = CModerator - Moderator_sd . EXECUTE . COMPUTE Interaction = CPR1 * CModerator . EXECUTE . VARIABLE LABEL CPR1 'The simple slope of the Predictor when the Moderator is 1 SD above its mean.' . TITLE 'Simple slope of Predictor 1 when the Moderator is high.' . REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA CHANGE /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT Dep /METHOD=ENTER CPR1 CModerator Interaction . COMPUTE CModerator = CModerator + 2* Moderator_sd . EXECUTE . COMPUTE Interaction = CPR1 * CModerator . EXECUTE . VARIABLE LABEL CPR1 'The simple slope of the Predictor when the Moderator is 1 SD below its mean.' . TITLE 'Simple slope of Predictor 1 when the Moderator is low.' . REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA CHANGE /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT Dep /METHOD=ENTER CPR1 CModerator Interaction . DELETE VARIABLES Dep PR1 Moderator UniBreaker Moderator_sd PR1_mean Moderator_mean CPR1 CModerator Interaction . !ENDDEFINE .