Appendix 3 - Using A Spreadsheet for Data Analysis

Similar documents
CHM 109 Excel Refresher Exercise adapted from Dr. C. Bender s exercise

CHM 152 Lab 1: Plotting with Excel updated: May 2011

Excel Lab 2: Plots of Data Sets

Excel Tool: Plots of Data Sets

This tutorial will lead you through step-by-step to make the plot below using Excel.

Page 21 GRAPHING OBJECTIVES:

MATHEMATICAL FUNCTIONS AND GRAPHS

Graphing with Excel. Data Table

Section 3 Correlation and Regression - Worksheet

Honors Chemistry Summer Assignment

Laboratory 2: Graphing

Write a spreadsheet formula in cell A3 to calculate the next value of h. Formulae

Physics 253 Fundamental Physics Mechanic, September 9, Lab #2 Plotting with Excel: The Air Slide

How to Make a Run Chart in Excel

A graph is an effective way to show a trend in data or relating two variables in an experiment.

Experiment G: Introduction to Graphical Representation of Data & the Use of Excel

Data Analysis Part 1: Excel, Log-log, & Semi-log plots

Step 1: Set up the variables AB Design. Use the top cells to label the variables that will be displayed on the X and Y axes of the graph

Assignment 5 due Monday, May 7

A To draw a line graph showing the connection between the time and cost

Sensors and Scatterplots Activity Excel Worksheet

Plotting scientific data in MS Excel 2003/2004

Appendix C: Graphing. How do I plot data and uncertainties? Another technique that makes data analysis easier is to record all your data in a table.

Laboratory 1: Motion in One Dimension

PASS Sample Size Software

Standing Waves. Miscellaneous Cables and Adapters. Capstone Software Clamp and Pulley White Flexible String

Comparing Across Categories Part of a Series of Tutorials on using Google Sheets to work with data for making charts in Venngage

Spreadsheets 3: Charts and Graphs

Experiment 1: BUILDING THE FOUNDATION FOR THE CHEMISTRY LAB COURSE

MicroLab 500-series Getting Started

1. Start with scatter plot: 2. Find corner points. 3. Capture image. 4. Corners

Chapter 2: PRESENTING DATA GRAPHICALLY

Use Linear Regression to Find the Best Line on a Graphing Calculator

Experiment 2: Electronic Enhancement of S/N and Boxcar Filtering

Science Binder and Science Notebook. Discussions

Excel Manual X Axis Label Below Chart 2010 >>>CLICK HERE<<<

Selecting the Right Model Studio PC Version

Problem 1 Multiple sets of data on a single graph [Gottfried, pg. 92], Downloading, Importing Data

Microsoft Excel: Data Analysis & Graphing. College of Engineering Engineering Education Innovation Center

PASS Sample Size Software. These options specify the characteristics of the lines, labels, and tick marks along the X and Y axes.

Existing and Design Profiles

Excel 2013 Unit A: Getting Started With Excel 2013

Environmental Stochasticity: Roc Flu Macro

Excel 2003: Discos. 1. Open Excel. 2. Create Choose a new worksheet and save the file to your area calling it: Disco.xls

Purpose. Charts and graphs. create a visual representation of the data. make the spreadsheet information easier to understand.

Creating Run Charts (Time Series Plots, Line Charts) Excel 2010 Tutorial

Chapter 2. The Excel functions, Excel Analysis ToolPak Add-ins or Excel PHStat2 Add-ins needed to create frequency distributions are:

Learning Guide. ASR Automated Systems Research Inc. # Douglas Crescent, Langley, BC. V3A 4B6. Fax:

Math Labs. Activity 1: Rectangles and Rectangular Prisms Using Coordinates. Procedure

Excel Manual X Axis Scales 2010 Graph Two X-

CREATING (AB) SINGLE- SUBJECT DESIGN GRAPHS IN MICROSOFT EXCEL Lets try to graph this data

