Size: 2586
Comment:
|
Size: 2710
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 35: | Line 35: |
Suppose you wish to add user defined lines to a plot e.g. to represent the ANCOVA assumption of equal slopes within various groups. You can do this by running the above syntax (at least in version 13 of SPSS) by | Suppose you wish to add user defined lines to a plot e.g. to represent the ANCOVA assumption of equal slopes within various groups. You can do this by running the syntax below which re-expresses the earlier syntax for variables in a different data set. |
Line 43: | Line 43: |
and then using the graph editor by double clicking on the graph then choosing '''options>reference line from equation''' and inserting the equation for the line you wish to add. If you then click on the 'lines' tab you can edit the colour and form of the line. Click '''apply''' and then repeat for any other lines you wish to add which will be appended to the plot. | You can make adjustments using the graph editor (at least in version 13 of SPSS) by double clicking on the graph then choosing '''options>reference line from equation''' and inserting the equation for the line you wish to add. If you then click on the 'lines' tab you can edit the colour and form of the line. Click '''apply''' and then repeat for any other lines you wish to add which will be appended to the plot. |
Line 45: | Line 45: |
You should end up with something like [attachment:ancova.ppt this plot] which added three lines (for each group defined by the GroupH_L factor) to represent the relationship in each group between FAC1_4 and WCSTtotalscore. The equations of the lines are obtained using the regression estimates (also presented in this powerpoint file with the plot) which were produced from running the ANCOVA procedure using the syntax below: | You should end up with something like [attachment:ancova.ppt this plot] which added three lines (one for each group defined by the GroupH_L factor) to represent the relationship in each group between FAC1_4 (the covariate) and WCSTtotalscore (the outcome). The equations of the lines are obtained using the regression estimates (also presented in this powerpoint file with the plot) which were produced from running the ANCOVA procedure using the syntax below: |
Putting a regression line on a scatterplot
Putting a regression line on a scatterplot in SPSS can be done using the interactive graph in SPSS. The syntax below draws a regression line using reading score to predict writing score. Fuller details are given [http://www.ats.ucla.edu/stat/spss/faq/scatter.htm here.]
IGRAPH /X1 = VAR(READ) /Y = VAR(WRITE) /FITLINE METHOD = REGRESSION LINEAR LINE = TOTAL /SCATTER.
Alternatively you can run the following syntax which produces a scatterplot:
GRAPH /SCATTERPLOT(BIVAR)=READ WITH WRITE /MISSING=LISTWISE .
To add the fit line, you need to open the graph editor (by double-clicking on the graph), and then select the Elements pull-down menu at the top, and then select Fit Line at Total.
You just need to change the variable names in the above syntax examples substituting the variable names in your SPSS data for 'read' and 'write'.
If you wish to produce separate regression lines for individual subgroups defined by a factor e.g. group then the above syntax is easily adjusted as the below
GRAPH /SCATTERPLOT(BIVAR)=READ WITH WRITE BY GROUP /MISSING=LISTWISE .
On the Elements pull-down menu (referred to as above) select Fit Line at Subgroups.
Suppose you wish to add user defined lines to a plot e.g. to represent the ANCOVA assumption of equal slopes within various groups. You can do this by running the syntax below which re-expresses the earlier syntax for variables in a different data set.
GRAPH /SCATTERPLOT(BIVAR)=FAC1_4 WITH WCSTtotalscore by GroupH_L /MISSING=LISTWISE .
You can make adjustments using the graph editor (at least in version 13 of SPSS) by double clicking on the graph then choosing options>reference line from equation and inserting the equation for the line you wish to add. If you then click on the 'lines' tab you can edit the colour and form of the line. Click apply and then repeat for any other lines you wish to add which will be appended to the plot.
You should end up with something like [attachment:ancova.ppt this plot] which added three lines (one for each group defined by the GroupH_L factor) to represent the relationship in each group between FAC1_4 (the covariate) and WCSTtotalscore (the outcome). The equations of the lines are obtained using the regression estimates (also presented in this powerpoint file with the plot) which were produced from running the ANCOVA procedure using the syntax below:
UNIANOVA WCSTtotalscore BY GroupH_L WITH FAC1_4 /METHOD = SSTYPE(3) /INTERCEPT = INCLUDE /PRINT = PARAMETER /CRITERIA = ALPHA(.05) /DESIGN = FAC1_4 GroupH_L .