|
BIO 412 Principles of Ecology Phil Ganter 320 Harned Hall 963-5782 Florida Scrub Pine Ecosystem |
Using Spreadsheets
Back to:
Course Page |
Tennessee State Home page |
Bio 412 Page |
Ganter home page |
Introduction:
Note: If you are browsing this on a Windows machine and have a 15 inch monitor or larger, it may be easier to do this lab if you reset your monitor at a higher resolution (1024x768 is recommended). This will make the text smaller and more of the document (your spreadsheet) will fit onto the screen at one time. To do this, go to control panels, choose display, choose settings, and change the resolution of the display (both sliders) from the standard 800x600 to 1024x768. Click OK. Be sure to click OK again after the change has taken place so that the computer won't automatically revert to the previous resolution after 15 seconds.
This lab is a brief introduction to the use of computer spreadsheets. We will use the spreadsheet program available in the biology computer lab, MS Excel. However, there are more similarities among spreadsheet programs than differences, so, once you learn to use this one, you should be able to figure out how to use other programs. Just keep in mind that there is a way to do what you want to do and don't give up until you find it. This assumption has served your instructor well. If you use another spreadsheet system, you must save your spreadsheets twice. However, a problem may arise when you send the file to me. If my program can not open your document, we will have to work on a solution (usually a fix can be found).
This lab should be read when you are sitting in front of a computer with a spreadsheet program running. It was originally written for the MS Excel program, version 98, and was written on a Macintosh computer. However, most of it will apply to other versions of the Excel program and to MS Excel running within a Windows operating system. I have attempted to note where the Windows program differs from the Macintosh. If you discover more differences, please email me when you do and I can alter this lab.
Spreadsheets are useful to biologists for myriad reasons. They can reduce the time it takes to do numerous, repetitive calculations. If an error is made in data entry and it is not corrected until after the formulas are entered and the calculations done, the spreadsheet will automatically update all of the cells whose values depend on the corrected data. In addition, once a set of results are calculated, they can be printed as a table or as a graph (the graphic capabilities of the program are the subject of another lab). The tables and graphics can also be incorporated into other documents generated by other programs, such as text documents produced by word processing programs. If you become a sophisticated spreadsheet user, you can use it to write programs to do complicated calculations (including statistical analyses) and report those calculations as charts and graphs. A good spreadsheet program is a very powerful tool for solving complex problems.
Usually, one adds the results of a spreadsheet to a word processor document (often as a table or a chart). This looks neater and offers other, more substantial, benefits. However, for the purposes of this class, you can include the answers to questions, conclusions, and other text into the spreadsheet file and submit your lab over the internet by sending me an email with the Excel file attached. Instructions on how to do this are given below. This is the easiest way to submit and get the corrected material and no paper is wasted. You will always have a copy of the file, in case it is lost (human error transcends all technology). One word of caution. If I can't find the answers, I can't give you the deserved credit. Organize the spreadsheet so that it is easy to read. This means that you should format before sending to me. Look at the overall organization? Are all of the answers in the same order as the questions in the lab? Is all of one answer in one place (or is there an instruction about where to go)? Have you changed the number of decimal places to make the spreadsheet more readable? If I find that you are not taking care, I will reduce your score, as it costs time to search through a sloppy lab for the needed answers. If you have questions about how to do this, come by my office and we will look at your file. Any skills you develop here will serve you well in many endeavors beyond TSU..
There are some other things that are necessities, though. The data must be entered and must be checked. You should calculate at least one value (two or more are better) by hand to check that the formulas you have entered are correct and you are getting the correct answers. In addition, logical checks should be done for the overall results. A good example of this not being done was produced in an earlier class by submission of a survivorship curve that went up over time. Survivorship curves start at 100% and can only stay the same or go down over time (think about it!). A logical check of the outcome would have caught this mistake. Look to see that things (like proportions) that should add up to 1 do, in fact, sum to 1.
A final word of introduction. This lab is meant to be a tool for learning. To make use of it, some exercises have been added to the text for the more complicated tasks so that you actually perform task. However, you should try the simpler tasks out in the spreadsheet as you read each section. Don't just read through a section, do a section. Make you own examples where there are none in the text. You must participate to learn.
Some Useful Terms:
What is in a cell:
The cells in a spreadsheet have one of six things in them -
All cells have a value (even text). The value might be numerical or logical. The value of a cell can be directly entered, or can be the result of a formula (and the value calculated from the formula can depend on the value of other cells) How a numerical value is displayed is called the format. For example, 16.25 can be 16.25, $16.25, 1625%. or 1.625E1 depending on which format style (general, currency, percentage, scientific notation) you choose for that cell. In addition, there are special numerical formats (text, time, date, logical) that have different properties than numbers. For example, logical values are all 0 or 1. Dates come in day-month-year format. What you can do with a cell depends on what is in that cell. If you multiply a number times a date, the result may not be what you expect. There is usually no problem if you are calculating with cells in any of the numerical formats, but mixing formats can produce error messages or unexpected results.
There are also general formatting options that apply to all types of values (including text). You can choose the font, size, justification, character color, cell color, etc. of the what is displayed in the cell. Remember that text will be printed over adjoining cells as long as there is nothing (as defined above) in that cell, but as soon as something is entered in the overwritten cell, then the text is truncated at the edge of that cell. So, when writing an answer a question, you will see the entire sentence or sentences in the spreadsheet as long as you are overwriting cells with nothing in them.
The Importance of UNDO:
Pull down the EDIT menu on the Menubar. and look at the top choice (which will probably be disabled, since you have not yet done anything). It is the undo option. VERY VALUABLE. It will undo you last action. Use it. In the more recent versions of EXCEL, it will undo multiple actions, one at a time in reverse order - Try it! It has saved the author of this lab on more occasions than he can comfortably admit to.
Controlling the Display - Re-sizing columns and rows, controlling decimals, and splitting screens:
The following topics deal with how to manipulate a spreadsheet. You may want to change one or more cells. You may want to change a row or columns size. Finally, you might want to see the edges of an area too big to fit onto your computer screen. Here is a description of how to do those things. To select a cell, click on it. To select a few cells, select one on a corner of the area you want and drag the cursor to the opposite corner before releasing the mouse button. To select a row or column, move the cursor to the left side or top of the worksheet and click on the cell with the row number or column letter in it. To select all of the cells, click in the blank space at the upper left of the worksheet (where the row and column labels intersect).
Cells can be resized simply by selecting the columns or rows in which the cells lie. Once you have selected the columns or rows you want to resize (this works for entire rows or columns only) and moving the cursor over the row number (left edge of the spreadsheet) or the column letter (top of spreadsheet). The cursor will change from an arrow to a line with double arrows. With the cursor showing this display, simply click and drag to change the size of the selected columns or rows.
Often, assignments are turned in with the results displayed as numbers with up to 10 places in the decimal. This is a precision that is not needed and makes the results difficult to read. You can control the number of decimals displayed and printed by changing the format of the cells. Look at the toolbars. If there is are a pair of icons there that have two rows of zeros, these icons will change the decimal places of selected cells when you click on the icon. If there are no icons, pull down the format option on the menu bar and choose numerical format. A dialog box will open and you can set the number of decimal places displayed here. Notice that this does not affect the actual value of the cell, only what is displayed. Change it to 0, 1 or 2 as greater precision is rarely needed. A second way to do this may be found in a toolbar at the top of the document. If one of the tool icons is a dot with two zeros over a dot with one zero and an arrow, this can be used to reduce the number of decimal places displayed by selecting the entire range of cells to be changed (the upper left most cell must have a decimal value in it) and click on the tool icon until the desired number of decimal places is displayed. The adjacent tool will increase the number of decimal places. PLEASE HAND IN ASSIGNMENTS WITH THE APPROPRIATE NUMBER OF DECIMAL PLACES PRESENTED. IT IS MUCH EASIER TO READ.
Tables often get to be too large to fit onto the screen. However, it is possible to get the edges of a large table on the screen at the same time. This is useful if you want to change an entire row or column at the same time. You do this by splitting the screen. Look at the slide bars on the right and bottom sides of the window. There is a black region at the end of the bar. Move the cursor over it and the cursor changes to a pair of parallel lines with double arrows. Click when the cursor has changed and drag and you will split the screen either horizontally or vertically. Notice that the slide bar is also split. You can move the split screens independently, so you can have the top left corner of a spreadsheet in the upper left area and the bottom right corner in the lower right area. You should try splitting the screen now, even though you have not entered anything yet. You can get rid of a split by clicking down on the black region, moving it to the edge of the document while holding the mouse button down, and releasing the button once the black bar has reached the document's edge.
Relative versus absolute references:
There are two ways to enter a cell's value into a formula in another cell. We will do this soon, but first we must introduce the distinction between the two kinds of cell references (a cell reference is the form in which a cell appears in a formula). Which type of reference you choose depends on which one you need. A cell is identified by its reference:
Relative references change in a predictable fashion as you move from one cell to another. The dollar sign denotes that the reference is absolute and does not change. You can change the type of reference simply by clicking on a cell, moving the cursor to the command line and clicking it into the formula at the point you wish to change. Then simply add or delete the $. You will see below, that, when copying a formula into a different cell, you have to keep track of the difference.
Entering a Formula:
One of the things you can do is to calculate a result from the values in one or more cells according to a formula. Remember that the standard symbols for spreadsheets are thus: - is the hyphen and is used for entering negative values and for subtraction, * is multiplication, / is division (or multiplying the value to the -1 power), ^ is for exponentiation (=25^0.5 in the command line returns the value 5 in the spreadsheet, the square root of 25). Try entering a formula in a spreadsheet. To do this, you will have to keep in mind the difference between the cell's value and what is entered on the command line. If you select a cell whose value is calculated from a formula, you will see the value in the cell but the formula on the command line.
We will use an equation for a line, y = mx + b, this will calculate a y for any given x, as long as you know the slope (m) and the intercept (b)
If you make a mistake in entering a formula, you get one of the following error messages
Copying formulas:
One of the most useful capabilities of a spreadsheet is its ability to do repetitive tasks, such as performing the same calculations on an array of data entries. This can save massive amounts of time. However, you must apply what you have read above (especially how to enter a formula and keeping track of absolute and relative cell references) in order to get the correct results. Let's use the data entries from above and the formula you calculated before to illustrate copying formulas.
Oops - you got the wrong answer. Go ahead and check. Now click on the cell with the formula for y (the first cell under the cell with Y =) again. Look at the formula. Both of the constants (the slope and the intercept) are wrong, but the X value is correct. Both the correct and incorrect parts are due to relative references. You changed the row reference when you copied the formula into the same column but one row down. All of the cell references are one row down. OK for the X value, as you wanted the next one down, but you wanted the same cell references for both the slope and intercept. We need to correct this with some absolute references.
Check that the formula is correct. Once you verify that it is, you can copy the formula into the remaining cells by repeating steps 1 to 3 but, instead of selecting a single cell to copy the formula into, select multiple cells. Then paste as directed before. A second way to copy a cells contents into adjoining cells (in a row or column) is to:
The second method is useful when you have all of the cells on a single monitor screen. The first is useful if you have split a screen and the copy-from cell on one split and the last copy-to cell in the other split.
Using Functions:
some complicated formulas that everyone uses are included as standard functions.
A formula can have a reference in the formula to a function or another cell in the spreadsheet (even if on another worksheet in the same document, which Excel refers to as a workbook).
Entering a series:
It is often necessary to enter a series of numbers in a row or column. Usually the numbers go up by 1 each time, but that isn't the only possibility. This is an easy two-step operation.
Sorting rows and columns:
Another valuable time-saver is the ability to sort multiple rows and columns by text or numerical order.
Ralph | 25 | M |
Tony | 44 | F |
Leslie | 31 | M |
Kate | 19 | F |
Kate | 19 | F |
Ralph | 25 | M |
Leslie | 31 | M |
Tony | 44 | F |
The sort function will sort the rows or columns you selected according to the key rows or columns. The rest of the selected row or columns will "tag along", so that adjacent cells are still adjacent after the sort. This can save a lot of time when doing something in which you have to know the median value (the midpoint).
Problems:
How to lose points when doing problems: Fail to label you results! It is not really fair to make the grader search for your results. So, it is you responsibility to clearly label results and present them in an orderly manner. If you calculate a sum in a cell, then label an adjoining cell with the fact that the sum is there. Do this for all of your results. THE PURPOSE HERE IS TO LEARN HOW TO USE THE PROGRAM TO SPEED WORK. THIS IS DONE THROUGH FUNCTIONS, CELL REFERENCES, ETC. THE PURPOSE IS NOT JUST TO GET THE RIGHT ANSWER BUT ALSO TO GET IT IN THE RIGHT WAY. USE FUNCTIONS WHERE POSSIBLE, NOT HAND CALCULATIONS, ETC. FOR INSTANCE, IF AN AVERAGE IS REQUIRED, I WILL CHECK TO SEE THAT THE AVERAGE HAS BEEN DONE THROUGH THE USE OF THE AVERAGE FUNCTION. IF YOU ADD THE VALUES UP AND DIVIDE BY N YOURSELF, YOU HAVE AN INCORRECT ANSWER BECAUSE YOU DID IT THE WRONG WAY.
ALL DECIMALS SHOULD BE TWO PLACE DECIMALS. ADJUST THE FORMAT ACCORDINGLY
1. Copy down one extra cell in the exercise on entering a formula in the lab above (copy one cell past the 22). You get an answer of 3.44. Why is this so? Explain why this cell has the value of 3.44.
2. Enter a matrix of the following values and calculate columns with the following formulae in them (This will involve the use of parentheses in your formula. Remember, operations inside parentheses are done first):
Species | x | y | z |
---|---|---|---|
A |
11.2 | 73 | 9 |
B |
54.09 | 7.7 | 12 |
C |
13.6 | 87 | 67 |
D |
76 | 2.56 | 53 |
E |
0.096 | 25.9 | 73 |
3. Using the matrix you entered in Question 2, make new columns and rows (as appropriate) with the following values in them
4. Enter the matrix below. Leave at least one column blank on the left hand side.
A | B | C |
Forest | 4 | Fire Plot |
Forest | 7 | Control |
Chaparral | 6 | Fire Plot |
Desert | 29 | Fire Plot |
Forest | 5 | Control |
Chaparral | 10 | Fire Plot |
Chaparral | 9 | Control |
Desert | 45 | Fire Plot |
Forest | 4 | Fire Plot |
Chaparral | 5 | Fire Plot |
Desert | 83 | Control |
Copy the entire matrix and paste it adjacent to the original but to the right. Notice that columns A and C have repeating values but they are scattered. You can sort them and get all grass, then all shrub and then all tree. However, the trick is to do the sorting without losing the relationship among the columns, so that the first "Desert" has a column B value of 29 and a column C value of "fire plot" after the sort as well as before it. Notice again that within each of the column A categories, column C can have repeat values (the four tree entries have two fire plot values and two control values). Your job is to sort the copy of the matrix by column A as the first sort and and by column C within column A as the second sort.
Secondly, we can sort for purposes other than easy viewing. The median value is the value in the middle of a series of numbers, when the numbers are sorted from smallest to largest. You can find the median easily with the sort and series functions. First you will find the number of rows and the middle row with the series function and then sort column B so that the middle value in the column can be identified (this is the median)
Medians are known in statistical jargon as "measures of central tendency in a set of values." There are other measures of central tendency (many more), but the mean is the most commonly used other "measure of central tendency." Each measure has its own properties and may be very different from other measures. We can illustrate this point by:
5. X is a variable that can have the values 13, 27, 122, 35, 33, 84, 105, and 52.
Define what i and n mean in the summation formula below and give their values for this exercise (x is the variable defined above).
Show me, through the use of a spread sheet, that the inequality below is true when x takes the values given in the first line of this problem. To restate this, I want you to demonstrate that the sum of a series of numbers squared is less than the square of a sum of numbers (these expressions occur often throughout statistics and biology) for the values of x given above. Once again, the xi refers to the variable values defined above in the first line of this exercise.
6. Fill in the chart.
X | Y | X*Y
|
Ln(Y)
|
X!
|
(Y2)/p
|
Sq Root X | |
9 | 21.2 | ||||||
14 | 49.3 | ||||||
55 | 201.3 | ||||||
32 | 9.5 | ||||||
6 | 42 | ||||||
12 | 75.1 | ||||||
18 | 812.1 | ||||||
24 | 147.5 | ||||||
30 | 33.33 | ||||||
3 | 73.2 | ||||||
Column totals = |
|||||||
Column means = |
NOW, LOOK AT THE BEGINNING OF THE PROBLEMS AND READ WHAT IS THERE. CHECK TO SEE THAT YOU HAVE DONE WHAT IS REQUESTED THERE (FUNCTIONS? FORMAT?).
How to submit this assignment:
The assignment will be submitted through the internet. It will not be accepted in any other format as there is no way to check formulas unless I have the file on my computer. A printout of this file will only give me the values that result from the formulas, and I want to see the formulas (useful when you get something wrong). I will not put your floppies into my computer, as I am not sure how good my virus protection is. This is how to do it.
If you can not use the email function, there are multiple possibilities for the problem. The settings for email may be incorrect in the browser or there may be no email server associated with the terminal you are using. If you are in the computer lab in the basement of McCord hall, the problem seems to be the wrong preferences are set in the browser. The following instructions may correct the problem if you are in the Computer Lab:
If the above does not work (if you never see the message "mail sent"), you will have to save the workbook on a diskette or other removable medium (a zip disk, for instance). You will also have to copy down the instructions above or print the lab (or open this web page on a computer that is able to send email). Go to a terminal with email capabilities, put in the diskette, open the web browser software (Netscape Communicator/Navigator or Microsoft Internet Explorer) and follow the instructions above.
Last updated August 25, 2006