Solving Equations and Graphing

5 Day Unit Plan. Algebra/Grade 9. JenniferJohnston

Office 2016 Excel Basics 24 Video/Class Project #36 Excel Basics 24: Visualize Quantitative Data with Excel Charts. No Chart Junk!!!

Tektronix digital oscilloscope, BK Precision Function Generator, coaxial cables, breadboard, the crystal earpiece from your AM radio kit.

Line Graphs. Name: The independent variable is plotted on the x-axis. This axis will be labeled Time (days), and

GEO/EVS 425/525 Unit 2 Composing a Map in Final Form

NCSS Statistical Software

Volume of Revolution Investigation

Math 65A Elementary Algebra A Exam II STUDY GUIDE and REVIEW Chapter 2, Sections 3 5, and Chapter 3, Sections 1-3

SMALL OFFICE TUTORIAL

Drawing Bode Plots (The Last Bode Plot You Will Ever Make) Charles Nippert

This lab is to be completed using University computer labs in your own time.

Mathematics Success Grade 8

Tutorial 1: Install Forecaster HD (Win XP, Vista, 7, 8)

GE U111 HTT&TL, Lab 1: The Speed of Sound in Air, Acoustic Distance Measurement & Basic Concepts in MATLAB

Excel Manual X Axis Scale Start At Graph

EE 210 Lab Exercise #3 Introduction to PSPICE

Computer Tools for Data Acquisition

FlashChart. Symbols and Chart Settings. Main menu navigation. Data compression and time period of the chart. Chart types.

CAD Orientation (Mechanical and Architectural CAD)

Graphing Techniques. Figure 1. c 2011 Advanced Instructional Systems, Inc. and the University of North Carolina 1

Chapter 9 Organization Charts, Flow Diagrams, and More

PHY 1405 Conceptual Physics I Making a Spring Scale. Leader: Recorder: Skeptic: Encourager:

AutoCAD Tutorial First Level. 2D Fundamentals. Randy H. Shih SDC. Better Textbooks. Lower Prices.

SolidWorks 95 User s Guide

Sensor Calibration Lab

Appendix III Graphs in the Introductory Physics Laboratory

Sensor Calibration Lab

ARCHICAD Introduction Tutorial

BALANCING MONEY AND EXCELLING AT IT TOO! MODELING THE LAW OF THE LEVER NAME:

GEO/EVS 425/525 Unit 3 Composite Images and The ERDAS Imagine Map Composer

AutoCAD LT 2012 Tutorial. Randy H. Shih Oregon Institute of Technology SDC PUBLICATIONS. Schroff Development Corporation

Experiment P01: Understanding Motion I Distance and Time (Motion Sensor)

Example Application C H A P T E R 4. Contents

Chemistry 401 Laboratory Manual Introduction

TeleTrader FlashChart

SDC. AutoCAD LT 2007 Tutorial. Randy H. Shih. Schroff Development Corporation Oregon Institute of Technology

Year 11 Graphing Notes

Physics 131 Lab 1: ONE-DIMENSIONAL MOTION

33-2 Satellite Takeoff Tutorial--Flat Roof Satellite Takeoff Tutorial--Flat Roof

6.1 Slope of a Line Name: Date: Goal: Determine the slope of a line segment and a line.

Lab 2 Advanced Excel Introduction

EKA Laboratory Muon Lifetime Experiment Instructions. October 2006

Adding Objects Creating Shapes Adding. Getting Started Creating a Workspace Pages, Masters and Guides Adding Objects Creating Shapes Adding

Creo Revolve Tutorial

Lab 4 Projectile Motion

Using Graphing Skills

We recommend downloading the latest core installer for our software from our website. This can be found at:

EQ7 Summer Drawing Series: Block 4

Transcription:

