Dummy Variables and Interactions. Dummy Variables What is the the relationship between the % of non-Swiss residents (IV) and discretionary social spending.

Slides:



Advertisements
Similar presentations
Qualitative predictor variables
Advertisements

CHOW TEST AND DUMMY VARIABLE GROUP TEST
EC220 - Introduction to econometrics (chapter 5)
Christopher Dougherty EC220 - Introduction to econometrics (chapter 1) Slideshow: exercise 1.7 Original citation: Dougherty, C. (2012) EC220 - Introduction.
Sociology 601 Class 24: November 19, 2009 (partial) Review –regression results for spurious & intervening effects –care with sample sizes for comparing.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 1) Slideshow: exercise 1.16 Original citation: Dougherty, C. (2012) EC220 - Introduction.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 4) Slideshow: interactive explanatory variables Original citation: Dougherty, C. (2012)
Heteroskedasticity The Problem:
ELASTICITIES AND DOUBLE-LOGARITHMIC MODELS
HETEROSCEDASTICITY-CONSISTENT STANDARD ERRORS 1 Heteroscedasticity causes OLS standard errors to be biased is finite samples. However it can be demonstrated.
Lecture 9 Today: Ch. 3: Multiple Regression Analysis Example with two independent variables Frisch-Waugh-Lovell theorem.
EC220 - Introduction to econometrics (chapter 7)
Christopher Dougherty EC220 - Introduction to econometrics (chapter 3) Slideshow: exercise 3.5 Original citation: Dougherty, C. (2012) EC220 - Introduction.
Sociology 601 Class 25: November 24, 2009 Homework 9 Review –dummy variable example from ASR (finish) –regression results for dummy variables Quadratic.
Sociology 601 Class 28: December 8, 2009 Homework 10 Review –polynomials –interaction effects Logistic regressions –log odds as outcome –compared to linear.
Introduction to Regression Analysis Straight lines, fitted values, residual values, sums of squares, relation to the analysis of variance.
1 Review of Correlation A correlation coefficient measures the strength of a linear relation between two measurement variables. The measure is based on.
1 Michigan.do. 2. * construct new variables;. gen mi=state==26;. * michigan dummy;. gen hike=month>=33;. * treatment period dummy;. gen treatment=hike*mi;
Sociology 601 Class 23: November 17, 2009 Homework #8 Review –spurious, intervening, & interactions effects –stata regression commands & output F-tests.
1 Zinc Data EPP 245 Statistical Analysis of Laboratory Data.
Sociology 601 Class 26: December 1, 2009 (partial) Review –curvilinear regression results –cubic polynomial Interaction effects –example: earnings on married.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 6) Slideshow: variable misspecification iii: consequences for diagnostics Original.
TESTING A HYPOTHESIS RELATING TO A REGRESSION COEFFICIENT This sequence describes the testing of a hypotheses relating to regression coefficients. It is.
SLOPE DUMMY VARIABLES 1 The scatter diagram shows the data for the 74 schools in Shanghai and the cost functions derived from a regression of COST on N.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 5) Slideshow: Chow test Original citation: Dougherty, C. (2012) EC220 - Introduction.
EDUC 200C Section 4 – Review Melissa Kemmerle October 19, 2012.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 5) Slideshow: dummy variable classification with two categories Original citation:
Christopher Dougherty EC220 - Introduction to econometrics (chapter 5) Slideshow: two sets of dummy variables Original citation: Dougherty, C. (2012) EC220.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 5) Slideshow: the effects of changing the reference category Original citation: Dougherty,
Christopher Dougherty EC220 - Introduction to econometrics (chapter 5) Slideshow: dummy classification with more than two categories Original citation:
DUMMY CLASSIFICATION WITH MORE THAN TWO CATEGORIES This sequence explains how to extend the dummy variable technique to handle a qualitative explanatory.
1 INTERACTIVE EXPLANATORY VARIABLES The model shown above is linear in parameters and it may be fitted using straightforward OLS, provided that the regression.
1 TWO SETS OF DUMMY VARIABLES The explanatory variables in a regression model may include multiple sets of dummy variables. This sequence provides an example.
1 PROXY VARIABLES Suppose that a variable Y is hypothesized to depend on a set of explanatory variables X 2,..., X k as shown above, and suppose that for.
Country Gini IndexCountryGini IndexCountryGini IndexCountryGini Index Albania28.2Georgia40.4Mozambique39.6Turkey38 Algeria35.3Germany28.3Nepal47.2Turkmenistan40.8.
Addressing Alternative Explanations: Multiple Regression
EDUC 200C Section 3 October 12, Goals Review correlation prediction formula Calculate z y ’ = r xy z x for a new data set Use formula to predict.
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.
MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE 1 This sequence provides a geometrical interpretation of a multiple regression model with two.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 1) Slideshow: exercise 1.5 Original citation: Dougherty, C. (2012) EC220 - Introduction.
. reg LGEARN S WEIGHT85 Source | SS df MS Number of obs = F( 2, 537) = Model |
Christopher Dougherty EC220 - Introduction to econometrics (chapter 5) Slideshow: exercise 5.2 Original citation: Dougherty, C. (2012) EC220 - Introduction.
Chapter 5: Dummy Variables. DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 We’ll now examine how you can include qualitative explanatory variables.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 4) Slideshow: exercise 4.5 Original citation: Dougherty, C. (2012) EC220 - Introduction.
Special topics. Importance of a variable Death penalty example. sum death bd- yv Variable | Obs Mean Std. Dev. Min Max
COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 6) Slideshow: exercise 6.13 Original citation: Dougherty, C. (2012) EC220 - Introduction.
STAT E100 Section Week 12- Regression. Course Review - Project due Dec 17 th, your TA. - Exam 2 make-up is Dec 5 th, practice tests have been updated.
RAMSEY’S RESET TEST OF FUNCTIONAL MISSPECIFICATION 1 Ramsey’s RESET test of functional misspecification is intended to provide a simple indicator of evidence.
1 CHANGES IN THE UNITS OF MEASUREMENT Suppose that the units of measurement of Y or X are changed. How will this affect the regression results? Intuitively,
SEMILOGARITHMIC MODELS 1 This sequence introduces the semilogarithmic model and shows how it may be applied to an earnings function. The dependent variable.
GRAPHING A RELATIONSHIP IN A MULTIPLE REGRESSION MODEL The output above shows the result of regressing EARNINGS, hourly earnings in dollars, on S, years.
1 In the Monte Carlo experiment in the previous sequence we used the rate of unemployment, U, as an instrument for w in the price inflation equation. SIMULTANEOUS.
F TESTS RELATING TO GROUPS OF EXPLANATORY VARIABLES 1 We now come to more general F tests of goodness of fit. This is a test of the joint explanatory power.
WHITE TEST FOR HETEROSCEDASTICITY 1 The White test for heteroscedasticity looks for evidence of an association between the variance of the disturbance.
VARIABLE MISSPECIFICATION II: INCLUSION OF AN IRRELEVANT VARIABLE In this sequence we will investigate the consequences of including an irrelevant variable.
QM222 Class 9 Section A1 Coefficient statistics
QM222 Class 16 & 17 Today’s New topic: Estimating nonlinear relationships QM222 Fall 2017 Section A1.
QM222 Class 11 Section A1 Multiple Regression
QM222 Class 8 Section A1 Using categorical data in regression
The slope, explained variance, residuals
QM222 Your regressions and the test
QM222 Class 15 Section D1 Review for test Multicollinearity
Covariance x – x > 0 x (x,y) y – y > 0 y x and y axes.
Eva Ørnbøl + Morten Frydenberg
EPP 245 Statistical Analysis of Laboratory Data
Introduction to Econometrics, 5th edition
Introduction to Econometrics, 5th edition
Introduction to Econometrics, 5th edition
Presentation transcript:

