# Quantitative Methods 2: “Decision Making Under Uncertainty” Lecture 1 IRCO 454 Professor Edmund Malesky, UCSD 1 Copyrighted by Edmund Malesky. Do not.

## Presentation on theme: "Quantitative Methods 2: “Decision Making Under Uncertainty” Lecture 1 IRCO 454 Professor Edmund Malesky, UCSD 1 Copyrighted by Edmund Malesky. Do not."— Presentation transcript:

Quantitative Methods 2: “Decision Making Under Uncertainty” Lecture 1 IRCO 454 Professor Edmund Malesky, UCSD 1 Copyrighted by Edmund Malesky. Do not distribute without permission.

Outline of Today’s Lecture 1) Introduction to QM2 2) Flip to the last page of the novel – What is linear modeling and how is it used? 3) A brief review of critical concepts that you learned in QM1. 2 Copyrighted by Edmund Malesky. Do not distribute without permission.

Goals of the Course  Learn to do quantitative empirical work for use in economic analysis, public policy and social sciences.  Learn the basic properties of the regression estimator.  Learn to diagnose and address problems with fit between data and estimator  Learn to present results in a meaningful way.  Learn STATA. 3 Copyrighted by Edmund Malesky. Do not distribute without permission.

Topics We Will Address  ONE basic equation:  Y = β 0 + β 1 X + u  This is a VERY flexible model for understanding social, political, economic behavior.  First part of course will be about HOW to estimate β 0 and β 1  Also about what ASSUMPTIONS are needed to make those estimates. 4 Copyrighted by Edmund Malesky. Do not distribute without permission.

Topics We Will Address  Y = β 0 + β 1 X + u  The rest of the course will be about what to do if those assumptions are not reasonable  How do we make sure that our estimates of β 1 are unbiased, or at least consistent 5 Copyrighted by Edmund Malesky. Do not distribute without permission.

Problems with u (the error term /residual)  Omitted Variable Bias  Heteroskedasticity  Dichotomous Dependent Variables  Autocorrelation 6 Copyrighted by Edmund Malesky. Do not distribute without permission.

Problems with X  Measurement Error  Multicollinearity 7 Copyrighted by Edmund Malesky. Do not distribute without permission.

Problems with β 0 & β 1  Dummy variables for new intercepts  Non-linear effects  Interaction Effects 8 Copyrighted by Edmund Malesky. Do not distribute without permission.

Problems with Y  Endogeneity Bias  Selection Bias  The use (abuse) of R-squared and “curve fitting” 9 Copyrighted by Edmund Malesky. Do not distribute without permission.

Course Structure (Two Components)  Monday: A theory based lecture on the mathematical properties of the linear regression technique and problems with its application. No laptops!  Wednesdays: A practical hands-on lab, where we will learn how to program statistical code in STATA. Bring your laptops!! 10 Copyrighted by Edmund Malesky. Do not distribute without permission.

Required Readings  Wooldridge, Jeffrey M. 2008. Introductory Economics: A Modern Approach, Volume 4E.  Other brief reading assignments sent out by professor. 12 Copyrighted by Edmund Malesky. Do not distribute without permission.

One Administrative Issue  What do we do to make-up for missing classes due to Martin Luther King and President’s Day? Continue with class as normal? Continue with class as normal? Schedule make-up class? Schedule make-up class? Webcast missing class? Webcast missing class? Malesky lectures at TA review sessions? Malesky lectures at TA review sessions? 13 Copyrighted by Edmund Malesky. Do not distribute without permission.

Optional Readings Baum, Christopher. 2008. An Introduction to Modern Econometrics Using Stata.” Stata Press. http://www.stata.com/bookstore/statabooks.html http://www.stata.com/bookstore/statabooks.html Xiao Chen, Philip B. Ender, Michael Mitchell & Christine Wells. 2006. Stata Web Books: Regression with Stata. http://www.ats.ucla.edu/stat/stata/webbooks/reg/default.htm http://www.ats.ucla.edu/stat/stata/webbooks/reg/default.htm Zorn, Christopher. Stata for Dummies http://www.buec.udel.edu/yatawarr/Stata4Dummies.pdf Acock, Alan. 2005. A Gentle Introduction to Stata. http://www.stata.com/bookstore/statabooks.html 14 Copyrighted by Edmund Malesky. Do not distribute without permission.

A New Way of Studying  Excelling in QM2 requires a different approach to learning than in many other classes at IRPS.  This course is about skill acquisition. The speed-reading, participation, and writing skills that you have fine-tuned in other courses are important, but they will serve you less well here.  At the end of the day, you will be evaluated on your ability to understand and employ OLS regression in policy analysis. Period. 15 Copyrighted by Edmund Malesky. Do not distribute without permission.

