Linear Regression Exercise

Similar documents
Correlation and Regression

PASS Sample Size Software

Student Exploration: Quadratics in Factored Form

Statistics 101: Section L Laboratory 10

Chapter 9 Linear equations/graphing. 1) Be able to graph points on coordinate plane 2) Determine the quadrant for a point on coordinate plane

Reminders. Quiz today. Please bring a calculator to the quiz

2.3 BUILDING THE PERFECT SQUARE

STAB22 section 2.4. Figure 2: Data set 2. Figure 1: Data set 1

Graphing - Slope-Intercept Form

JIGSAW ACTIVITY, TASK # Make sure your answer in written in the correct order. Highest powers of x should come first, down to the lowest powers.

Student Exploration: Standard Form of a Line

How to Make a Run Chart in Excel

Contents Systems of Linear Equations and Determinants

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

SM3 Lesson 2-3 (Intercept Form Quadratic Equation)

Page 21 GRAPHING OBJECTIVES:

Math 1023 College Algebra Worksheet 1 Name: Prof. Paul Bailey September 22, 2004

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

Lesson 17. Student Outcomes. Lesson Notes. Classwork. Example 1 (5 10 minutes): Predicting the Pattern in the Residual Plot

Objectives. Organizing Data. Example 1. Making a Frequency Distribution. Solution

Chapter 7, Part 1B Equations & Functions

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

y-intercept remains constant?

Creating a foldable for Equations of Lines

Section 5.2 Graphs of the Sine and Cosine Functions

EXERCISE 1: CREATE LINE SPARKLINES

Find the equation of a line given its slope and y-intercept. (Problem Set exercises 1 6 are similar.)

Graphs of linear equations will be perfectly straight lines. Why would we say that A and B are not both zero?

Chapter 4 Number Theory

Grade 6 Math Circles March 7/8, Magic and Latin Squares

ACT Coordinate Geometry Review

LINEAR EQUATIONS IN TWO VARIABLES

4.4 Slope and Graphs of Linear Equations. Copyright Cengage Learning. All rights reserved.

Numerical: Data with quantity Discrete: whole number answers Example: How many siblings do you have?

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.

Lesson 2.1 Linear Regression

N. J. Gotelli & A. M. Ellison A Primer of Ecological Statistics. Sinauer Associates, Sunderland, Massachusetts

MATHEMATICAL FUNCTIONS AND GRAPHS

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

Algebra 1 B Semester Exam Review

Appendix 3 - Using A Spreadsheet for Data Analysis

Section 5.2 Graphs of the Sine and Cosine Functions

Math 152 Rodriguez Blitzer 2.5 The Point-Slope Form of the Equation of a Line

5.1 Graphing Sine and Cosine Functions.notebook. Chapter 5: Trigonometric Functions and Graphs

Identify a pattern then use it to predict what happens next:

Graphs of sin x and cos x

Sudoku Mock Test 5. Instruction Booklet. 28 th December, IST (GMT ) 975 points + Time Bonus. Organized by. Logic Masters: India

Year 11 Graphing Notes

What are the chances?

Solving Equations and Graphing

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

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

Pre Calc. Conics.

13 Searching for Pattern

Inductive Reasoning Practice Test. Solution Booklet. 1

constant EXAMPLE #4:

Representing Square Numbers. Use materials to represent square numbers. A. Calculate the number of counters in this square array.

Lesson 3A. Opening Exercise. Identify which dilation figures were created using r = 1, using r > 1, and using 0 < r < 1.

Chapter 7 Graphing Equations of Lines and Linear Models; Rates of Change Section 3 Using Slope to Graph Equations of Lines and Linear Models

Factored Form When a = 1

1 Graphs of Sine and Cosine

AUTUMN 2016 GCSE 9-1 MOCK FOUNDATION PAPER 1 ALTERNATIVE VERSION

University of California, Berkeley, Statistics 20, Lecture 1. Michael Lugo, Fall Exam 2. November 3, 2010, 10:10 am - 11:00 am