105 Linear Regression - an Overview Appendix 3 - Using A Spreadsheet for Data Analysis Scientists often choose to seek linear relationships, because they are easiest to understand and to analyze. But, even when data is supposed to be linear, data points seldom form a perfect straight line, so linear regression analysis is used to determine the best straight line that fits your data, i.e. the computer calculates the formula of the straight line that best fits your data. The general formula for a straight line is: where y = ax + b a = the slope of the line b = the y intercept, where the line crosses the y-axis The x values are called the independent variables and the y values are called the dependent variables. The value for x is somewhat arbitrarily chosen (independent), and the value for y then "depends" on that value. Once a and b have been determined, the value of y can be predicted for any chosen value of x. When a theoretical model is in the form of a straight line, the slope and intercept provide theoretical information about your data. For example, the formula for density is D = m/v, this rearranges to m = DV which is in the standard form for a straight line, y = mx + b. When mass is plotted on the y axis (Y=mass) and volume on the x axis (x=volume), the formula says the slope should be the Density (a=d) and the intercept should be zero (b=0, no term in the density equation).! The slope, a, is the change in y divided by the change in x (rise/run), so its units are the units of y divided by the units of x.! The intercept, b, is the value for y when x equals zero, so b has the same units as y.! For example, if you were to plot the masses of some set of objects on the y-axis and their corresponding volumes on the x-axis, the result would be a straight line with a positive slope. What is the unit/label on mass (y)? What is the unit/label on volume (x)? The unit/label on a will be mass divided by volume, what do you get? Note that this is the unit/label for density. Therefore, the slope of the straight line obtained by plotting the mass of a sample vs its volume is the density. The y intercept, b, has the same unit/label as y, so what is the unit/label on b?! Remember, not all data have a linear relationship, so linear regression is not appropriate for all data sets. Look at the graph first to see if the data is truly linear before you use linear regression. Data points out in left field should be double checked for accuracy (data entry, measurements) or omitted from regression analysis. Above all, don't force a linear relationship on data that is obviously not linear (i.e. curved). Spreadsheet Instructions This section leads you step-by-step through the process of entering data, creating and copying formulas, creating a graph, inserting a trendline line (obtained by linear regression), and printing the spreadsheet and graph. When you create a spreadsheet for a lab report or assignment, make sure you document it properly. It should contain enough information so someone could identify it and figure out how you did your calculations from a printed copy of the spreadsheet. In addition it should conform to the format expected for presentation of scientific data. So, make sure the following information is provided in every spreadsheet you turn in: 1. Your name and partner s names. 2. Date. 3. Title for the experiment or assignment. 4. Label all data columns and other quantities calculated. 5. Show sample formulas for all calculations above the appropriate column or in a neighboring cell. 6. Include units/labels and display the proper number of significant figures on the target values that you will report in your conclusion, i.e. final results only, not intermediate calculations or data. 7. If you know the "true" value, determine the percent error. 8. Each graph must have a title, axis titles with units on both axes (the units are often enclosed in parentheses or separated from the title by a slash / ), and a legend if two or more series of data are plotted. 9. The scale of each axis should be marked with ticks and values (default setting in Excel).