Dummy Variables and Interactions

Dummy Variables What is the the relationship between the % of non-Swiss residents (IV) and discretionary social spending (DV) in Swiss municipalities?. reg def_social_head log_pctforeign if year==2005 Source | SS df MS Number of obs = F( 1, 1149) = 0.54 Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = def_social_h~d | Coef. Std. Err. t P>|t| [95% Conf. Interval] log_pctforeign | _cons | Data drawn from 6 different cantons (states).

Dummy Variables. tabstat def_social_head pctforeign, by(canton) Summary statistics: mean by categories of: canton canton | def_so~d pctfor~n | | | | | | Total |

Dummy Variables We can control for the fact that municipalities are drawn from different cantons by allowing the default expectation (intercept) for each canton to vary:. reg def_social_head log_pctforeign i.canton if year==2005 Source | SS df MS Number of obs = F( 6, 1144) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = def_social_h~d | Coef. Std. Err. t P>|t| [95% Conf. Interval] log_pctforeign | | canton | 2 | | | | | | _cons | Canton 1 is a ‘reference category’ – the intercept for canton 1 is “_cons”

Dummy Variables This is not the same as running separate regressions for each canton, because we still assume that the slope is identical for every subgroup. Social Spending = B0 + B1*Log_Pctforeign + B2*Canton1 + B3*Canton2 + B4*Canton3 … For municipalities in Canton 1: Social Spending = B0 + B1*Log_Pctforeign + B2*1 + B3*0+ B4*0 … Social Spending = (B0 + B2) + B1*Log_Pctforeign For municipalities in Canton 2: Social Spending = B0 + B1*Log_Pctforeign + B2*0 + B3*1+ B4*0 … Social Spending = (B0 + B3) + B1*Log_Pctforeign All we are doing is changing the starting value -- allowing the expectation when log_pctforeign = 0 to differ across cantons. B1 still describes the effect of Log_Pctforeign on Social Spending across the entire sample.

