Introduction to linear regression living with the lab © 2011 David Hall and the LWTL faculty team The Living with the Lab label, the Louisiana Tech Logo,

Slides:



Advertisements
Similar presentations
Why won’t my Arduino work???? living with the lab © 2012 David Hall.
Advertisements

temperature system wiring
Fabrication and testing of a centrifugal pump living with the lab.
College of Engineering & Science living with the lab Ohm’s Law © 2012 David Hall 1.5V.
Using the servo library living with the lab Libraries are computer programs written to add functionality to Arduino programs. A library to control hobby.
Conductivity sensor implementation living with the lab © 2011 LWTL faculty team.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2012 David Hall.
Waterproofing a thermistor ENGR 121 living with the lab © 2013 David Hall.
Using the Arduino to Make an LED Flash Work in teams of two! living with the lab digital I/O pins (I/O = input / output) USB cable plug power pins.
User-defined functions in Arduino sketches living with the lab © 2012 David Hall.
Using Your Arduino, Breadboard and Multimeter Work in teams of two! living with the lab 1 © 2012 David Hall.
Linear regression quality of the fit and automating the analysis in Excel living with the lab © 2011 David Hall and the LWTL faculty team The Living with.
Living with the lab Attaching Arduino to Boe-Bot Chassis © 2012 David Hall.
Thermistor calibration living with the lab © 2013 David Hall.
Cascaded switching of a solenoid valve living with the lab transistor relay solenoid valve © 2012 David Hall.
Assembly of conductivity flow loop living with the lab (in preparation for calibrating conductivity sensor)
Switches & whiskers on the Arduino living with the lab lever arm switches mounted to Arduino © 2012 David Hall.
Using fixed-cell references and built-in functions in Excel living with the lab © 2012 David Hall.
220  470  Gnd5V Currents Through Parallel Resistors 1 living with the lab © 2012 David Hall.
Using Hobby Servos with the Arduino living with the lab © 2012 David Hall.
Introduction to Microsoft Excel living with the lab © 2012 David Hall.
Voltage Drops Around Closed Loops 470  220  5V   220  living with the lab © 2012 David Hall.
Navigating the engineering disciplines robot challenge living with the lab © 2012 David Hall.
Kirchoff’s Current Law (KCL) living with the lab University of Pennsylvania Library and Wikipedia Gustav Kirchoff (left) and Robert Bunsen (right) Bunsen.
Adding a Barrel Jack to a Battery Pack living with the lab © 2012 David Hall.
Using for loops to control LEDs living with the lab 1 1 arduino.cc the for statement allows us to repeat a block of commands a limited number of times.
Pump Fabrication Day Group A will draw their pump
What you Need to Know to Succeed
Connecting Switches.
Introduction to Excel.
Series and Parallel Resistors
Pump Project Requirements
Pump Efficiency Fluid Energy Out + - Electrical Energy In.
Introduction to the Arduino
Why Won’t My Arduino Work?
Robot Challenge Introduction
Troubleshooting Your Multimeter
Introduction to SolidWorks
Pump Project Overview.
Robot Assembly.
How to Use Dial Calipers
Introduction to the Fishtank
Conservation of Mass
Conservation of Mass Problem
Troubleshooting Your Multimeter
a few of my favorite sensors
using for loops to control LEDs
using the Arduino to make LEDs flash
Using Photoresistors with an Arduino
Introduction to Mathcad
What you Need to Know to Succeed
Torque and RPM of Gears
Conservation of Mass Problem
Data Types.
analog and digital measurements
Finishing your Project
Using “if” statements.
Controlling the Heater
Conservation of Mass
Cash Flow Diagrams <in> <out> $200 $300 $150 $100
Arduino: For Loops.
Non-Concurrent Force Systems
Graphing in Mathcad.
Conservation of Mass Problem
Non-Concurrent Force Systems
Evaluating Design Alternatives
Counting Servo Gear Teeth (FS90R Servos)
Static Equilibrium Problem
Freshman Design Expo Presentations
Gearmotor Efficiency W table top gearmotor pulley string.
Presentation transcript:

