panel

29
Panels Fixed effects Random effects Difference-in-differences and panels Panel Data Walter Sosa-Escudero Walter Sosa-Escudero Panel Data

Upload: roger-asencios-nunez

Post on 03-Oct-2015

212 views

Category:

Documents


0 download

DESCRIPTION

Econometria

TRANSCRIPT

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Panel Data

    Walter Sosa-Escudero

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    A quick introduction to standard panel methods.

    Mostly and application of FWL and GLS theory.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Why panels?

    Example (Cronwell y Trumbull): Determinants of crime

    y = g(I), y = crime, I = criminal justice variables.

    Cross sectoin: (yi, Ii) for several regions i = 1, . . . , n

    I is important

    Criticism: I captures the effect of other regional effects.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    There is an omitted variable, likely related to I.

    OLS that regressesa y on I is biased.

    Solution? Control for this omitted variable.

    Panels to the rescue: a feasible solution without using othervariables

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    A simple linear panel model

    yit = xit + uit

    uit = i + it

    i = 1, . . . , N, t = 1, . . . , T . xit, a vector of K explanatoryvariables, including a constant.

    i captures the effect of non-measured effects that vary byindividuals only. it is the standard errror term.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Fixed effects estimation

    yit = xit + i + it

    Estimates and i as extra parameters.

    It can be seen as a standard linear model where each individual hasits own intercept:

    yit = i + 1 +2 x2,it + + K xK,it + itAdd N 1 individual level dummy variables.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    In matrix termsY = X +D+ u

    Y is NT 1, X is NT K, X includes and intercept.D is a matrix of N 1 individual level dummy variables.

    1N

    11...1

    , Z =

    1N 0 00 1N 0

    ......

    . . ....

    0 0 1N

    NT(N1)

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Write the model as:

    Y = X +D+ u = X + u

    with X [X D] y [ ].Then, the fixed effects estimator is:

    EF =

    (EFEF

    )= (X X)1X Y.

    Just the OLS estimator adding N 1 individual level dummies.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Fixed effects and the within transformation

    If the interest is in estimating , by the Frisch-Waugh-Lovell result,we can do

    = (XX)1X

    Y

    where X MDX, and MD = I D(DD)1D, the matrix thatprojects X on the orthogonal complement of D. Y is definedaccordingly.

    As a simple exercise, show

    Xit = Xit XiThat is, getting rid of the dummies in the first step amounts tosubstracting individual level means. This is the within tranformation.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    The FWL Theorem suggests two forms of obtaining the fixedeffects estimator

    1 Regress Y on X and D.

    2 First demean all data with respect to individual means. Thendo OLS with demeaned data

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Fixed effects and unobserved heterogeneity

    FE is unbiased, independently of whether X is correlatedwith D (FE controls for D).

    If the ommited variable in our example varies only at theindividual level, it is as if we had controlled for it withoutobserving it.

    Intuition: the within transformation kills every variable thatvaries at the individual level only, observed or not.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Biases: graphical representation

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Verbalization

    Y = crime rate.

    X = ineficiency of judicial system (more inefficiency, morecrime).

    Two regions

    An omitted crime determinant that varies only by region andpositively correlated with judicial inefficienty (populationdensity?).

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    OLS

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Fixed effects

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Random effects estimator

    Same modelY = X +D+

    If seen as a random variable D es orthogonal to X, and ifE(i|X) = 0, then the OLS estimator that regresses Y on X isunbiased.

    That is, if D is orthogonal to X, omitting the dummy variablesdoes not bias OLS.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Fixed or random?

    Careful. It is a matter of treatment/estimation.

    Y = X +D+

    Fixed effects (controls for D)

    Y = X +D+

    Random effects (treats D as an omitted variable)

    Y = X +D+

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Y = X +D+

    Y = X + u, u D+ Problem: u does not satisfy the classical assumptions, even whenD and do.

    Simple proof: assume classical assumptions separately (zero expectedvalue, no serial correlation/heteroskedasticity). Also D and uncorrelated. Then

    V (u) = V (D+ )

    = DV ()D + V ()= 2DD

    + 2 INT ,

    certainly non-spherical.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Intuition: uit = i + it

    Trivially, uit is correlated with ui,t1 since both share i: thepersistent presence of i implies that random effects induceserial correlation.

    Though not biased, OLS is inefficient (in the sense discussedin class).

    Efficient? GLS.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    GLS random effects

    RecallGLS = (X

    1X)1X 1Y

    In our caseV (u) = 2DD

    + 2 INT ()with = (2, 2 )

    FGLS requires to estimate first (variance components).

    Random effects estimator: GLS for random effects.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Summary

    Y = X +D+

    X D: OLS, FE, RE are unbiased for . RE is efficient.X D: only EF is unbiased for .Most practitioners use FE.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Hausman test

    H0 : X D, HA : X D

    Hausman Test: under H0

    H = (EA EF )(EF EA)1(EA EF ) 2(K)

    Reject if H is significantly high.

    Intuition: under H0, EA y EF are consistent, H should be small.Under HA, only EF is consistent, H should be lasrge.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Panels and impact evaluation

    Motivation: effect of minimum wages on employment (Card,Krueger (1994)).

    Intuition: minimum wage (MW) reduces employment.

    Compare employment in McDonalds before and after MWwage changes? Confounds MW effect with temporal changes.

    Compare employment in McDonalds, same period, two stateswith different MW policies? Confounds MW with regionaldeterminants.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    A very simple context

    Unit of analysis: restaurant i in state s in period t.

    Variable of interest: Yits : employment in restaurant its.

    Two periods: t = 1, 2

    Two states: A,B.

    N restaurants per state.

    MW is a state policy.

    State A does not change MW. Only B does it, in period 2.

    Dist = 1 if state s changes MW in t, 0 otherwise.

    Note that in our case Dist = 1 iff s = B y t = 2.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Additive structure:

    Yits = s + t + Dist + ist

    is the key parameter: effect of MW controlling for regional(s) and temporal (t) factors that confound MW in thedetermination of employment.

    We will assume that given s and t, Dst is exogenous.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Estimation 1: Differences in differences

    Yits = s + t + Dist + ist

    Note

    E(Y |B, 2) E(Y |B, 1) = 2 1 + E(Y |A, 2) E(Y |A, 1) = 2 1

    Substracting[E(Y |B, 2) E(Y |B, 1)

    ]

    [E(Y |A, 2) E(Y |A, 1)

    ]=

    Change in B Change in A =

    = Average change in B Average change in A

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Estimation 2: Panels

    Yits = s + t + Dist + ist

    DBist = 1 iff i is in state B

    D2ist = 0 iff t = 2.

    Then, by construction Dist = DBist D2ist (change occursonly in state B and in period 2).

    Replacing:

    Yits = s + t + (DBist D2ist) + ist

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Yits = s + t + (DBist D2ist) + ist

    It is a panel of N restaurants in 2 regions and 2 periods, withregional and period specific fixed effects.

    Regress Yits on 1) dummy for region B, 2) dummy for period2) interaction between both.

    The parameter of interest is the coefficient of the interactionterm.

    Walter Sosa-Escudero Panel Data

  • PanelsFixed effects

    Random effectsDifference-in-differences and panels

    Comments

    Panel estimation facilitates computation of standard errorsand hypothesis tests.

    Common trends: crucial. Both states share t: thetemporal evolution of employment in both states is identical.Treatment (MW change) implies departing away from thiscommon trend.

    No serial correlation: key assumption for inference. SeeBertrand, Duflo, y Mullainathan (2004) on cluster correlation.

    Walter Sosa-Escudero Panel Data

    PanelsFixed effectsRandom effectsDifference-in-differences and panels