Lectures  I will provide you with my lecture notes at the end of every class.  Do not feel obligated to type everything I say.  You will do much better if you simply listen, ask questions, and record a few important issues.  Stop me if you don’t understand. Probably half or more of the class is also confused. Probably half or more of the class is also confused. If you didn’t understand slide 10, you will not understand slide 11, and …ZZZZZZZZZZZZZ If you didn’t understand slide 10, you will not understand slide 11, and …ZZZZZZZZZZZZZ 17 Copyrighted by Edmund Malesky. Do not distribute without permission.

STATA  Learning to write a.do file is like learning to speak another language. All of you have mastered this ability before.  Keep your own glossary of commands and syntax that I introduce to you in the course. The process will help you remember the code and give you a personalized reference guide.  Feel free to make use of the help function, pull- down menus, and the UCLA statistics website.  When using help, look most carefully at examples. 18 Copyrighted by Edmund Malesky. Do not distribute without permission.

Homework  Feel free to work in groups, but make sure you write-up your own final.do file. Do not cut and paste the work of others. After the group session, do the write-up and.do file on your own. That will help you know if you really understand it. 19 Copyrighted by Edmund Malesky. Do not distribute without permission.

Prof. and TA Availability Prof Malesky Office Hours: MW 3 to 4 and by appointment. Kevin   OH/Breakout: Thursday, 3:30 pm Matt   OH/Breakout: 20 Copyrighted by Edmund Malesky. Do not distribute without permission.

Any Questions? 21 Copyrighted by Edmund Malesky. Do not distribute without permission.

The Linear Regression Model Approach to Research Otherwise known as…… Advanced Line Drawing 22 Copyrighted by Edmund Malesky. Do not distribute without permission.

 The “General Linear Model” refers to a class of statistical models which are “generalizations” of simple linear regression analysis.  Regression is the predominant statistical tool used in the social sciences due to its simplicity and versatility.  Also called Linear Regression Analysis. General Linear Model 23 Copyrighted by Edmund Malesky. Do not distribute without permission.

Notations for Regression Line  Alternate Mathematical Notation for the straight line th Grade Geometry th Grade Geometry Statistics Literature Statistics Literature Econometrics Literature Econometrics Literature  Y = β 0 + β 1 X + u Wooldrigde uses this specification, so we will too! 24 Copyrighted by Edmund Malesky. Do not distribute without permission.

Translating Math into English  The linear model states that the dependent variable is directly proportional to the value of the independent variable.  Thus, if a theory implies that Y increases in direct proportion to an increase in X, it implies a specific mathematical model of behavior - the linear model.  E.g. “It’s the economy, stupid!” 25 Copyrighted by Edmund Malesky. Do not distribute without permission.

Simple Linear Regression: The Basic Mathematical Model  Regression is based on the concept of the simple proportional relationship  A.K.A... the straight line.  We can express this idea mathematically!  Y = β 0 + β 1 X + u 26 Copyrighted by Edmund Malesky. Do not distribute without permission.

The Theory Implies the Math  ALL statements of relationships between variables imply a mathematical structure.  Even if we don’t like to phrase our theories in these terms, they DO imply mathematical relationships.  Much of this course is about elaborating the basic model to fit our more nuanced theories. 27 Copyrighted by Edmund Malesky. Do not distribute without permission.

Implications of a Linear Model  The linear aspect means that the same increase in inflation will always produce the same reduction in presidential approval.  This is perhaps the most restrictive of all the assumptions of OLS.  We will work to loosen this assumption through the quarter. 28 Copyrighted by Edmund Malesky. Do not distribute without permission.

The Regression Parameters  β 0 = the intercept the point where the line crosses the Y-axis. the point where the line crosses the Y-axis. (the value of the dependent variable when all of the independent variables = 0) (the value of the dependent variable when all of the independent variables = 0)  β 1 = the slope the increase in the dependent variable per unit change in the independent variable (also known as the 'rise over the run') the increase in the dependent variable per unit change in the independent variable (also known as the 'rise over the run') 29 Copyrighted by Edmund Malesky. Do not distribute without permission.

Regression in a Perfect World…  Y = 1X 30 Copyrighted by Edmund Malesky. Do not distribute without permission.

…but life is full of errors…  Y = 1X + u 31 Copyrighted by Edmund Malesky. Do not distribute without permission.