106 10. Always follow the graphing convention for scientific data: data points as markers only and regression line as a line without markers. Initial Data Entry! Enter partner names, date, and a experiment title.! Enter your data in columns including labels at the top of each column. Excel expects the x values to be in the first column and y values in the second column. To adjust the column widths, move your cursor to the grey bar with the column letters and drag the right edge of the column until it fits your label. Note that spreadsheets ignore significant figures. For this class we will only worry about displaying significant figures correctly on the final values calculated.! Save files to your J: drive or personal drive (floppy, flash, etc.). Don t save to the local hard drive in the computer labs, those drives get cleaned often so your files may just disappear. Make sure to save often when constructing a spreadsheet, so you can recover easily from crashes or wrong mouse clicks. Entering Formulas For Calculations! Every cell formula must begin with a mathematical symbol (=, +, -, /, *, $, @, etc.) for Excel to interpret it as a formula instead of text.! A cell address, the column letter followed by the row number (like xy coordinates), is used like a variable in formulas.! When a formula is copied to another cell, the cell addresses are adjusted relative to the new location. For example if the formula +A2 is typed in cell B2 and then copied to cell B3, the formula in B3 will be +A3.! To keep the cell address the same (not adjusted) when it is copied, use $ s in the cell designations, like $A$2. For example, if the formula $A$2 is typed in cell B2 and then copied to cell B3, the formula in B3 will be $A$2, it won t change. Rows and columns are treated independently, so both $ s are needed to fix the address to a given cell. In contrast, when $A2 is copied, the column designation (A) will be locked, but the row designation (2) will be adjusted relative to the new location.! There are also a large number of mathematical functions available. These formulas may be used alone or embedded in a formula. Excel's defined functions may be typed directly into the cell (if you know what it is) or can be inserted into the cell via the Insert/Functions menus. Graphing The Data! Highlight your data columns (numbers only, not the labels) and click on the Chart Wizard icon on the toolbar ( ) or choose Insert/Chart from the menus. The Chart Wizard will lead you through four steps to create a graph of your data. This tutorial will show you all the options, but when you create graphs for future assignments, you need to select only those options you wish to change and skip the others (accept the defaults).

107 Step 1 Step 2 - Series tab Step 3 - Titles tab Select: Chart Type = XY Scatter Chart Subtype = markers only (the default choice). Click Next. Step 3 - Axes tab Make sure the x values are the diameters and the y values are the circumferences. In the Name box type Data (this will become the label in the legend box) Click Next. Step 3 - Grid Lines tab Enter a title for the graph For x axis enter Diameter (cm) For y axis enter Circumference (cm) Step 3 - Legend tab Experiment with the options and note the result on the adjacent graph. Reselect the defaults (shown above) which display numbers and tics on each axis. Select your preference for display of gridlines on the graph. Defaults are OK. Make sure Show Legend is selected (default). Select desired position for the legend. (We will add a trendline in a bit so a legend will be necessary). Step 3 - Data Labels tab Step 4 Experiment with the options and note the result on the adjacent graph. Make sure None is selected (default). Click Next Select Graph as Object and select the sheet where your data resides as the destination. Click Finish.

108 Adjusting the Layout for Printing! You should now see a graph displayed in the spreadsheet similar to that shown in Fig. 2. Adjust the size and location so the spreadsheet and graph fill the page when printed. " Make sure you have deselected the graph (click outside the graph), and then select View/Page Break View. (The Page Break View and the Normal View options will not show up in the View menu if the graph is selected.) In this view you see the whole page, but you can still work in the spreadsheet. Check to see that your spreadsheet info lie completely on the page or fit neatly on the pages they cover. If not, cut and paste until they are. " Next click on the graph to select it, and drag it to an open space below your data. Then stretch and position it to fill the rest of the page (similar to Fig. 3). Deselect the graph and switch back to Normal View (in the View menu). Notice in Normal view there is now a dotted line displayed along the left edge which will be the edge of the page when printed. Save your spreadsheet. Fig. 2 Add a Trendline If your graph shows that the data are in a roughly linear relationship; you can use Fig. 3 linear regression to calculate the equation of the straight line that best fits your data. So, the next step is to extract the regression equation and plot the regression line (Excel calls it a trendline).! Right click on one of the data points in the graph and select Add Trendline... Trendline - Type Trendline - Options Select linear (default). Choose the data set to apply the trendline to (only one choice here). Name is the title in legend box. Forecast extends the line in the graph forward and backward beyond the data. Do not select Set intercept = 0 Select Display equation on chart. Display R 2 on chart - your option. R 2 is a goodness of fit measure, R 2 =1 is exact fit and R 2 =0 is no fit. Click OK. Page Break View of the graph as it should appear now. Notice that the data is plotted as markers only, and the regression line is plotted as line only. This is standard format for scientific graphs; make sure all your graphs adhere to this convention.! Edit the graph by right clicking on a component of the graph (the grid, a line, an axis, an axis label, the title, the legend box) and opening the Format menu. For the Chart Area and the Plot Area, notice that, in addition to the Format menu for the item chosen, you also have access to Chart Type, Source Data, Chart Options, and Location - the four steps of the Chart Wizard as well as cut and paste options.