Dummy Variables What would happen if I added the following variables to the previous regression: A)Variable that measures whether a canton is German-speaking (1) or French- speaking (0) B)Variable that measures average GDP per capita in the canton. B)Variable that measures whether a municipality allows (1) or does not allow (0) immigrants to vote.

Dummy Variables and Interactions We can allow the relationship between log_pctforeign and def_social_head (the “slope”) to vary for each canton by using interactions: Social Spending = B0 + B1*Log_Pctforeign + B2*Canton1 + B3*Canton2 … + B4*Canton1*Log_Pctforeign + B5*Canton2*Log_Pctforeign … For municipalities in Canton 1: Social Spending = B0 + B1*Log_Pctforeign + B2*1 + B3*0+ B4*1*Log_Pctforeign + B5*0*Log_Pctforeign Social Spending = (B0 + B2) + (B1 + B4)Log_Pctforeign For municipalities in Canton 2: Social Spending = (B0 + B3) + (B1 + B5)Log_Pctforeign This is the same as estimating the relationship between social spending and log_pctforeign separately for each subgroup. We are assuming that the relationship differs in each canton.

Interactions Interactions should be justified by theory. For instance, we might reasonably assume that the relationship between % foreign and social expenditure would be different if municipalities allowed immigrants to vote. Voteright is a variable coded 1 if immigrants have voting rights in a municipality, 0 otherwise.. gen logpctforeignXvoteright = voteright * log_pctforeign. reg def_social_head log_pctforeign logpctforeignXvoteright voteright i.canton if year == def_social_head | Coef. Std. Err. t P>|t| [95% Conf. Interval] log_pctforeign | logpctforeignXvoteright | voteright | | canton | 2 | | | | | | | _cons |

Interactions Social Spending = B0 + B1*Log_Pctforeign + B2*Canton1 + B3*Canton2 + … B4*VotingRights + B5*Log_Pctforeign*VotingRights For non-immigrant voting municipalities in Canton 1: Social Spending = B0 + B1*Log_Pctforeign + B2*1 + B3*0+ +B4*0 + B5*Log_Pctforeign*0 Social Spending = (B0+B2) + B1*Log_Pctforeign For immigrant voting municipalities in Canton 1: Social Spending = B0 + B1*Log_Pctforeign + B2*1 + B3*0+ +B4*1 + B5*Log_Pctforeign*1 Social Spending = (B0+B2+B4) + (B1+B5)*Log_Pctforeign

Direct + Indirect Effects Direct Effect = Multivariate Regression Coefficient Indirect Effect = Bivariate – Multivariate