The Error Term  Our models do not predict behavior perfectly. Life is not a “Just So” Story. Life is not a “Just So” Story.  So we add a term to adjust or compensate for the errors in prediction (u).  Much of our ability to estimate β 1 depends upon the assumptions we make about the errors (u).  Sometimes u is called the “Disturbance” 32 Copyrighted by Edmund Malesky. Do not distribute without permission.

The 'Goal' of Ordinary Least Squares  Ordinary Least Squares (OLS) is a method of finding the linear model which minimizes the sum of the squared errors.  Such a model provides the best explanation/prediction of the data.  It is the “Best Linear Unbiased Estimator” It’s BLUE It’s BLUE 33 Copyrighted by Edmund Malesky. Do not distribute without permission.

Other Goals are Possible  Minimize total errors  Minimize Absolute Value of Errors  Maximum Likelihood Models OLS is a special case of MLE OLS is a special case of MLE 34 Copyrighted by Edmund Malesky. Do not distribute without permission.

Why Least Squared error?  Why not simply minimum error?  The errors about the line sum to 0.0!  Minimum absolute deviation (error) models now exist, but they are mathematically cumbersome.  Try algebra with | Absolute Value | signs! 35 Copyrighted by Edmund Malesky. Do not distribute without permission.

Implications of Squared Errors  This model seeks to avoid BIG misses  A big u for one case leads to a REALLY big u 2.  This means regression results can be heavily influenced by outlier cases  Some feel this is theoretically appropriate  Always look at your data 36 Copyrighted by Edmund Malesky. Do not distribute without permission.

Minimizing the Sum of Squared Errors  How to put the Least in OLS?  In mathematical jargon we seek to minimize the residual sum of squares (SSR), where: 37 Copyrighted by Edmund Malesky. Do not distribute without permission.

Picking the Parameters  To Minimize SSR, we need parameter estimates.  In calculus, if you wish to know when a function is at its minimum, you take the first derivative.  In this case we must take partial derivatives since we have two parameters (β 0 & β 1 ) to worry about. 38 Copyrighted by Edmund Malesky. Do not distribute without permission.

How “good” does it fit?  To measure “reduction in errors” we need a benchmark variable is a relevant and tractable benchmark for comparing predictions for comparison.  The mean of the dependent.  The mean of Y represents our “best guess” at the value of Y i absent other information. 39 Copyrighted by Edmund Malesky. Do not distribute without permission.

Sums of Squares  This gives us the following 'sum-of- squares' measures: SST=Total Sum of Squares SST=Total Sum of Squares SSE= Explained Sum of Squares SSE= Explained Sum of Squares SSR= Residual (Unexplained Sum of Squares) SSR= Residual (Unexplained Sum of Squares)  Total Variation (SST) = Explained Variation (SSE) + Unexplained Variation (SSR) 40 Copyrighted by Edmund Malesky. Do not distribute without permission.

“Explained and “Unexplained” Variation XiXiXiXi yiyiyiyi 41 Copyrighted by Edmund Malesky. Do not distribute without permission.

“Explained and “Unexplained” Variation XiXiXiXi yiyiyiyi Square this quantity and sum across all observations and we have our SST (Total Sum of Squares) Square this quantity and sum across all observations and we have our SSE (Explained Sum of Squares) Square this quantity and sum across all observations and we have our SSR (Residual Sum of Squares) 42 Copyrighted by Edmund Malesky. Do not distribute without permission.

Some Confusing Terminology  Occasionally you may see people refer instead to USS (Unexplained) and ESS (Error)  These terms are interchangeable, but…  ESS can be confused with explained sum of squares  USS is not confused with any mathematical jargon, but does pose issues for statistical work on the US Navy. 43 Copyrighted by Edmund Malesky. Do not distribute without permission.

Let’s Test Some “Theories”  Presidential approval depends upon the performance of the US economy  The development of US military power was a response to America’s threatening environment 44 Copyrighted by Edmund Malesky. Do not distribute without permission.

Plotting Approval and Inflation 45 Copyrighted by Edmund Malesky. Do not distribute without permission.

Regressing Approval on Inflation . reg approve inflat  Source | SS df MS Number of obs = 46  ---------+------------------------------ F( 1, 44) = 17.20  Model | 1960.60398 1 1960.60398 Prob > F = 0.0002  Residual | 5015.26094 44 113.983203 R-squared = 0.2811  ---------+------------------------------ Adj R-squared = 0.2647  Total | 6975.86492 45 155.01922 Root MSE = 10.676  ------------------------------------------------------------------------------  approve | Coef. Std. Err. t P>|t| [95% Conf. Interval]  ---------+--------------------------------------------------------------------  inflat | -2.213684.5337539 -4.147 0.000 -3.289394 -1.137973  _cons | 63.80565 2.711964 23.527 0.000 58.34004 69.27125  ------------------------------------------------------------------------------ 46 Copyrighted by Edmund Malesky. Do not distribute without permission.

