# Scatterplots with Regression Syntax

3 messages
Open this post in threaded view
|

## Scatterplots with Regression Syntax

 I’m trying to teach students about regression by having them produce some scatterplots at the same time they run a series of linear regressions. I’m trying to keep the syntax as simple as possible, and also trying to show them how to start in the menu and then create syntax using the paste function. Selecting Analyze>Regression>Linear>Plot permits one to plot Y against X, but permits only a narrow selection of variables that can be included in the scatterplot from the Plots window. These are the Dependent Variable and different types of predicted values and residuals. …but the original IV/X variable isn’t there on the list in the Plots window.   If I select an arbitrary variable for X within the plot window (e.g., * DRESID) and I paste that syntax I get something like this (simplified):  Regression  /Dependent Y  /Method=Enter X  /Scatterplot = (Y, *DRESID)  . If I alter the Scatterplot option to have the original X variable plotted against Y like the code below, all works fine and the students can see the scatterplot of X/Y along with all standard regression output.: Regression  /Dependent Y  /Method=Enter X  /Scatterplot = (Y, X)  . …but If I try to replace X with any other variable in the dataset for illustration purposes (e.g., manually calculated predicted values), I get an error message.  I realize that I can get a scatterplot of any two variables by using Graphs>Legacy Dialogs>Scatter/Dot, but this just adds more to what the students need to learn and doesn’t provide all regression output.  Question – is there anyway to run a scatterplot of Y with some other variable in the dataset (like manually-calculated predicted values or previously saved predicted values) with a regression command option or do I need to do this with a second set of commands?  Remember, I’m trying to keep this as simple as possible for consumption by students who are a bit math phobic.   Thanks in advance, Jeff     ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD