Graphing Regression model with Interaction term

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Graphing Regression model with Interaction term

E. Bernardo
The regression model has an interaction term ( Y=b0 + b1*X + B2*Z + B3*XZ + Error).  How can we draw the graph of this model in SPSS showing the interaction effect?

Thanks
Eins
Reply | Threaded
Open this post in threaded view
|

Re: Graphing Regression model with Interaction term

Marta Garcia-Granero
El 23/01/2012 6:45, Eins Bernardo escribió:
The regression model has an interaction term ( Y=b0 + b1*X + B2*Z + B3*XZ + Error).  How can we draw the graph of this model in SPSS showing the interaction effect?

Thanks
Eins

Hi Eins:

Are X & Z both quantitative predictors? If the answer is yes, then try ITALASSI (Is There A Life After Statsistically Significant Interactions?). It's a free program tht reads SPSS files and graphs the interaction in a nice way. Google for it because I don't have the link here right now. It was rather easy to find it, if I recall correctly.

If one of the predictors is binary, then I can send you some syntax to et a graph with SPSS.

Best regards,
MGG
Reply | Threaded
Open this post in threaded view
|

Re: Graphing Regression model with Interaction term

E. Bernardo
Sorry, I forgot to indicate in my first email that Z is dichotomous.

Thanks.


From: Marta García-Granero <[hidden email]>
To: [hidden email]
Sent: Monday, January 23, 2012 1:19 AM
Subject: Re: Graphing Regression model with Interaction term

El 23/01/2012 6:45, Eins Bernardo escribió:
The regression model has an interaction term ( Y=b0 + b1*X + B2*Z + B3*XZ + Error).  How can we draw the graph of this model in SPSS showing the interaction effect?

Thanks
Eins

Hi Eins:

Are X & Z both quantitative predictors? If the answer is yes, then try ITALASSI (Is There A Life After Statsistically Significant Interactions?). It's a free program tht reads SPSS files and graphs the interaction in a nice way. Google for it because I don't have the link here right now. It was rather easy to find it, if I recall correctly.

If one of the predictors is binary, then I can send you some syntax to et a graph with SPSS.

Best regards,
MGG


Reply | Threaded
Open this post in threaded view
|

Re: Graphing Regression model with Interaction term

Marta Garcia-Granero
El 23/01/2012 12:37, Eins Bernardo escribió:
Sorry, I forgot to indicate in my first email that Z is dichotomous.

Then here's the code (far from perfect, my "kung-fu" is a bit rusty due to our migration to a different statistical package - SPSS Spain disappointed us for the last time):

* Sample dataset from Campbell's "Statistics at Square Two" (ignore age) *.
DATA LIST LIST/deadspace height age asthma (4 F8).
BEGIN DATA
44    110    5    1
31    116    5    0
43    124    6    1
45    129    7    1
56    131    7    1
79    138    6    0
57    142    6    1
56    150    8    1
58    153    8    1
92    155    9    0
78    156    7    0
64    159    8    1
88    164    10    0
112    168    11    0
101    174    14    0
END DATA.
VALUE LABEL asthma 0'No' 1 'Yes'.
VAR LEVEL deadspace TO age(SCALE).
 
COMPUTE HeightAsthma=height*asthma.

* The model *.
REGRESSION
 /STATISTICS COEFF OUTS CI R ANOVA
 /NOORIGIN
 /DEPENDENT deadspace
 /METHOD=ENTER height asthma HeightAsthma  .

* The graph:  I'm sure there is a way to add to the GGRAPH the linear fit by Asthma groups (dunno right now...)*.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=height deadspace asthma
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: height=col(source(s), name("height"))
 DATA: deadspace=col(source(s), name("deadspace"))
 DATA: asthma=col(source(s), name("asthma"), unit.category())
 GUIDE: axis(dim(1), label("height"))
 GUIDE: axis(dim(2), label("deadspace"))
 GUIDE: legend(aesthetic(aesthetic.color.exterior), label("asthma"))
 SCALE: cat(aesthetic(aesthetic.color.exterior), include("0", "1"))
 ELEMENT: point(position(height*deadspace), color.exterior(asthma))
END GPL.

* Edit the graph and add a linear fit by groups *.

HTH,
Marta GG