Fitting the Data Lecture 2 Lecture 2.

Slides:



Advertisements
Similar presentations
Ordinary least Squares
Advertisements

Things to do in Lecture 1 Outline basic concepts of causality
Least Squares Equation / Coefficient of Correlation
Managerial Economics in a Global Economy
Lesson 10: Linear Regression and Correlation
The Simple Regression Model
Methods of Economic Investigation Lecture 2
Statistical Techniques I EXST7005 Simple Linear Regression.
Probabilistic & Statistical Techniques Eng. Tamer Eshtawi First Semester Eng. Tamer Eshtawi First Semester
Random effects estimation RANDOM EFFECTS REGRESSIONS When the observed variables of interest are constant for each individual, a fixed effects regression.
Correlation & Regression Chapter 15. Correlation statistical technique that is used to measure and describe a relationship between two variables (X and.
Welcome to Econ 420 Applied Regression Analysis Study Guide Week Three Ending Tuesday, September 11 (Note: You must go over these slides and complete every.
Lecture 4 This week’s reading: Ch. 1 Today:
1 The Basics of Regression. 2 Remember back in your prior school daze some algebra? You might recall the equation for a line as being y = mx + b. Or maybe.
Part 1 Cross Sectional Data
2.2 Correlation Correlation measures the direction and strength of the linear relationship between two quantitative variables.
Lecture 3 Cameron Kaplan
Econ 140 Lecture 121 Prediction and Fit Lecture 12.
Simple Linear Regression
TOOLS OF POSITIVE ANALYSIS
Lecture 11 Chapter 6. Correlation and Linear Regression.
Introduction to Linear Regression.  You have seen how to find the equation of a line that connects two points.
DERIVING LINEAR REGRESSION COEFFICIENTS
So are how the computer determines the size of the intercept and the slope respectively in an OLS regression The OLS equations give a nice, clear intuitive.
Ordinary Least Squares
Correlation and Linear Regression
McGraw-Hill/Irwin Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 13 Linear Regression and Correlation.
Lecture 3: Bivariate Data & Linear Regression 1.Introduction 2.Bivariate Data 3.Linear Analysis of Data a)Freehand Linear Fit b)Least Squares Fit c)Interpolation/Extrapolation.
Linear Regression.
Estimation of Demand Prof. Ravikesh Srivastava Lecture-8.
Linear Regression and Correlation
MAT 254 – Probability and Statistics Sections 1,2 & Spring.
Simple Linear Regression
Statistics and Quantitative Analysis U4320 Segment 8 Prof. Sharyn O’Halloran.
What is the MPC?. Learning Objectives 1.Use linear regression to establish the relationship between two variables 2.Show that the line is the line of.
Ch4 Describing Relationships Between Variables. Pressure.
Managerial Economics Demand Estimation. Scatter Diagram Regression Analysis.
Correlation is a statistical technique that describes the degree of relationship between two variables when you have bivariate data. A bivariate distribution.
Statistical Methods Statistical Methods Descriptive Inferential
Welcome to Econ 420 Applied Regression Analysis Study Guide Week One Ending Sunday, September 2 (Note: You must go over these slides and complete every.
Y X 0 X and Y are not perfectly correlated. However, there is on average a positive relationship between Y and X X1X1 X2X2.
LECTURE 14 TUESDAY, 13 OCTOBER STA 291 Fall
10B11PD311 Economics REGRESSION ANALYSIS. 10B11PD311 Economics Regression Techniques and Demand Estimation Some important questions before a firm are.
Lecture 7: What is Regression Analysis? BUEC 333 Summer 2009 Simon Woodcock.
Scatterplots & Regression Week 3 Lecture MG461 Dr. Meredith Rolfe.
Chapter 6 (cont.) Difference Estimation. Recall the Regression Estimation Procedure 2.
LECTURE 9 Tuesday, 24 FEBRUARY STA291 Fall Administrative 4.2 Measures of Variation (Empirical Rule) 4.4 Measures of Linear Relationship Suggested.
Economics 173 Business Statistics Lecture 10 Fall, 2001 Professor J. Petry
© 2001 Prentice-Hall, Inc.Chap 13-1 BA 201 Lecture 18 Introduction to Simple Linear Regression (Data)Data.
Psychology 202a Advanced Psychological Statistics October 22, 2015.
1 Simple Linear Regression and Correlation Least Squares Method The Model Estimating the Coefficients EXAMPLE 1: USED CAR SALES.
Lecture 8: Ordinary Least Squares Estimation BUEC 333 Summer 2009 Simon Woodcock.
Lecturer: Ing. Martina Hanová, PhD. Business Modeling.
Intro to Statistics for the Behavioral Sciences PSYC 1900 Lecture 7: Regression.
OLS Regression What is it? Closely allied with correlation – interested in the strength of the linear relationship between two variables One variable is.
©The McGraw-Hill Companies, Inc. 2008McGraw-Hill/Irwin Linear Regression and Correlation Chapter 13.
Copyright © Cengage Learning. All rights reserved. 8 9 Correlation and Regression.
Linear Regression Essentials Line Basics y = mx + b vs. Definitions
THE LINEAR REGRESSION MODEL: AN OVERVIEW
Multiple Regression Lecture 13 Lecture 12.
Linear Regression Bonus
Ordinary Least Squares (OLS) Regression
Section 4.2 How Can We Define the Relationship between two
LESSON 21: REGRESSION ANALYSIS
Linear regression Fitting a straight line to observations.
Regression Lecture-5 Additional chapters of mathematics
Positive analysis in public finance
6.1.1 Deriving OLS OLS is obtained by minimizing the sum of the square errors. This is done using the partial derivative 6.
Presentation transcript:

Fitting the Data Lecture 2 Lecture 2

Today’s Plan Finishing off the examples from Lecture 1 Introducing different types of data Fitting the data One of the most important lectures of the course There will be a question on this on a midterm and the final! (Almost guaranteed!) You can find this material in the Appendix 4.2 Lecture 2

Experimental vs Observational Because of financial/practical/ethical concerns, experiments in economics are rare (SIME/DIME, Tennessee STAR). Economists tend to use observational data - obtained from real world behavior. Collected using surveys/administrative records. Observational data poses problem: how to estimate causal effects, no random assignment, data definitions not quite right (what economic theory might require). Much of econometrics is devoted to estimation with problems encountered with observational data. Lecture 2

Cross-Section Data We have already seen 2 examples of cross-section data: Wages and years of education Voting polls in Florida Cross section data sets provide information about individual/agent behavior at a moment in time Current Population Survey is a cross-section survey that generates monthly detail about the US work force Data on county/state/or even countries at a moment in time is also cross-section data. Lecture 2

Time Series Data Sets (1) Time series data sets provide information about individual/agent behavior over time A time unit of observation (day, week, month, year) defines a time series We hear about time series data everyday: Nasdaq Financial Times Stock Exchange Index (FTSE) Dow Jones Government data: GDP/Unemployment/Inflation Lecture 2

Time Series Data Sets (2) Composition of unit can change FTSE gives information on the top 100 stocks each day, not necessarily the same 100 stocks every day CPS: gives data from each month on the number of people who are unemployed. Not the same people (we hope!) from month to month. Characteristics of time series data sets set of observations over time composition of unit can change compositional changes are dealt with using weighting schemes (Lecture 3) Lecture 2

Longitudinal Data Sets Longitudinal data sets provide information on a particular group of individuals/agents over time. For example: following Econ140, Fall 2002 over time. Alternatively, a set of firms over time. Example we will use: Production functions (Cobb-Douglas) - following firms over time. Book example: Traffic Deaths and Alcohol Taxes - following states over time. Lecture 2

Ordinary Least Squares (OLS) Learning how to calculate a straight line (Appendix 4.2) Recall the scatter plot of earnings vs. years of education: there was a mess of data! We can use Ordinary Least Squares (OLS) to fit a straight line through these data points This line is called the least squares line or line of best fit Why is it called: ‘least square line’? Least squares line is the minimization of errors - the OLS regression line picks up the smallest distance between data points and the line Lecture 2

Two Parts to OLS 1. Derive estimators for a (intercept) and b (slope coefficent) this means using differential calculus! 2. Calculate values for a and b from data this means mechanically using the derived formulas for a & b How to calculate a regression line through a mass of data points that do not necessarily lie on a straight line? Each data point (X,Y) has a value. Lecture 2

OLS Line We’ll call the regression line this is an estimate of the true Y The errors will be the difference between and Y errors can be positive or negative We can write the following general equations: Where i = 1 … n. Lecture 2

OLS Line A data set example is available at the course web site. It consists of five points. Using that output I can calculate the regression equation to be: Keeping this equation in mind we can find estimates of a and b given our general formulas for Y and We derive a and b from two different types of regression equations: a from b from Lecture 2

OLS Line: Deriving a (1) We can rewrite as ei=Yi - a we could write objective function for a as: Go back to the regression analysis example: notice that the sum of errors is zero! Why? The positive and negative errors from the line of best fit always cancel out For a minimum you need a first order condition (FOC) set to zero. We need a FOC for OLS that is set to zero, not zero to start with! Lecture 2

OLS Line: Deriving a (2) We can’t just minimize the sum of the errors because Instead, we have to minimize the sum of the errors squared (hence - least squares): where ei = Y - a Lecture 2

OLS Line: Deriving a (3) Differentiate with respect to a to find the formula for the OLS estimator a Note that you set the first order condition to zero to find a minimum: -2Sei = 0 (don’t worry about the second order derivative - which will be positive). Remember that ei = Y - a Solve for a: a = SYi/n. Lecture 2

OLS Line: Deriving b (1) Now consider the slope regression where We use the same principles as before: Note: this condition only holds if there’s no correlation between X and the errors So: (keep in mind that this expression only holds for the regression of a zero intercept and non-zero slope) Lecture 2

OLS Line: Collect a & b We know a regression line with a non-zero intercept and a non-zero slope coefficient looks like: We also know: From the derivations of a and b we have the necessary first order conditions: Lecture 2

OLS Line: Collect a & b (2) Plug the new equation into the FOC from our derivation of a: Plugging into the FOC from the derivation of b: Lecture 2

Example From the data set posted on the web To calculate the regression line you need: Solve for a & b given the formulas: Lecture 2

Example (2) Lecture 2

Wrap Up Introduced three data types: cross-section, time series, and longitudinal Using the OLS technique to derive formulas for an intercept and a slope coefficient We estimated the regression lines We found FOCs = 0 Then we put everything together to estimate Lecture 2