TA2-1
Scatter Plots
To create a scatterplot in Excel, the data for the two variables should be placed in two adjacent columns, with the column associated with the Y variable to the right of the column associated with the X variable. If the data file does not have the X variable first, copy and paste the data column(s) into another area of the spreadsheet. Click and drag the mouse to highlight the cells of the two columns of data.
Note: The layout of the scatterplot can also be manipulated by choosing among a variety of options offered within the Charts Layouts group found under the Design tab. To add the regression line, click “Add Chart Element,” “Trend line,” “Linear.”
For videos to help with these topics, see the Excel Video Technology Manuals on Scatterplots and Scatterplot by Groups.
To add groups, use the Graph ➔ Graph Builder option. Click and drag the two variables to the X and Y axes; drag the grouping variable to the “Color” box.
For videos to help with these topics, see the JMP Video Technology Manuals on Scatterplots and Scatterplot by Groups.
To add groups, select the “With Groups” option instead of “Simple.” Click and highlight the Y and X variables, then add the categorical grouping variable in the box below.
For videos to help with these topics, see the Minitab Video Technology Manuals on Scatterplots and Scatterplot by Groups.
TA2-2
To add a categorical grouping variable, select that variable and click to enter it into the box labeled “Set markers by.”
For videos to help with these topics, see the SPSS Video Technology Manuals on Scatterplots and Scatterplot by Groups.
To add a categorical grouping variable, enter it in the box labeled “Group by.”
For videos to help with these topics, see the Crunchit! Help Video on Scatterplots.
To add a categorical grouping variable, you will need to have lists for each group. Define up to three scatterplots using different graphing symbols.
For videos to help with these topics, see the TI-83/-84 Video Technology Manuals on Scatterplots and Scatterplot by Groups.
The simplest command is
plot(x,y)
Add labels and titles and specify a data set by adding other parameters:
plot (x,y,main=“title”,xlab=“X label”,ylab=“Y label”, data=dataset)
To add a grouping variable, modify the command to something like
plot (x,y,main=“title”,xlab=“X label”,ylab=“Ylabel”, data=dataset,
bg=c(“red”,“green”,“blue”)[unclass(gpvar)])
For videos to help with these topics, see the R Video Technology Manuals on Scatter-plots and Scatterplot by Groups.
TA2-3
Correlation
The Excel Video Technology Manual on Correlation offers more help and an example.
Alternatively:
The JMP Technology Video Manuals on Correlation offers more help and an example.
The Minitab Video Technology Manual on Correlation offers more help and an example.
The SPSS Technology Video Manual on Correlation offers more help and an example.
The Crunchit! Help Video on Correlation offers more help and an example.
TA2-4
Note: You must first “turn on” the display of and . Do this by pressing (Catalog), (C in alpha mode), then arrow down to DiagnosticOn. Press twice.
The TI-83/-84 Technology Video Manual on Correlation offers more help and an example.
The correlation command is
cor (x,y)
You can specify the data set name with an optional “data=dataset” parameter.
The R Technology Video Manuals on Correlation offers more help and an example.
Least-Squares Regression
The Excel Technology Video Manuals on Correlation, Fitted Line Plot, Linear Regression, and Residual Plots offer more help and examples.
Note: To show diagnostic plots, click the red triangle next to “Linear Fit” and select “Plot Residuals.” You can save residuals and predicted values from this menu.
The JMP Technology Video Manual on Linear Regression offers more help and examples.
TA2-5
If you wish to produce a scatterplot superimposed with the least-squares regression line, do the following pull-down sequence:
The Minitab Technology Video Manuals: Correlation, Fitted Line Plot, Linear Regression, and Residual Plots offer more help and examples.
The SPSS Technology Video Manuals on Correlation, Fitted Line Plot, Linear Regression, Prediction, and Residual Plots offer more help and examples.
For residual plots or a fitted line plot, change the option in the “Display” drop-down.
The Crunchit! Help Video on Simple Linear Regression offers more help and examples.
TA2-6
For a fitted line plot, save the regression equation into the Y1 variable by modifying the command by following adding the following keystrokes: , (to Y-Vars), (for Function) and (for Y1). The command should look like
LinReg(a+bx) L1,L2,Y1
Press to display the scatterplot again.
For residuals plots, find the list of residuals (RESID) in the menu.
The TI-83/-84 Technology Video Manuals on Correlation, Fitted Line Plot, Linear Regression, Prediction, and Residual Plots offer more help and examples.
The simplest regression command is
> lm(y~x)
To replicate output and get a complete table of results, use a command like
> model<-lm(y~x)
> summary(model)
To create diagnostic (residuals) plots, access them as resid(model) as in
> hist(resid(model))
The R Technology Video Manuals on Correlation, Fitted Line Plot, Linear Regression, Prediction, and Residual Plots offer more help and examples.