Here we set up two extra columns of data to produce straight lines that pass through the original data. One line is the SD-line and the other is the regression line. So, we will set up columns of data with x-values next to y-values. I suggest leaving some room at the top of the spreadsheet to put comments, calculated values like the average, and titles. The bottom is OK too, but harder for others to find if they borrow your spreadsheet.

- Copy the data into the worksheet and move the columns (cut and paste) so that the variables are lined up next to each other.
- Find the averages and standard deviations for each column and the correlation coefficient; place them in cells adjacent to labels so that you (and others) know what they are.
- We now have all the information needed to create the SD-line.
put an appropriate label at the top of a new column and enter a
formula in the first row of data which uses the
SD-line formula to calculate the correct Y value for the X value
of that row.
**(The equation for the SD-line is in your book and notes.)**Each row corresponds to an X value and its related Y values. Remember to use dollar signs before the letter and number of any cells that shouldn't change when you copy from one row to the next. For example, the average and SDs are the same for each row. If they appear in cell D4, then use $D$4 in place of D4.The SD-line of interest will be downward sloping if the correlation coefficient is negative. We used a plus/minus sign in class to represent this. Use the function SIGN($F$6) to get a plus or minus one depending on the sign of the cell F6.

- Check that your formula gives the correct answer. Then copy the formula down the column to the other rows. Check to make sure that the correct cell names (like A10) are getting incremented while the ones for the average, SD, etc are not. Add more dollar signs if needed and copy again.

There are three ways to get the regression line.

- You can enter the formula for the regression line just like you did for the SD-line. You have all the needed averages and SDs.
- You can have Excel calculate the slope and intercept for you, putting them into special cells (don't forget to label them). Then use the formula for a line in each row of the column. The functions SLOPE and INTERCEPT give you the values you need. They each require two data ranges as inputs. One for the X values and one for the Y values.
- You can use the FORECAST function. This function requires three inputs: the particular X value for which you want a regression result, all the Y values, and all the X values. Remember to put dollar signs in the data ranges that you don't want to change when you copy.

- Highlight the four data columns (with their labels at the top) and choose the "chart wizard" (a button at the top with a bar chart). Choose the scatter plot format without lines connecting the points.
- The next screen asks you to verify that the four columns that
Excel thinks you want are really the ones you want. Select the
**Series**tab at the top and verify that the X and Y ranges are correct for each of the three data series (data series seems to mean: Y values) All OK? move to Next screen. - Put titles as you wish and/or remove the legend. There will be three sets of data points. Click FINISH to put the chart into your worksheet.
- By clicking on the emphasized points on the rim of the chart and moving the mouse, you can change the size or position of the chart.
- Initially, the axes will cross at (0,0), while all the data points appear well above and to the right. To make the graph focus on the data points, change the scale of your plot by double-clicking on the x (or y) axis and then choosing the "Scale" Tab in the window that appears. Choose appropriate values for the minimum and maximum values of the x and y variables, near the minima and maxima for the data points. You may also want to change the major units to some smaller value, to add more grid lines to the graph.
- Make the second (SD line) points and third (predicted) data points appear as lines: Double-click on one of the SD-line points (respectively, "predicted" data points). Then, under the "Pattern" Tab, set the line style to "automatic" and the marker style to "none". Click OK, then click somewhere off the chart (to unselect the data) and look at your chart.

Copyright 1999 © Colgate University. All rights reserved.