Post on 28-Aug-2019
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Applied Econometrics (QEM)Using Indicator Variables
based on Prinicples of Econometrics
Jakub Mućk
Department of Quantitative Economics
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 1 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Outline
1 Indicator Variables
2 Applying Indicator VariablesChow test
3 The Linear Probability Model
4 Treatment EffectsDifferences-in-Differences estimator
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 2 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Indicator Variables
Indicator variables (binary or dummy variables) are used toaccount for qualitative factors.Indicator variables (binary or dummy variables) take just twovalues, 0 or 1, to indicate the presence or absence of a characteristic orto indicate whether a condition is satisfied or not.For instance:
D ={
1 if charactersitics is present0 if charactersitics is not present (1)
The least squares estimator’s properties are not affected if the dummyvariable used as the explanatory variable.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 3 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Example
Consider the following model:
PRICE = β0 + β1SQFT + ε (2)
where:PRICE is the house price,SQFT is the size of the house measured in square feet.
In addition, consider the following a qualitative variable:
D ={
1 if property is in the desirable neighborhood0 if property is not in the desirable neighborhood (3)
The indicator variable D can be used control for change in:intercept,slope,intercept and slope.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 4 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Case # 1:
PRICE = β0+β1SQFT +β2D+ε
thenE (PRICE) ={
β0 + β1SQFT + β2 if D = 1,β0 + β1SQFT if D = 0.
PRICE
SQFTβ0
β0 + β2
β2
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 5 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Reference group
Consider the following dummy variable:
LD ={
1 if property is not in the desirable neighborhood0 if property is in the desirable neighborhood (4)
The variables D and LD are such that their sum equals 1, i.e., D+LD =1Including both dummy variables:
PRICE = β0 + β1SQFT + β2D + β3LD + ε (5)
is not feasible due to collinearity.To avoid dummy variable trap only one indicator variable is in-cluded.The omitted variable defines the reference group or base group.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 6 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Case # 2 (Interaction variable):
PRICE = β0 + β1SQFT + β2DSQFT + ε
then:
E (PRICE) =
={
β0 + (β1 + β2)SQFT if D = 1,β0 + β1SQFT if D = 0.
New variable DSQFT is called aslope-indicator variable or a slopedummy variable.
The slope can be expressed:
∂E (PRICE)∂SQFT
={
β1 + β2 if D = 1β1 if D = 0
PRICE
SQFTβ0
β2
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 7 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Case # 3:
PRICE = β0 +β1SQFT +β2 +β3DSQFT +ε
then:E (PRICE) =
={
β0 + β2 + (β1 + β3)SQFT if D = 1,β0 + β1SQFT if D = 0.
The slope can be expressed:
∂E (PRICE)∂SQFT
={
β1 + β3 if D = 1β1 if D = 0
PRICE
SQFTβ0
β0 + β2 β2
β3
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 8 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsChow test
Outline
1 Indicator Variables
2 Applying Indicator VariablesChow test
3 The Linear Probability Model
4 Treatment EffectsDifferences-in-Differences estimator
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 9 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsChow test
Time series and dummy variables
Seasonal dummies are indicator variables that allow to control foran effect for different seasons of the year. For instance:
quarterly dummies, e.g., DQ1 takes the value 0 for the observationin the first quarter (and 0 in the remaining quarters).monthly dummies, e.g., DM3 takes the value 0 for the observationin March (and 0 in the remaining months).
Indicator variables can be used in time series context to account forregime effects (regime change). For example,
Dummy capturing change after the financial crisis in 2007:
DFC ={
0 if t ≤ 2007,1 if t > 2007.
where t is the time index.However, the DFC dummy has different interpretation than dummy foronly crisis period, i.e., I (t > 2007 & t ≤ 2009)
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 10 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsChow test
Time series and dummy variables
Seasonal dummies are indicator variables that allow to control foran effect for different seasons of the year. For instance:
quarterly dummies, e.g., DQ1 takes the value 0 for the observationin the first quarter (and 0 in the remaining quarters).monthly dummies, e.g., DM3 takes the value 0 for the observationin March (and 0 in the remaining months).
Indicator variables can be used in time series context to account forregime effects (regime change). For example,
Dummy capturing change after the financial crisis in 2007:
DFC ={
0 if t ≤ 2007,1 if t > 2007.
where t is the time index.However, the DFC dummy has different interpretation than dummy foronly crisis period, i.e., I (t > 2007 & t ≤ 2009)
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 10 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsChow test
Chow test I
The Chow test is a statistical procedure designed to test equivalence oftwo regressions.Consider the regression model:
y = β0 + β1x1 + . . . βkxk + ε, (6)
and the dummy variable D which can split the sample into two subsamples.In general, if both constant and slopes are different in subsamples then theregression model can be rewritten as:
y = β0,0 + β1,0x1 + . . . βk,0xk + β0,1D + β1,1Dx1 + . . . βk,1Dxk + ε, (7)
then the constant β0,0 and slopes β1,0, . . . , βk,0 are true parameters in the base(reference) group of observations while intercepts β0,1 and slopes β1,1, . . . , βk,1are the true parameters in the remaining subsample.If we consider the case that all parameters differ between subsamples then wecan obtain the parameters β0, β1, . . . , βk by estimating separate regressionsfor each subsample.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 11 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsChow test
Chow test IIThe null in the Chow test is about no differences between subsamples:
H0 : β0 = β0,0 = β0,1 ∧ . . . ∧ βk = βk,0 = βk,1
while under the alternative at least one parameter is different betweensamples.The standard F statistics:
F = (SSER − SSEU ) /JSSEU/ (N −K) , (8)
J is the number of coefficients considered in the null hypothesis.N is the number of observations,K is the number of coefficients in the unrestricted model,SSER is sum of squared error in restricted model,SSEU is sum of squared error in unrestricted model,
If we consider the alternative hypothesis when all slopes are heterogeneousthen SSEU is the sum of SSE from two regression for respective subsamples,i.e., SSEU = SSE1 + SSE2.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 12 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsChow test
Remarks on the Chow test
The F statistic relies on the assumption A#1-A#6 of the linear test.In particular, it uses the assumption that the variance of the error termis constant, i.e., var(εi) = σ2 for all observation.If the variance of the error term is different in subsamples (heteroskedas-ticity) then the usual F test is not valid.The Chow test can be used in more flexible way, for instance to testwhether only the subset of slopes is the same. In this cases, the Fstatistic bases on the regression with split dummies.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 13 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsChow test
The Chow test and time series
As regards, the indicator variable in time series context can be intro-duced to capture the effect of regime change. For instance, dummycapturing change after the financial crisis in 2007:
DFC ={
0 if t ≤ 2007,1 if t > 2007.
Using such dummy variable in Chow test we test the presence of astructural break (structural change) at a period which can beassumed to be known a priori (in our case financial crisis in 2007).Structural break (structural change) is unexpected shift in themodel parameters.Viewed from the empirical perspective, the Chow test can be performedto subset of parameters.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 14 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Outline
1 Indicator Variables
2 Applying Indicator VariablesChow test
3 The Linear Probability Model
4 Treatment EffectsDifferences-in-Differences estimator
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 15 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
Binary choice model
The indicator variables are used as dependent variable when researchersare trying to explain the choice.The dependent variable takes the value 0 or 1:
y ={
0 if first alternative is chosen,1 if second alternative is chosen.
The probability that the first alternative is chosen is P [y = 1] = p whilethe probability that the second alternative is chosen is P [y = 0] = 1−p.The probability function for the binary indicator variable y:
f (y) = py (1− p)y.
where y ∈ {0, 1} =⇒ y follow a Bernoulli distribution.The expected value of y: E(y) = p,The variance of y : var(y) = p(1− p).
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 16 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment Effects
The Linear Probability Model
Linear probability model:
E(y) = p = β0 + β1x1 + . . .+ βkxk . (9)
and the corresponding econometric model:
y = E(y) + ε = β0 + β1x1 + . . .+ βkxk + ε, (10)
The variance of the error term:
var(ε) = p(1− p)= (β0 + β1x1 + . . .+ βkxk) [1− (β0 + β1x1 + . . .+ βkxk)]
is not constant and, therefore, the error term is not homoskedastic(heteroskedastic).Very often, the predicted values p are out of the (0,1) interval.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 17 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Outline
1 Indicator Variables
2 Applying Indicator VariablesChow test
3 The Linear Probability Model
4 Treatment EffectsDifferences-in-Differences estimator
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 18 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Correlation is not the same as causation
For researchers, it is important to avoid the faulty line of reasoningknown as post hoc, ergo propter hoc
One event’s preceding another does not necessarily make the first thecause of the second.Correlation is not the same as causation.
Selection bias is an issue when a proper randomization is not achieved,i.e., the sample is not random.Selection bias arises also when the method of collecting samples isnot appropriate.Selection bias may be critical for measuring a causal effect (treat-ment effect). If selection bias is not taken into account the results ofstatistical inference may be not valid.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 19 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Treatment Effects
Randomized controlled experiment. To avoid selection bias re-searchers would like to randomly assign items to a treatment group,with others being treated as a control group. As a result, two groupscan be compared.In economics, performing randomized controlled experiment is limited.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 20 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
The difference estimator I
The indicator variable d:
d ={
1 if individual in treatment group,0 if individual in control group.
The regression function is conditional to treatment:
E(yi) ={
β1 + β2 if individual in treatment group,di = 1,β1 if individual in control group,di = 0.
The econometric model:
yi = β1 + β2di + εi , i = 1, . . . ,N . (11)
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 21 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
The difference estimator IIIn this simplified case the least square estimator for the treatment effectβ2:
βLS2 =
∑Ni=1
(di − di
)(yi − y)∑N
i=1
(di − di
)2 = y1 − y0, (12)
while y1 and y0 are the samples averages in treatment and control group,respectively.βLS
2 is also called the difference estimator.Unbiasedness. The expected value of the difference estimator βLS
2 :
βLS2 = β2 +
∑Ni=1
(di − di
)(εi − ε)∑N
i=1
(di − di
)2 = β2 + ε1 − ε2, (13)
the potential bias:
E (ε1 − ε2) = E (ε1)− E (ε2) = 0. (14)
However, If we allow individuals to self-select into treatment and controlgroups then E (ε1)− E (ε2) is the selection bias of the treatment effect.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 22 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Fixed effextsIf conditioning factors are omitted in regression then difference estimator isbiased.Popular strategy is to introduce fixed effects which captures unobservablefactors determining outcome:.[Example] Project STAR
TOTALSCORE = β0 + β1SMALL + ε, (15)where
TOTALSCORE – the combined reading and math achievement scores,SMALL – indicator variable which takes 1 if the student was assignedto a small class.
School fixed effects:
schoolj ={
1 if student is in school j,0 if otherwise.
The extended regression:
TOTALSCORE = β0 + β1SMALL +S∑
j=1
δjschoolj + ε, (16)
where δj is the fixed effect for the j-th school..Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 23 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Treatment Effects. General remarks
The common strategy is to control for effect of conditioning factors.This could be done with adding explanatory variables.Another way to check for random assignment is to regress treatmentvariable on these characteristics and check for any significant coeffi-cients.
This is equivalent with the linear probability model for the treatmentvariable.
If there is random assignment, we should not find any significant rela-tionships
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 24 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Differences-in-Differences estimator
In Differences-in-Differences ap-proach estimation of the treatmenteffect is based on data averages forthe two groups (treatment (T) andcontrol (C)) in the two periods (be-fore (B) and after (A)):
δ = (yT,A − yC,A)− (yT,B − yC,B) .
y
Before After
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 25 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Differences-in-Differences estimator
In Differences-in-Differences ap-proach estimation of the treatmenteffect is based on data averages forthe two groups (treatment (T) andcontrol (C)) in the two periods (be-fore (B) and after (A)):
δ = (yT,A − yC,A)− (yT,B − yC,B) .
y
Before After
Control
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 25 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Differences-in-Differences estimator
In Differences-in-Differences ap-proach estimation of the treatmenteffect is based on data averages forthe two groups (treatment (T) andcontrol (C)) in the two periods (be-fore (B) and after (A)):
δ = (yT,A − yC,A)− (yT,B − yC,B) .
y
Before After
Control
Treatment
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 25 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Differences-in-Differences estimator
In Differences-in-Differences ap-proach estimation of the treatmenteffect is based on data averages forthe two groups (treatment (T) andcontrol (C)) in the two periods (be-fore (B) and after (A)):
δ = (yT,A − yC,A)− (yT,B − yC,B) .
y
Before After
Control
Treatment
Treatment group with unobserved trend
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 25 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Differences-in-Differences estimator
In Differences-in-Differences ap-proach estimation of the treatmenteffect is based on data averages forthe two groups (treatment (T) andcontrol (C)) in the two periods (be-fore (B) and after (A)):
δ = (yT,A − yC,A)− (yT,B − yC,B) .
y
Before After
Control
Treatment
Treatment group with unobserved trend
Treatment effect=δ
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 25 / 26
Indicator VariablesApplying Indicator VariablesThe Linear Probability Model
Treatment EffectsDifferences-in-Differences estimator
Differences-in-Differences estimator
Consider the regression:
yit = β1+β2TREATi+β3AFTERt+δ (TREATi ×AFTERt)+εit (17)
the expected outcome
E(yit) =
β1 if TREAT = 0 AFTER = 0β1 + β2 if TREAT = 1 AFTER = 0β1 + β3 if TREAT = 0 AFTER = 1β1 + β2 + β3 + δ if TREAT = 1 AFTER = 1
(18)
The least squares estimates of treatment effect:
δLS = (yT,A − yC,A)− (yT,B − yC,B) . (19)
D-i-D can be applied in more general regression.Using the panel data techniques we can control for unobserved hetero-geneity.
Jakub Mućk Applied Econometrics (QEM) Meeting #5 Using Indicator Variables 26 / 26