Regression using lm lmRegression.R Basics Prediction World Bank CO2 Data.

Slides:



Advertisements
Similar presentations
Simple linear models Straight line is simplest case, but key is that parameters appear linearly in the model Needs estimates of the model parameters (slope.
Advertisements

11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
Regresi Linear Sederhana Pertemuan 01 Matakuliah: I0174 – Analisis Regresi Tahun: Ganjil 2007/2008.
6-1 Introduction To Empirical Models 6-1 Introduction To Empirical Models.
Regression Analysis Simple Regression. y = mx + b y = a + bx.
Regression Analysis Module 3. Regression Regression is the attempt to explain the variation in a dependent variable using the variation in independent.
Probabilistic & Statistical Techniques Eng. Tamer Eshtawi First Semester Eng. Tamer Eshtawi First Semester
Objectives (BPS chapter 24)
Chapter 4 Part I - Introduction to Simple Linear Regression Applied Management Science for Decision Making, 2e © 2014 Pearson Learning Solutions Philip.
© 2000 Prentice-Hall, Inc. Chap Multiple Regression Models.
Multiple Regression Models. The Multiple Regression Model The relationship between one dependent & two or more independent variables is a linear function.
Lesson #32 Simple Linear Regression. Regression is used to model and/or predict a variable; called the dependent variable, Y; based on one or more independent.
Gordon Stringer, UCCS1 Regression Analysis Gordon Stringer.
Simple Linear Regression Analysis
C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Linear Regression and Linear Prediction Predicting the score on one variable.
Statistics 350 Lecture 17. Today Last Day: Introduction to Multiple Linear Regression Model Today: More Chapter 6.
Chapter 12 Section 1 Inference for Linear Regression.
Simple Linear Regression Analysis
1 1 Slide Simple Linear Regression Chapter 14 BA 303 – Spring 2011.
Correlation & Regression
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Simple Linear Regression Analysis Chapter 13.
Introduction to Linear Regression and Correlation Analysis
Simple Linear Regression. Types of Regression Model Regression Models Simple (1 variable) LinearNon-Linear Multiple (2
Regression Analysis Regression analysis is a statistical technique that is very useful for exploring the relationships between two or more variables (one.
Chapter 11 Simple Regression
Stats for Engineers Lecture 9. Summary From Last Time Confidence Intervals for the mean t-tables Q Student t-distribution.
OPIM 303-Lecture #8 Jose M. Cruz Assistant Professor.
+ Chapter 12: Inference for Regression Inference for Linear Regression.
Applied Quantitative Analysis and Practices LECTURE#22 By Dr. Osman Sadiq Paracha.
1 Dr. Jerrell T. Stracener EMIS 7370 STAT 5340 Probability and Statistics for Scientists and Engineers Department of Engineering Management, Information.
Applied Quantitative Analysis and Practices LECTURE#23 By Dr. Osman Sadiq Paracha.
Statistical Methods Statistical Methods Descriptive Inferential
Regression. Population Covariance and Correlation.
2014. Engineers often: Regress data  Analysis  Fit to theory  Data reduction Use the regression of others  Antoine Equation  DIPPR We need to be.
Multiple Regression and Model Building Chapter 15 Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
Sullivan – Fundamentals of Statistics – 2 nd Edition – Chapter 4 Section 2 – Slide 1 of 20 Chapter 4 Section 2 Least-Squares Regression.
Inference for Regression Simple Linear Regression IPS Chapter 10.1 © 2009 W.H. Freeman and Company.
Regression Regression relationship = trend + scatter
Simple Linear Regression. The term linear regression implies that  Y|x is linearly related to x by the population regression equation  Y|x =  +  x.
Business Statistics: A Decision-Making Approach, 6e © 2005 Prentice-Hall, Inc. Chap 13-1 Introduction to Regression Analysis Regression analysis is used.
1 Regression Analysis The contents in this chapter are from Chapters of the textbook. The cntry15.sav data will be used. The data collected 15 countries’
Ch14: Linear Least Squares 14.1: INTRO: Fitting a pth-order polynomial will require finding (p+1) coefficients from the data. Thus, a straight line (p=1)
© 2001 Prentice-Hall, Inc.Chap 13-1 BA 201 Lecture 18 Introduction to Simple Linear Regression (Data)Data.
Lesson 14 - R Chapter 14 Review. Objectives Summarize the chapter Define the vocabulary used Complete all objectives Successfully answer any of the review.
Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Simple Linear Regression Analysis Chapter 13.
1 Simple Linear Regression and Correlation Least Squares Method The Model Estimating the Coefficients EXAMPLE 1: USED CAR SALES.
1 1 Slide The Simple Linear Regression Model n Simple Linear Regression Model y =  0 +  1 x +  n Simple Linear Regression Equation E( y ) =  0 + 
Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Multiple Regression Chapter 14.
Chapter 14 Introduction to Regression Analysis. Objectives Regression Analysis Uses of Regression Analysis Method of Least Squares Difference between.
Simple linear regression and correlation Regression analysis is the process of constructing a mathematical model or function that can be used to predict.
Lecturer: Ing. Martina Hanová, PhD.. Regression analysis Regression analysis is a tool for analyzing relationships between financial variables:  Identify.
BUSINESS MATHEMATICS & STATISTICS. Module 6 Correlation ( Lecture 28-29) Line Fitting ( Lectures 30-31) Time Series and Exponential Smoothing ( Lectures.
Introduction Many problems in Engineering, Management, Health Sciences and other Sciences involve exploring the relationships between two or more variables.
Bivariate Regression. Bivariate Regression analyzes the relationship between two variables. Bivariate Regression analyzes the relationship between two.
CHAPTER 12 More About Regression
CHAPTER 3 Describing Relationships
CHAPTER 12 More About Regression
Simple Linear Regression - Introduction
CHAPTER 29: Multiple Regression*
Chapter 12 Inference on the Least-squares Regression Line; ANOVA
Unit 3 – Linear regression
Simple Linear Regression
Chapter 12 Review Inference for Regression
CHAPTER 12 More About Regression
Adequacy of Linear Regression Models
Adequacy of Linear Regression Models
Example on the Concept of Regression . observation
Adequacy of Linear Regression Models
CHAPTER 12 More About Regression
Adequacy of Linear Regression Models
Presentation transcript:

Regression using lm lmRegression.R Basics Prediction World Bank CO2 Data

Simple Linear regression Simple linear model: y = b 1 + x b 2 + error y: the dependent variable x: the independent variable b 1, b 2 : intercept and slope coefficients error: random departures between the model and the response. Coefficients estimated by least squares

Multiple regression y = b 0 + x 1 b 1 + x 2 b 2 + x 3 b 3 + … + error

Annual Boulder Temperatures Temperature is dependent variable, Year is the independent variable Errors =???? Linear =???

CO 2 Emissions by Country Independent: GDP/capita Dependent: CO2 emission Linear?? Errors ??

The R lm function Takes a formula to describe the regression where ~ means equals Works best when the data set is a data frame Returns a complicated list that can be used in summary, predict, print plot lmFit <- lm( y ~ x1 + x2)

Or more generally using a data frame lmFit <- lm( y ~ x1 + x2, data=dataset) dataset$y, dataset$x1, dataset$x2

Analysis of World Bank data set Best to work on a log scale and GDP has the strongest linear relationship Some additional pattern leftover in the residuals Try other variables Try a more complex curve Check the predictions using cross-validation

Leave-one-out Cross-validation Robust way to check a models predictions and the uncertainty measure Four steps: 1.Sequentially leave out each observation 2.Refit model with remaining data 3.Predict the omitted observation 4.Compare prediction and confidence interval to the actual observation A check on the consistency of the statistical model Because omitted observation is not used to make prediction