Using Excel On The Computer To Find The Mean and Standard Deviation and To Do Linear Regression Analysis and Graphing
Using Excel On The Computer To Find The Mean and Standard Deviation and To Do Linear Regression Analysis and Graphing
TABLE OF CONTENTS
2. Opening Excel 2
8. Making a Histogram 22
9. Calculating the Mean 26
11. How to embed an Excel graph and tables into a Word document 26
On Following Directions
From We Took to the Woods by Louise Dickinson Rich
I’m a good knitter, and I’m proud of it. I can make up my own directions, or I can
follow printed directions, which apparently is the harder thing to do, although I don’t see
why it should be.
I think the difficulty with people who can’t follow printed directions for knitting or
anything else is that they try to understand them. They read the whole thing through and
it doesn’t make sense to them, so they start with a defeatist attitude. They try to relate the
first few steps to the whole, and there is no obvious relation, so they get discouraged and
say, “Oh, I can’t learn things out of books….”
You don’t have to understand directions. All you have to do is follow them; and
you can follow them only one step at a time. What you need is not intelligence, but a
blind faith. I never read directions through. I never read beyond the operation I am
engaged in, having a simple trust that the person who wrote them knew what he was
doing. That trust is usually justified. Oh, there’s no trick to following directions, and if I
don’t teach my children one other thing, I’m going to teach them that. I think it’s
important.
Opening Excel
Click on start at the bottom left of the screen.
Click on Programs.
Click on MSOffice.
Decide what data should go on the x axis (the determinate axis) and what data should go
on the y axis (the indeterminate axis). The information you knew before you ran the
experiment goes on the x axis and the information you got by doing the experiment goes
on the y axis. For example if you are measuring the absorbance of a number of dye
concentrations the dye concentrations will be on the x axis since you decided on and
prepared what concentrations you wanted to test. You didn't know what the absorbances
2
would be until you put the various concentrations in the spectrophotometer, so
absorbance would go on the y axis.
Type in the heading for the x axis in the A1 box e.g. concentration (mg/ml).
If the heading is too long to fit in the box, you may increase the column width by placing
the cursor on the line between A and B so you get a double headed arrow and dragging to
the width you want.
To have your data in columns
To have your data in columns, type in the heading for the y axis e.g. absorbance in the B1
box.
Enter the values for x (numbers only, no letters or symbols) in the A column under
your heading if you are doing your data in columns.
Enter values for x in the 1 row following your heading if you are doing your data in rows.
For data in columns, enter values for y (numbers only, no letters or symbols) under the
y axis heading e.g. enter values in B2, B3, etc.
For data in rows, enter values for y in boxes to the right of your y axis heading e.g. B2,
C2, D2, E2, etc.
3
DO NOT enter values for your unknown in the table at this point.
Inserting a ∆ symbol
To insert a ∆ symbol open up a word document. Click on insert on the task bar.
Click on symbol. Find the ∆ symbol on the table and select it. Click on Insert then click
on Close. Now select the ∆ and click on Edit on the task bar. Click on cut or copy.
Open your Excel document and click on Edit and then Paste.
Significant figures
To have all your data values have the same number of spaces to the right of the
decimal point select all the cells containing numbers. Click on Format. Click on Cells.
Click on Number. Click on Number under Category. Decide the number of spaces you
want to the right of the decimal point based on the significant figures you used for your
measurements. Click on OK.
4
Merging Cells
To merge cells select the cells you want to merge and then click on the merge icon on the
toolbar
5
Click on XY (Scatter) line under Chart Type.
Under Chart subtype click on the top chart if it is not already selected.
Click on Next.
If the data in your table is in columns click on columns, if it is in rows click on rows
6
Click on Next.
7
On the Title card enter chart title (e.g. The Effect of Concentration on the Absorbance of
Methylene Blue Dye at a Wavelength of 675nm).
Enter Y axis title e.g. Absorbance (Abs units) of Methylene Blue Dye.
Click on Next.
Chart Wizard Step 4 of 4 - Chart Location will appear.
You must decide if you want your chart as a new sheet or as an object on the sheet with
your table. For Fundamentals of Biology have the table on the same page as the graph
for ease in correcting so click on as an object in the sheet.
Click on Finish.
8
Click on the chart area. Small boxes will appear along the borders. Click on the white
area of the graph so a four-sided arrow appears. Holding down the left mouse button,
drag the chart below your table. Now click on one of the small boxes on the bottom edge
of your graph so a double-sided arrow appears. Drag the bottom of the graph down to
number 48. Click on one of the small boxes on the right side of your graph so a double-
sided arrow appears. Drag the right side of the graph to the letter I in width if you
haven’t increased the size of the cells.
Double click on the plot area. Format Chart Area dialog box will appear. To change the
background color of the plot area click on the box under Area that is the color you want.
I prefer a white background for maximum contrast so click on none. Click on OK.
Click on one of the points on your graph. All the points in the line to which that point
belongs will become larger squares.
9
Click on Chart on the menu bar.
10
Deciding how to set the y intercept
Click on Set Intercept when dealing with linear regression data where y was zero when x
was zero for example in labs using the spectrophotometer to measure absorbance. (The
spectrophotometer is blanked; set to zero absorbance at zero concentration of the
substance whose absorbance is to be measured.). Otherwise don’t click on Set Intercept.
Set Intercept will set the y intercept at zero so when your formula (y = bx + a) comes up
the a value will be zero and not appear.
Click on 'Display equation on chart'. The formula y = bx + a with appropriate values for
b (slope) and a (y intercept) will appear on your graph
11
Click on OK.
To move formulas where they can be more easily seen, click on the formula. A hatched
border will appear around the formula. Click on the border and drag it where you want it.
12
The default point size of the formulas is quite large so to change the point size, click the
down arrow next to the displayed point size in the Formatting toolbar and choose a
smaller point size.
If your graph is on the same sheet as your table, click in any empty cell to the
right of your graph. A heavy border will appear around the cell.
Type in =sqrt(the R2 value from your graph) e.g. if R2 was 0.949 then type
=sqrt(0.949). Hit Enter. The r value will appear in the cell.
Now click on the graph so the hatched border appears around the plot area of the
graph and the word ‘Plot Area’ appears in the Name box.
Click in the formula bar that is to the right of the Name box. Three icons will
appear. Now type in r = whatever you got above e.g. r = 0.974. If your slope
value (b) was positive the r value is positive, if the slope value was negative then
the r value will be negative. So if your slope was negative type a negative sign in
front of your r value.
Click on the green check mark icon. What you typed will appear on your graph
surrounded by a hatched box.
To change the point size of the r value click the down arrow next to the displayed
point size in the formatting toolbar and choose a point size to match your formula
point size.
13
The correlation coefficient indicates how closely the points on your graph fit a straight
line. A value of +1 or -1 indicates a perfect direct or indirect relationship between x and
y. If your correlation coefficient is not close to +1 or -1 your data is not linear (Perhaps it
is logarithmic, exponential or polynomial). If this is the case you wouldn’t use linear
regression for graphing your data. A correlation greater than 0.8 is generally described as
strong, whereas a correlation less than 0.5 is generally described as weak. Note that the
correlation coefficient indicates a relationship between the variables of interest. This
does not necessarily imply that one variable causes the other (for example, higher SAT
scores do not cause higher college grades), but that there is some significant association
between the two variables.
Sometimes as you are working on the following formatting the r = equation will
seem to disappear from your graph. Click on the spot where the equation was and it will
reappear.
To change the graph title, axes labels, legend titles on a multi-line graph etc.
Click twice on the item to be changed. (Note : This is not a double click, but two
separate clicks.) The cursor will appear and you can make your changes.
Alternatively
Click on the item you want to change. A hatched border will appear around it.
14
Put the cursor in the formula bar that is to the right of the Name box. Three icons
will appear. Type in the corrections you want to make.
Double click on the title. A Format Chart Title dialog box will appear.
Alternatively
Click on the title. A hatched border will appear around the title.
Click on Format.
Click on Selected Chart Title.
Click on Font.
Choose font, font style and size you want.
Double click on the axis label. A Format Axis Title dialog box will appear.
Click on Font. Choose the size you want for your axis label.
15
Alternatively
Click on the axis label. A hatched border will appear around the label.
Click on Format.
Click on Selected Axis Title.
Click on Font.
Choose font, font style and size you want.
Put the cursor on the axis whose numbers you wish to format. If the cursor is
correctly positioned over the axis it will read Value (X) axis or Value (Y) axis.
Double click on the axis line. A Format Axis dialog box will appear.
Click on Font. Choose the size you want your axis numbers to be.
Click on Patterns. Choose the weight you want for your axis line.
Alternatively
Place the cursor as above and single click.
Handles will appear on each end of the axis line.
Click on Format.
Click on Selected axis.
Click on Font.
Choose font, font style and size you want.
16
To format the borders
To remove borderlines you don't want e.g. the border around the legend or around
the plot area or around the entire graph.
Double click on the area inside the border. A Format dialog box will appear. On
the Patterns card click on None under Border.
The default line is quite thick so you may want to choose a lighter weight line.
On Patterns click on the down arrow beside Weight and choose the thickness you
want for your line.
Alternatively
Click on the line. Handles will appear on each end.
Click on Format.
Click on Selected Trendline.
Click on Weight and choose the line you want.
17
ATTENTION: Click outside graph and scroll back to your table.
Type in the word ‘unknown’ in the empty space at the end of the y column.
If your data is in columns enter the y value you got for the unknown in the box
below the one where you typed ‘unknown’. This is so the instructor knows this is
where you calculated your unknown.
Move pointer to the empty space at the end of the x column. Type in the word
'unknown'. Now move pointer to the box below the one where you just typed
‘unknown’.
Type = then a parenthesis then the y value you just entered. (If the number is very
long you can just type the letter and number of the cell e.g. D11 to save time.)
Now type - then the a value (y intercept) from the formula on your graph and a
closing parenthesis. If your y intercept was zero you only need to type the y value
without parentheses. Now type in / and the b value (slope) from the equation on
your graph. Suppose the equation on your graph is y = 29.514x. This would mean
a (the y intercept) is zero since it doesn’t appear and b is 29.514. You would type
in =D11 or the number in the D11 cell/29.514.
Then hit Enter and that will give you the x value at that y.
Type in the word 'unknown' in the empty space at the end of the x column.
18
Now enter the x value for the unknown in the cell below the one where you typed
‘unknown’
Move pointer to the empty space at the end of the y column. Type in the word
'unknown'. Now move the pointer to the box below the one where you just typed
‘unknown’ in the y column.
Type = then type a parenthesis then the b value (slope) from the equation on your
graph, then * and the x value you just typed under 'unknown' in the x column. (If
the x value is very long you may type the letter and number of the cell containing
the x value you just entered e.g. A12) Now type the closing parenthesis then +
then the a value (y intercept) from your graph.
Hit Enter and that will give you your y value for that x.
If you set the y intercept to zero you only need to type = followed by the b value
then * and the x value and hit enter.
Suppose the equation on your graph was y = - 0.421x + 27.98. You would type
=(-0.421*A12)+27.98
19
Centering Data
Click on Cells
Click OK.
Click on the B (bold) icon if you want the table headings bold.
Click on Cells.
Click on OK.
Click on Cells.
20
Click on Outline and Inside boxes.
BEFORE PRINTING YOUR GRAPH be sure to click outside the graph area itself.
Otherwise only the graph and not the accompanying table will be printed. To see
what your graph will look like prior to printing, click on File and click on Print Preview.
Say you want to chart several lines on the same graph - for example the effect of
temperature on the calories of energy consumed by several bird species say the English
sparrow, the purple finch and the pine siskin.
Say you wanted your data in rows. In the A2 cell type in Calories English sparrow, in the
A3 box type in Calories purple finch and in the A4 cell type in Calories pine siskin.
Your temperature values will be typed in the 1 row e.g. B1, C1, D1, etc.
The calories for the English sparrow will be typed in the 2 row e.g. B2, C2, D2, etc.
The calories for the purple finch will be typed in the 3 row e.g. B3, C3, D3, etc.
The calories for the pine siskin will be typed in the 4 row e.g. B4, C4, D4, etc.
Follow directions using Chart Wizard as previously explained. The only difference is
that you must repeat the "Click on one of the points on your graph" sequence for each
line.
When one has several lines the formulas may be crowded and it may be difficult to see
which formula goes with which line so click on the formulas one at a time and drag them
away from the lines.
Make titles for each formula by clicking on the graph so a hatched border appears around
the plot area of the graph and the word 'plot area' appears in the Name box.
Put your cursor in the formula bar to the right of the Name box. Three icons will appear.
Now type in the legend title for that line e.g. English sparrow.
21
Click on the check mark icon. What you typed will appear on your graph surrounded by
a hatched box. Drag the box so it is above the formulas for that line.
To put the symbol used for each line next to the title above each formula you will have to
draw it in by hand after you print the graph.
The computer will choose different colors for the points of each line. If you are not using
a color printer the light colors will show up poorly when printed by a black and white
printer. Double click on one of the points of the trendline whose marker color you want
to change. A Format Data Series dialog box will appear. Click on Patterns. Under
Marker click the down arrow next to Foreground. Click on black on the pop-up palette.
Now click on the down arrow next to Background. Click on black on the pop-up palette.
Click on OK.
To get five bars (or any other number you want) on your histogram:
Subtract lowest value from highest. For the numbers above that would be 40.60 –
35.80 = 4.80.
Now divide your answer by number of bars you want. If you want three bars
divide by 3. Since we want five bars for the example divide as follows: 4.89/5 =
0.96.
Add this number to your lowest value to get your first range. So 35.80 + 0.96 =
36.76. The first range is thus 35.80-36.76.
22
For the second range begin with 36.77, because if you use 36.75 and one of the
measurements happens to be exactly that you won’t know whether to count it in
the first range or the second range when you determine the frequencies. Now add
0.96 to the end of the first range value (36.76) to get the upper value of the second
range. Second range is thus 36.77-37.72. Third range is 37.73-38.68 and so on.
Follow previous directions for making a table. Put range values (or individual numbers
depending on the type of histogram) in first column and frequencies in second column.
If your x values are not ranges but single numbers, select only the y column of the
table.
Click on Chart Wizard.
23
Click on upper left chart under subtype if it is not highlighted already.
Click on Next.
Click on columns if your data is in columns, click on rows if your data is in rows.
Click on Next.
Click on Legend if you want the legend somewhere other than to the right.
Click on Next.
Click on finish.
24
How to format your histogram.
Double click on the plot area of your graph. Format Plot Area will appear. Click on
'none' under Area so background will be white.
Click on one of the bars of the graph. Handles will appear on all the bars.
Click on Format. Click on Selected Data Series. Choose a color for the area inside the
bars. Don't click on OK yet. Click on Options. Set overlap at zero and gap width at 10.
Click OK.
To format the title, legend, axes and the table, see the directions for a single line graph.
To add the mean and standard deviation values above the line click on the graph so the
hatched border appears around the plot area of the graph and the word ‘Plot Area’
appears in the Name box.
Click in the formula bar that is to the right of the Name box. Three icons will appear.
Type in your mean ± standard deviation as calculated using directions below. Click on
the green checkmark and then drag your value over the line you made.
25
HOW TO CALCULATE THE MEAN (AVERAGE) USING EXCEL
Go down to next row and type in =average(range of boxes containing your data) and hit
Enter key e.g. if you entered data in box A2, A3, A4, A5, A6 you would type in
=average(a2:a6) OR after the first parenthesis simply highlight all the boxes containing
the data and the range will appear automatically. Add the closing parenthesis and hit
Enter.
The standard deviation is a measure of the variability of your data. It describes a range
within which 68% of your values lie. For example if you were weighing tomatoes and
got an average tomato weight of 100grams with a standard deviation of ± 5grams, it
would mean that 68% of the tomatoes you weighed were between 95 and 105 grams.
Now skip down a couple rows in column A and type in Standard Deviation.
Go down to the next row and type in =stdev(range of boxes containing your data) and hit
Enter. E.g. if you entered data in boxes A2, A3, A4, A5, A6 you would type in
=stdev(a2:a6) and hit the Enter key OR after the first parenthesis simply select all the
boxes containing the data and the range will appear automatically. Add the closing
parenthesis and hit Enter.
To insert a ± sign in front of your standard deviations move the cursor down one cell,
hold down the Alt key and type 241 on your number pad. If you are using a Macintosh
computer hold down the Alt key, the shift key and hit the + key. Now type in the
standard deviation value you obtained.
26
Click on Programs
Click on Accessories
Click on Paint
To open you Excel document in Paint
Control V or Edit/Paste
Now Control C or Edit/Copy
Now open your Word document and when you come to the space where you want to add
your Excel document
Control V or Edit/Paste
To save
Click on File
Click on Save
27
Table 1
Concentration (mg/ml) Absorbance (Abs units)
0.00000 0.000
0.00125 0.060
0.00250 0.099
0.00375 0.121
0.00500 0.156
0.00625 0.200
0.00750 0.184
0.00875 0.239
0.01000 0.313
unknown unknown
0.00339 0.100
Figure 1
0.350
0.300
Absorbance (Absorbance units)
0.250
0.200
Absorbance (Abs units)
0.150
y = 29.514x
2
R = 0.9491
r = 0.974
0.100
0.050
0.000
0.00000 0.00500 0.01000 0.01500
Concentration of New Methylene Blue Dye (mg/ml)
28
Table 2
Temperature (°C) 0 10 18 26 34 36
Calories English sparrow 26.3 25.1 22.2 16.4 13.8 11.9
Calories purple finch 29.1 27.2 25.4 20.3 15.9 13.1
Calories pine siskin 33 30.8 27.2 22.6 19.1 14.8
Figure 2
40
35
Calories English sparrow
Calories purple finch
30 Calories pine siskin
25
Calories
20 English sparrow
y = -0.421x + 27.985
2
R = 0.9507
r = -0.975
15
Purple Finch
y = -0.4429x + 30.986
2
R = 0.9322
10
r = -0.966
Pine siskin
y = -0.4861x + 34.63
5 2
R = 0.9502
r = -0.975
0
0 10 20 30 40
Temperature (°C)
29
Table 3
Water volume (ml) Frequency
35.80-36.76 1
36.77-37.72 0
37.73-38.68 5
38.69-39.64 3
39.65-40.60 1
Figure 3
6
38.47±1.25
4
Frequency
3 Frequency
0
35.80- 36.77- 37.73- 38.69- 39.65-
36.76 37.72 38.68 39.64 40.60
Water Volumes (ml)
30
31