109 Documenting Information from the Regression Equation! Document in your spreadsheet what you expect to learn from the slope and intercept of the regression equation. For example, the formula for density is D = m/v, this rearranges to m = DV which is in the standard form for a straight line, y = mx + b. When mass is plotted on the y axis and volume on the x axis, the formula says the slope should be the Density and the intercept should be zero (no term in the equation). So, in your spreadsheet you would enter: slope = density = value intercept = zero = value! Significant figures for slope and intercept: Look at the average number of significant figures for the x and y data; the lowest average number of significant figures sets the significant figures for your slope and intercept. Adjust the cell format the values for slope and intercept so they display the correct significant figures. " Here we recognize slope and intercept were determined from our measurements for the x and y data and regression averages those values in the calculation. " Another way to determine significant figures is to do a more detailed regression analysis and look at the standard deviations for the slope and intercept, but we won t go into that here; it will be covered in later chemistry and physics courses.! Enter the units/label for the slope and intercept values.! When you know the accepted or true value, calculate the percent error, and then label and document the calculation. The formula for percent error is: The vertical lines in the numerator indicate absolute value, i.e., the difference is always positive, which is accomplished with the ABS function. " Enter % error = into a cell. In the adjacent cell of the next column, enter the formula to calculate the percent error. Then add the unit/label % in the next column. " Change the cell format to display the proper number of significant figures. " Document the formula used. The easiest way to do this is to combine copy and past with manipulation of the way Excel displays cell contents. First move the cursor to the cell with the formula and then enter edit mode - either press F2 (Fig. 4) or click in the status line where the formula is displayed (Fig. 5). Then delete the = sign at the beginning of the formula and get out of edit mode (hit return or click outside the cell. Now the formula will be displayed as text. Copy this text version of the formula to cell just above or below. Then replace the = sign as the first character in the original cell. Note how you have documented your calculation, specified the Fig. 4 F2 edit mode Fig. 5 prompt line edit mode number of significant digits for your answer and included the units for that answer. Make this a habit for all spreadsheet exercises you turn in. Save your spreadsheet.! A completed example of the spreadsheet expected for this class is shown on the next page. Printing the Spreadsheet and the Graph! In File/Page Setup select Portrait or Landscape, set margins, and set the print scaling to get the best fit on the page.! Use View/Page Break View to arrange things to print nicely.! Use the File/Print Preview in the File menu to see how it will look.! File/Print or Control p to print the spreadsheet and inserted graph. If you select the graph and then print, only the graph prints.

110 Final Report! Each group turn in the printout of the spreadsheet and the graph.! Make sure each member of the group signs the printout as an assertion that this was a group effort.! Several labs this semester will require you to use Excel to analyze the data. At those times refer back to this exercise to refresh your memory about the procedures you need. Always remember to completely document your spreadsheet - identify the values and equations used. Example of spreadsheet for this class Diameter (cm) Circumference (cm) DEW 0.46 1 06/30/2004 1.31 4 Detn of Pi 2.94 9 6.55 20 slope = Pi = 3.18 10.01 32 intercept = zero = -0.306 cm 4.36 14 5.83 19 % error = 1.32 % 7 21 ABS(PI()- F5)/PI()*100 8.9 28 Detn of Pi 35 30 y = 3.1832x - 0.3061 R 2 = 0.9974 Circumference (cm) 25 20 15 10 Data Linear (Data) 5 0 0 5 10 15 Diameter (cm)