introduction to linear regression living with the lab © 2011 David Hall and the LWTL faculty team The Living with the Lab label, the Louisiana Tech Logo, and this copyright notice should not be removed when any part of this work is used by others. This work may not be used for commercial purposes. Inquiries should be addressed to This presentation on linear regression is based partially on class notes created by Dr. Mark Barker at Louisiana Tech University. linear regression provides a predictable way to quantify the relationship between two variables, even when significant uncertainty and measurement error exist environmental datamedical dataprocess parameters

living with the lab 2 The content of this presentation is for informational purposes only and is intended only for students attending Louisiana Tech University. The author of this information does not make any claims as to the validity or accuracy of the information or methods presented. The procedures demonstrated here are potentially dangerous and could result in injury or damage. Louisiana Tech University and the State of Louisiana, their officers, employees, agents or volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation. If you do not agree, thendo not view this content. DISCLAIMER

living with the lab collect some data to see how linear regression works 3

collect pulse after doing jumping jacks 1.measure pulse for 10 seconds (have a partner write down the number of beats) 4 living with the lab total time (s) STOP collect heart rate five times jump jumping time (s) jump 2.do jumping jacks for 10 seconds10 seconds of total exercise STOP 3.measure pulse for 10 seconds 4.do jumping jacks for 10 seconds20 seconds of total exercise 5.measure pulse for 10 seconds 6.do jumping jacks for 10 seconds30 seconds of total exercise 7.measure pulse for 10 seconds 8.do jumping jacks for 10 seconds40 seconds of total exercise 9.measure pulse for 10 seconds

living with the lab 5 logistics choose one or two people per table to do jumping jacks; this is voluntary... don’t do the jumping jacks if there is any reason why this activity could be harmful to you the people who are jumping should get away from tripping hazards and other people (clear a space around your table and keep yourself under control while exercising) your instructor will keep track of time and tell you when to jump and when to collect heart rate; a cell phone, watch or online stopwatch can be used we need about 7 to 10 sets of data from the entire class... not everybody will get to exercise  we’ll analyze and plot this data using Excel the heart rate collected will include some error o collect pulse as soon as you stop jumping o after 10 seconds, call out the number of pulses collected over 10 seconds to your partner(s) and start jumping again just be as accurate as possible

enter heart rate data into a Excel living with the lab 6 time (s) student 1 (bpm) student 2 (bpm) student 3 (bpm) student 4 (bpm) student 5 (bpm) student 6 (bpm) student 7 (bpm) student 8 (bpm) please multiply the number of pulses collected over 10 seconds by 6 to get beats per minute (bpm) report bpm to your instructor build a spreadsheet on your computer along with the instructor

living with the lab 7 plot data for the entire class in Excel make a scatter plot using symbols only – no lines time is the independent variable and is plotted as the x-axis heart rate is the dependent variable and is plotted as the y-axis the title of the plot is always listed as “y versus x”... which is “heart rate versus exercise time” for this problem

living with the lab 8 make a hand plot for one data set your instructor will select one student’s data that is typical of the data for the entire class; we will analyze this data make a hand plot using your own paper as shown below (use proper format!!) draw a “best fit” line through the data; just use your judgment heart rate versus exercise time use data from class... not this data “best fit line”

living with the lab 9 find an equation to fit the data find the y-intercept by plugging in one of the data points: write the equation: example (use data from your class) find the slope:... where heart rate is in bpm and time is in seconds.

living with the lab 10 analysis of our equations compare your answer with others in the class if you chose the same two points to define your “best fit” line, then your equations should be the same choosing different points causes us to get different equations linear regression, which can be derived using calculus, gives us the same equation every time linear regression takes the guess work out of finding best fit lines

living with the lab 11 understanding linear regression best fit line

living with the lab 12 finding m and b Repeat the above procedure for the data set selected in your class. Compare the m and b that you get with your classmates. Doing this by hand is good practice for the exam.

living with the lab 13 repeat for all of the class data reformat your spreadsheet to have single x and y columns as shown (5 lines for each students heart rate data) find the sums and plug them into the equations for m and b to find the best fit line; try to do these calculations in Excel... it’s tricky due to fixed cell references and the placement of parentheses create a plot of all data in Excel plot the best fit line without any symbols over the data points see the next page for an example

living with the lab 14 details of solving previous problem in Excel A B C D E F =C$28*B5+C$29 =(COUNT(B5:B24)*D26-B26*C26)/(COUNT(B5:B24)*E26-B26^2) don’t look at these tips unless you get stuck!! use these data point to plot the best-fit line