Fitting Inflation to Approval 47 Copyrighted by Edmund Malesky. Do not distribute without permission.

Plotting US Power & Disputes 48 Copyrighted by Edmund Malesky. Do not distribute without permission.

Regress US Power on Disputes . reg uscapbl numtargt  Source | SS df MS Number of obs = 177  ---------+------------------------------ F( 1, 175) = 18.61  Model |.110444241 1.110444241 Prob > F = 0.0000  Residual | 1.03834672 175.00593341 R-squared = 0.0961  ---------+------------------------------ Adj R-squared = 0.0910  Total | 1.14879096 176.006527221 Root MSE =.07703  ------------------------------------------------------------------------------  uscapbl | Coef. Std. Err. t P>|t| [95% Conf. Interval]  ---------+--------------------------------------------------------------------  numtargt |.0201142.0046621 4.314 0.000.010913.0293155  _cons |.1455665.0067132 21.684 0.000.1323172.1588157  ------------------------------------------------------------------------------ 49 Copyrighted by Edmund Malesky. Do not distribute without permission.

Fitting Disputes to US Power 50 Copyrighted by Edmund Malesky. Do not distribute without permission.

A Brief Review of Critical Concepts  Measures of Central Tendency (Mean, Median, Mode)  Population Variance  Standard Deviation  Covariance  Correlation  Marginal Effect 51 Copyrighted by Edmund Malesky. Do not distribute without permission.

Distributions – The Usual Suspects  Normal Distribution  Standard Normal  Chi-Square  t  F 52 Copyrighted by Edmund Malesky. Do not distribute without permission.

The Normal Distribution (Probability Density Function) x µ 53 Copyrighted by Edmund Malesky. Do not distribute without permission.

The Standard Normal Distribution (PDF) Z 0 54 Copyrighted by Edmund Malesky. Do not distribute without permission.

Chi-Square Distribution f(x) x df=2 df=4 df=6 55 Copyrighted by Edmund Malesky. Do not distribute without permission.

t-distribution: The Statistical Workhorse 0 3-3 df=2 df=4 df=6 As the degrees of freedom increase, the t-distribution approaches the normal distribution. 56 Copyrighted by Edmund Malesky. Do not distribute without permission.

Quick Review: Hypothesis Testing  In STATA, the null hypothesis for a two- tailed t-test is: H 0: β j =0 57 Copyrighted by Edmund Malesky. Do not distribute without permission.

Quick Review: Hypothesis Testing  To test the hypothesis, I need to have a rejection rule. That is, I will reject the null hypothesis if, t is greater than some critical value (c). c is up to me to some extent, I must determine what level of significance I am willing to accept. For instance, if my t- value is 1.85 with 40 df and I was willing to reject only at the 5% level, my c would equal 2.021 and I would not reject the null. On the other hand, if I was willing to reject at the 10% level, my c would be 1.684, and I would reject the null hypotheses. 58 Copyrighted by Edmund Malesky. Do not distribute without permission.

t-distribution: 5 % rejection rule for the that H 0: β j =0 with 25 degrees of freedom Rejection Region Area=.025 Rejection Region Area=.025 0 Looking at table G- 2, I find the critical value for a two- tailed test is 2.06 2.06-2.06 59 Copyrighted by Edmund Malesky. Do not distribute without permission.

Quick Review:  But this operation hides some very useful information.  STATA has decided that it is more useful to provide what is the smallest level of significance at which the null hypothesis would be rejected. This is known as the p-value.  In the previous example, we know that.05<p<.10.  To calculate the p, STATA computes the area under the probability density function. 60 Copyrighted by Edmund Malesky. Do not distribute without permission.

T-distribution: Obtaining the p-value against a two-sided alternative, when t=1.85 and df=40. P-value=P(|T|>t) In this case, P(|T|>1.85)= 2P(T>1.85)=2(.0359) =.0718 Area=.9282 Rejection Region Area=.0359 Rejection Region Area=.0359 0 61 Copyrighted by Edmund Malesky. Do not distribute without permission.

F Distribution f(x) x df=2,8 df=6,8 df=6,20 F and Chi Square testing involves only a one-tailed test of the area underneath the right portion of the curve. 62 Copyrighted by Edmund Malesky. Do not distribute without permission.

Similar presentations