Docsity

Plotting a Regression Line using MS Excel 2007: A Step-by-Step Guide - Prof. Jeffrey D. Ma, Lab Reports of Ecology and Environment

Toggle sidebar
bg1
USING MS EXCEL 2007 TO PLOT A REGRESSION
(using data like Problem 4 of the Practice Population Problems handed out in lab)
The following instructions are quite detailed, in order to help those for whom Microsoft Excel is still intimidating. If
you know something of Excel’s capabilities, you may want to just skim through the instructions, stopping only for
procedures you may not be familiar with. Otherwise, try following along step-by-step, performing the same process
in Excel as you read.
1. First, you’ll need to enter the raw data by simply typing the values into the cells of the spreadsheet. In this
case, use the pattern shown in the screen capture below so that when I refer to a specific column or cell in these
instructions, my reference will match your own work.
2. Recheck all of your entries to make sure they’re correct. Next we’ll create a column containing the natural log
of the population, since that is what is asked for in the problem. In cell C1, type a name for the column; I’ve called
it “ln(N)”. Then click on cell C2, and type in only the following “=ln(” (without the quotation marks), as I’ve done
below. Since this is a stock equation in Excel, a small box will pop up showing the pattern for completing the
equation.
Page 1 of 12
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Plotting a Regression Line using MS Excel 2007: A Step-by-Step Guide - Prof. Jeffrey D. Ma and more Lab Reports Ecology and Environment in PDF only on Docsity!

USING MS EXCEL 2007 TO PLOT A REGRESSION

(using data like Problem 4 of the Practice Population Problems handed out in lab) The following instructions are quite detailed, in order to help those for whom Microsoft Excel is still intimidating. If you know something of Excel’s capabilities, you may want to just skim through the instructions, stopping only for procedures you may not be familiar with. Otherwise, try following along step-by-step, performing the same process in Excel as you read.

  1. First, you’ll need to enter the raw data by simply typing the values into the cells of the spreadsheet. In this case, use the pattern shown in the screen capture below so that when I refer to a specific column or cell in these instructions, my reference will match your own work.
  2. Recheck all of your entries to make sure they’re correct. Next we’ll create a column containing the natural log of the population, since that is what is asked for in the problem. In cell C1, type a name for the column; I’ve called it “ln( N )”. Then click on cell C2, and type in only the following “=ln(” (without the quotation marks), as I’ve done below. Since this is a stock equation in Excel, a small box will pop up showing the pattern for completing the equation.
  1. Rather than type in 64 (the first population value for which we want to calculate the natural log), click on the cell that contains the 64—cell B2. Then close the parentheses. It should now look like the following:
  2. Hit Enter, and the value will be entered into the cell, as you see below.
  1. Within the Number page, choose “Number” from the list of categories, and set the “Decimal places” box to 2. Hit OK, and the values in those cells will now be expressed to just two decimal places.
  2. The data are now ready for graphing. Select column A and then, holding down the Control key (“Ctrl” on my keyboard), select column C. (Recall that we are plotting ln( N )—and not N —against time.) Holding the Control key allows you to select two separate columns without automatically selecting the columns in between. From the Insert menu, click on “Scatter” in the series of charts. Among the five formatting options presented, choose the upper left option—the one with no lines connecting the plotted points:
  1. Immediately, a graph appears, pasted in the middle of your data sheet.
  2. I’m not too keen on working with a small graph pasted on my data sheet, preferring to give each graph its own sheet. This gives me a larger format, which is easier to work with, and gets the graph out of the way of the data (not such an important consideration when you have just 4 lines of data as we do here, but helpful for larger data sets). If I point to the graph and right-click, a menu pops up which includes an option to “Move Chart”, which I choose:
  1. We also don’t need the horizontal lines across the graph. Click on one of them to select all of them. You’ll know they are selected by the little blue circles that appear at the end of each line, as you see below. Again, hit your Delete button, and the lines will disappear.
  2. There are a couple of additional changes I often make, both relating to the axes. MS Excel generally assumes you want both axes to begin at zero. In this case, that works out fine for the x -axis, but results in a lot of blank space vertically (i.e., along the y -axis plane). Since our first point is (0, 4.16), starting the y -axis at 0 leaves you with the data points all squished upwards on the graph and a lot of unused space below them, up to the location of the first data value on the y -axis. It’s easy to cure that problem and other axis formatting problems. We’ll do it for the y -axis here, but the solution would be very similar if the problem arose along the x -axis. If it’s not already selected, click on the graph somewhere and you should see the Chart Tools appear at the top of your screen. Click on the “Layout” tab there, and then choose “Axes”. You will be given a choice of “Primary Horizontal Axis” or “Primary Vertical Axis.” Point to the latter and a dropdown menu appears. Click on the option at the very bottom of the list, “More Primary Vertical Axis Options,” as shown here:
  1. You want to change the minimum value for that axis from 0 to 4. Click the “Fixed” option for the minimum, then type “4” into the adjoining box. The values for Maximum, for Major Unit (the units that are labeled with a value along the axis), and Minor Unit are OK. However, I like having the Minor Units indicated by a “tick mark”—a little line along the axis that indicates where those values are, even though they’re not labeled. Minor-tick marks help the reader more readily interpret locations of points located between the labeled Major Unit values. To accomplish this, I have changed the “Minor tick mark type” (in the middle of that window) from “None” to “Outside.” You can see the resulting tick marks in the graph in the background of this picture:
  2. I also feel like the numbers labeling the major tick marks on the y -axis would be better with just a single decimal place, instead of their current 2 decimal places. To make that change, without closing the Format Axis window you’ve been working in, click on the word “Number” in the left-hand column. Change the “Decimal places” value to 1, and Close the window.
  1. The procedure for labeling the y -axis is very similar to that used for the x -axis, except that you choose “Rotated Title” from the submenu for the “Primary Vertical Axis Title” dropdown menu.
  2. The descriptive caption (“Title”) for the graph can be created by replacing the words that are in the box above the graph—where it says “ln(N)” in big bold letters (the “ln( N )” coming from the heading on the y -axis data column back on the data sheet). By long-standing tradition, this caption should appear below the graph. You can do this easily by simply dragging the title box to the bottom of the page, and dragging the graph up above it. After typing in my descriptive title/caption, my version now looks like this:
  1. Now for the regression line. With your cursor, point to any one of the plotted points on the graph. Without even clicking on the point, up pops a little box giving some information about it, as you see here.
  2. Without moving the cursor, right-click on the plotted point. In the pop-up menu (shown below), click on “Add Trendline.”