A slope of a line is the ratio between the change in a vertical distance (rise) to the change in a horizontal

Regression: Tree Rings and Measuring Things

5.4 Multiple-Angle Identities

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

Restaurant Bill and Party Size

WPF PUZZLE GP 2018 ROUND 7 INSTRUCTION BOOKLET. Host Country: Netherlands. Bram de Laat. Special Notes: None.

P202/219 Laboratory IUPUI Physics Department THIN LENSES

Lesson 7 Slope-Intercept Formula

HUDM4122 Probability and Statistical Inference. February 2, 2015

Student's height (in)

CH 54 SPECIAL LINES. Ch 54 Special Lines. Introduction

German Tanks: Exploring Sampling Distributions Name

Algebra Success. LESSON 16: Graphing Lines in Standard Form. [OBJECTIVE] The student will graph lines described by equations in standard form.

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

Spring 2017 Math 54 Test #2 Name:

Bentleyuser.dk Årsmøde 2010 Nordic Civil 2010

1. Setup Output mode. 2. Using a Fixed tile size

!"#$%&'("&)*("*+,)-(#'.*/$'-0%$1$"&-!!!"#$%&'(!"!!"#$%"&&'()*+*!

Pre-Calc. Slide 1 / 160. Slide 2 / 160. Slide 3 / 160. Conics Table of Contents. Review of Midpoint and Distance Formulas

Pre-Calc Conics

Slope. Plug In. Finding the Slope of a Line. m 5 1_ 2. The y-intercept is where a line

Plotting Points in 2-dimensions. Graphing 2 variable equations. Stuff About Lines

THE DOMAIN AND RANGE OF A FUNCTION Basically, all functions do is convert inputs into outputs.

Chapter 3 Linear Equations in Two Variables

PART I: Emmett s teacher asked him to analyze the table of values of a quadratic function to find key features. The table of values is shown below:

What Limits the Reproductive Success of Migratory Birds? Warbler Data Analysis (50 pts.)

Algebra I Notes Unit Seven: Writing Linear Equations

Lab 4 Projectile Motion

Thanks for downloading this product from Time Flies!

Excel Lab 2: Plots of Data Sets

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

Experiment 2: Transients and Oscillations in RLC Circuits

Exploring Concepts with Cubes. A resource book

The Toolbars submenu selects or deselects the following toolbars, below shows you how to display the Measuring Toolbar: Scale X in Y

NUMERICAL DATA and OUTLIERS

Learning Log Title: CHAPTER 2: ARITHMETIC STRATEGIES AND AREA. Date: Lesson: Chapter 2: Arithmetic Strategies and Area

Experiment 1 Alternating Current with Coil and Ohmic Resistors

Transcription:

Linear Regression Exercise A document on using the Linear Regression Formula by Miguel David Margarita Hechanova Andrew Jason Lim Mark Stephen Ong Richard Ong Aileen Tan December 4, 2007

Table of Contents OBJECTIVES... 2 LINEAR REGRESSION... 2 LEAST-SQUARES REGRESSION... 3 LEAST-SQUARES REGRESSION IN EXCEL... 4 UNDERSTANDING LEAST-SQUARES REGRESSION RESULTS... 6 VALUE OF USING THE LEAST-SQUARES REGRESSION... 7 BONUS QUESTIONS... 7 REFERENCES:... 7 Page 1

A D O C U M E N T O N U S I N G T H E L I N E A R R E G R E S S I O N F O R M U L A Linear Regression Exercise Objectives Learn the concept of Linear Regression. Learn the concept of Least-Squares Regression. Perform Least-Squares Regression in a case using Excel. Understand the results of the Least-Squares Regression. Understand the use of the Least-Squares Regression. Linear Regression Linear Regression attempts to model a relationship between two variables by fitting a linear equation through observed data. One variable is considered the controlling variable and the other the dependent variable. Consider the variables: (1) a tree s age and (2) a tree s height. It can be said that the age of a tree controls its height. Therefore, the controlling variable is the age while the dependent variable is the height. A linear regression line has an equation of the form: Y = a + bx. X is the controlling variable, while Y is the dependent variable. The slope of the line is b, while a is the intercept (the value of Y when X = 0). For the oak tree example, refer to Figure 1 below. Age, the controlling variable, is on the X-axis while height, the dependent variable, is on the Y-axis. Figure 1: Linear Regression Example Page 2

Least-Squares Regression Linear Regression Exercise Least-squares regression is the most common method for fitting a regression line. This method calculates the best fitting line by minimizing the sum of the squares of the vertical deviations from each data point of the line (if a point lies on the fitted line exactly, then its vertical deviation is 0). Because the deviations are first squared, then summed, there are no cancellations between positive and negative values. Consider Figure 2 below. Imagine the diamond shaped blue dots are the data points and the diagonal line is the line that best predicts the data. Least-squares regression works by measuring the gaps between the line and the data point. These gaps (the red lines) are called residuals. Least-squares regression procedures are designed to produce the smallest set of gaps. If you consider all the differences in the figure, some of the gaps will be negative numbers and some will be positive. Statisticians multiply each gap by itself to get the square of the residual and ensure that it is always positive. This procedure, intended to produce the least (smallest) number when the squared residuals are totalled, is called the least-squares procedure. Figure 2: Least-Squares Regression Example The R² value is 0.91. This means that 91% of the variation in one variable may be explained by the other. Therefore, the line is a good fit. Page 3

Least-Squares Regression in Excel Linear Regression Exercise To illustrate how to perform Least-Squares Regression in Excel, a step-by-step guide is provided. Firstly, a statistical add-on to Excel called Poptools is needed. It can be downloaded from the following link: http://www.cse.csiro.au/poptools/index.htm Create an Excel file with the following data: Oak Age(years) Height(inches) Tree 1 97 12.5 2 93 12.5 3 88 8.0 4 81 9.5 5 75 16.5 6 57 11.0 7 52 10.5 8 45 9.0 9 28 6.0 10 15 1.5 11 12 1.0 12 11 1.0 Step 1: PopTools Extra Stats Regression A dialog-box should appear, as in Figure 3. Figure 3: Linear Regression Analysis Dialog Box Page 4

Step 2: For X data, select all the rows under the column age. Step 3: For Y data, select all the rows under the column height. Step 4: For Output, select any clear field. Step 5: For List fitted values and VC matrix, click on the check box. The dialog box should now look like Figure 4. Figure 4: Linear Regression Analysis Filled-Up Dialog Box Step 6: Click Go. Figure 5 should appear: Page 5

Figure 5: Linear Regression Results Understanding Least-squares Regression Results To understand the results, it would be helpful to have a visual image of the results. Refer to Figure 6. Figure 6: Visual Image of Linear Regression Results Comparing Figure 5 with Figure 6, Yobs is the actual Y-coordinate of the data point. Ycalc is the Y- coordinate of the point in the line. And Resid is the distance between the two. Page 6

Value of Using the Least-squares Regression To make use of the results, we need to go back to the formula on the first page: Y = a + bx This formula is the same as the formula shown in the results: y = b0 + b1.x1 b0 = 1.285354 (round up to 1.29) b1 =.127792 (round up to.128) So based from the results we can now plug-in the values for a and b to get the formula: Y = 1.29 +.128X Plugging in an X value will now produce a Y value. Say, for example, given the age of an oak tree is 97, what s its likely height? Using the above formula, the likely height of the tree is: Y = 1.29 +.128(97) Y = 13.706 The result has an accuracy of.69 since the r 2 is.69. If the r 2 is higher, predictions can be made with greater accuracy. Bonus Questions 1. 5 years from now, what is the likely height of the oak tree in the previous example? Y = 1.29 +.128(102) Y = 14.346 2. If an oak tree has a height of 3.85, what is its likely age? 3.85 = 1.29 +.128(X) 2.56 =.128X X = 20 References: http://www.physics.csbsju.edu/stats/least_squares.html http://www.stat.yale.edu/courses/1997-98/101/linreg.htm Page 7