Announcement

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

  • Insert time dummy in a two-period fixed effect

    Hello!
    I am trying to run a fixed effect model over two periods.
    The baseline specification would be as follows:

    xi: xtreg log_amtreceived hh_unemp_ $controls i.dummy_year, fe i(HHid) vce(cluster hh_cluster_var)

    where log_amtreceived are the log of amount of remittances received by a family in the two periods; hh_unempl. is a variable for the unemployment rate (at aggregate level) for the country of destination of migrants and $controls are controls at household level.

    I am in doubt about inserting time dummy (equal one for the second year) since the main explanatory variable is an aggregate for the country and inserting the time dummy changes both the size and p value of its coefficient.


    ************************************

    Here the results with the time dummy:

    . xi: xtreg log_amtreceived hh_unemp_ $controls i.year , fe i(HHid) vce(cluster hh_cluster_var)

    Fixed-effects (within) regression Number of obs = 5312
    Group variable: HHid Number of groups = 2656

    R-sq: within = 0.1000 Obs per group: min = 2
    between = 0.0012 avg = 2.0
    overall = 0.0079 max = 2

    F(9,40) = 229.07
    corr(u_i, Xb) = -0.4692 Prob > F = 0.0000

    (Std. Err. adjusted for 41 clusters in hh_cluster_var)
    ------------------------------------------------------------------------------------
    | Robust
    log_amtreceived | Coef. Std. Err. t P > | t | [95% Conf. Interval]
    -------------------+----------------------------------------------------------------
    hh_unemp_ | .0859445 .0443747 1.94 0.060 -.0037401 .1756292
    HHsize | .151234 .0209391 7.22 0.000 .1089146 .1935534
    district_unemp | .0283284 .0155858 1.82 0.077 -.0031716 .0598284
    N_married_migrants | -.1856449 .0281275 -6.60 0.000 -.2424927 -.1287971
    _IEmpstat_h_1 | .1679094 .0539066 3.11 0.003 .05896 .2768588
    _Iyear_2009 | .4733749 .0449664 10.53 0.000 .3824943 .5642554
    _Inetwork_d_1 | -.0231452 .0945971 -0.24 0.808 -.2143331 .1680426
    _Idummy_mig_1 | .0040378 .104927 0.04 0.969 -.2080276 .2161032
    _Idummy_ret_1 | -1.569813 .1873059 -8.38 0.000 -1.948372 -1.191253
    _cons | 9.295214 .2918716 31.85 0.000 8.70532 9.885108
    -------------------+----------------------------------------------------------------
    sigma_u | 1.4067919
    sigma_e | 1.1583928
    rho | .5959352 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------------


    ************************************


    Here the results without the time dummy:

    . xi: xtreg log_amtreceived hh_unemp_ $controls i.year , fe i(HHid) vce(cluster hh_cluster_var)

    Fixed-effects (within) regression Number of obs = 5312
    Group variable: HHid Number of groups = 2656

    R-sq: within = 0.0583 Obs per group: min = 2
    between = 0.0009 avg = 2.0
    overall = 0.0029 max = 2

    F(8,40) = 41.22
    corr(u_i, Xb) = -0.5754 Prob > F = 0.0000

    (Std. Err. adjusted for 41 clusters in hh_cluster_var)
    ------------------------------------------------------------------------------------
    | Robust
    log_amtreceived | Coef. Std. Err. t P > | t | [95% Conf. Interval]
    -------------------+----------------------------------------------------------------
    hh_unemp_ | .1744832 .0858188 2.03 0.049 .0010368 .3479296
    HHsize | .1246146 .0227986 5.47 0.000 .0785368 .1706923
    district_unemp | .0564183 .0111677 5.05 0.000 .0338476 .0789891
    N_married_migrants | .0316407 .0376425 0.84 0.406 -.0444375 .107719
    _IEmpstat_h_1 | .0493594 .0697033 0.71 0.483 -.0915163 .1902351
    _Inetwork_d_1 | -.1972371 .0894865 -2.20 0.033 -.378096 -.0163782
    _Idummy_mig_1 | .1638427 .114141 1.44 0.159 -.0668448 .3945303
    _Idummy_ret_1 | -1.196149 .194381 -6.15 0.000 -1.589008 -.8032908
    _cons | 8.584137 .4649783 18.46 0.000 7.644381 9.523893
    -------------------+----------------------------------------------------------------
    sigma_u | 1.509236
    sigma_e | 1.1846859
    rho | .61875136 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------------



    Any hints would be appreciated. Thank you

  • #2
    Camilla:
    welcome to this forum.
    Some comments about your query:
    - -xi:- is redundant with -xtreg-; use -fvvarlist- to create categorical variables and interactions instead;
    - in order to avoid formatting issues (that makes your current Stata output annoying/difficult/impossible to read), please use CODE delimiters to share what you typed and what Stata gave you back (see the FAQ on this and other posting-related topics);
    - clustering your standard errors makes sense if you suspect/have evidence that your data suffer from heteroskedasticity and/or autocorrelation (the latter rarely bites with large N, (very) small T panel dataset. Does your residual distribution suffer from heteroskedasticity?;
    - your regression models seem to mix-up predictors at household and country level: this may cause the so called ecological fallacy (https://en.wikipedia.org/wiki/Ecological_fallacy); for instance, I fail to get how uneployment rate at country level can be informative at the household level . In my opinion, the household-related unemployment status per year (yes/no) only would make sense in a -fe- regression model;
    - eventually, I fail to get your concern about plugging -i.year- in among your predictors. You can easily check whether it makes sense with the following post-estimation test:
    Code:
    testparm (i.year)
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X