Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to include dummy variables in panel data?

    Dear Statalist community

    I am trying to find the relationship between public spending (dependent variable) and the amount of immigration (independent variable). The format is in panel data.
    Right now I am going to include dummy variable (adv = advanced economies is equal to 1 and vice versa) and interaction term (migrant_adv = migrant_pop*adv) into the regression. However the dummy is omitted because of collinearity as shown at the end of the post***. I understand that this might be because 'adv' does not vary through countries and time... However, I am quite confused as this means that I can-not include dummy variables into the equation at all? so my questions are.....

    1.Is it possible to include dummy variables in panel data? and how?
    2. If my focus is on the interaction term (controlling for the omitted variable bias that can happen because of group of advanced countries), can I just use the equation...
    Code:
     xtreg govex_gdp migrant_pop migrant_adv  i.year, fe
    ? (without dummy in the regression)

    __________________________________________________ ____________

    ***
    Code:
     xtreg govex_gdp migrant_pop adv migrant_adv  i.year, fe
    i.year _Iyear_1990-2010 (naturally coded; _Iyear_1990 omitted)
    note: adv omitted because of collinearity

    Fixed-effects (within) regression Number of obs = 163
    Group variable: country Number of groups = 35

    R-sq: within = 0.2446 Obs per group: min = 1
    between = 0.0141 avg = 4.7
    overall = 0.0014 max = 5

    F(6,122) = 6.58
    corr(u_i, Xb) = -0.7408 Prob > F = 0.0000

    ------------------------------------------------------------------------------
    govex_gdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    migrant_pop | .6229395 .3631192 1.72 0.089 -.0958912 1.34177
    adv | 0 (omitted)
    migrant_adv | -.1574857 .3894843 -0.40 0.687 -.9285088 .6135374
    _Iyear_1995 | .205332 .5277572 0.39 0.698 -.8394161 1.25008
    _Iyear_2000 | -1.247214 .5390116 -2.31 0.022 -2.314241 -.1801866
    _Iyear_2005 | -1.109176 .5801929 -1.91 0.058 -2.257726 .0393739
    _Iyear_2010 | -.3361596 .6259008 -0.54 0.592 -1.575193 .9028735
    _cons | 15.39561 .9841033 15.64 0.000 13.44748 17.34374
    -------------+----------------------------------------------------------------
    sigma_u | 4.3948045
    sigma_e | 1.9360928
    rho | .8374672 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(34, 122) = 10.77 Prob > F = 0.0000

    Thank you
    Rintarn

  • #2
    The title of your question may lead to some misunderstanding.

    If I understood right, your question only relates to the "within" - fe - effects model in panel data analysis.

    Shall you use random-effects or between-effects, you may add time-invariant variables in the model.

    The reason for that is reported in the Stata Manual.
    Best regards,

    Marcos

    Comment


    • #3
      Guest:
      as an aside to Marcos' helpful insighs, adv might have been omitted due to collinearity with the fixed effect.
      I would also investigate (via -hausman-) whether -re- specification might be better for your data.
      Last edited by sladmin; 02 May 2018, 08:10. Reason: anonymize original poster
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Dear Marcos and Carlo

        Thank you so much! I think I was confused and panic for a bit but now I understand the whole point. Thank you so much!

        Guest
        Last edited by sladmin; 02 May 2018, 08:10. Reason: anonymize poster

        Comment

        Working...
        X