Announcement

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

  • Mobility Inconsitent Dummy Estimates

    I have data at the worker level and observe in which sector the worker was last and current year. Every worker was in a sector last and current year, i.e. there are no missings. I have two sectors - tradable and non-tradable sector. To measure sector mobility, I create two dummies. One dummy equals one if the worker is in the tradable sector in the current year and one dummy equals to one if the current and last year sector are not the same. I get a significant and positive coefficient for the dummy that equals one if the worker is in the tradable sector in the current year. This means that workers are more likely to move into the tradable sector in the current year. However the coefficient on the dummy that equals to one if the current and last year sector are not the same is not significant and zero. I am very confused because I thought that if I see effects on one dummy I should see effects on the other dummy as well because the workers that are moving into the tradable sector can only come from the non-tradable sector. Or am I missing something?

  • #2
    Trevor:
    without an example/excerpt of your data via -dataex- I find difficult to follow what you're after.
    That said, with tons of guess-work the following toy-example shows that using -i.sector- as a predictor gives back the same results:
    Code:
    . set obs 5
    Number of observations (_N) was 0, now 5.
    
    . g id=1
    
    . g year=2018+_n
    
    . g sector=0 in 1/3
    
    . replace sector=1 if sector==.
    
    . expand 2
    (5 observations created)
    
    . replace id=2 in 6/10
    
    . label define sector 0 "Tradable" 1 "Non Tradable"
    
    . label val sector sector
    
    . bysort id: gen wanted=0 if sector==0
    
    . bysort id: replace wanted=1 if sector==1
    
    . g y=runiform()
    
    . bysort id : gen wanted2=1 if sector[_n+1]!=sector[_n]
    
    . replace wanted2=0 if wanted2==. & sector!=.
    
    
    . list
    
         +--------------------------------------------------------+
         | id   year         sector   wanted          y   wanted2 |
         |--------------------------------------------------------|
      1. |  1   2019       Tradable        0   .3488717         0 |
      2. |  1   2020       Tradable        0   .2668857         0 |
      3. |  1   2021       Tradable        0   .1366463         1 |
      4. |  1   2022   Non Tradable        1   .0285569         0 |
      5. |  1   2023   Non Tradable        1   .8689333         1 |
         |--------------------------------------------------------|
      6. |  2   2019       Tradable        0   .3508549         0 |
      7. |  2   2020       Tradable        0   .0711051         0 |
      8. |  2   2021       Tradable        0    .323368         1 |
      9. |  2   2022   Non Tradable        1   .5551032         0 |
     10. |  2   2023   Non Tradable        1    .875991         1 |
         +--------------------------------------------------------+
    
    . xtset id year
    
    Panel variable: id (strongly balanced)
     Time variable: year, 2019 to 2023
             Delta: 1 unit
    
    . xtreg y i.year i.wanted i.wanted2, fe
    note: 1.wanted omitted because of collinearity.
    note: 1.wanted2 omitted because of collinearity.
    
    Fixed-effects (within) regression               Number of obs     =         10
    Group variable: id                              Number of groups  =          2
    
    R-squared:                                      Obs per group:
         Within  = 0.8118                                         min =          5
         Between =      .                                         avg =        5.0
         Overall = 0.7841                                         max =          5
    
                                                    F(4,4)            =       4.31
    corr(u_i, Xb) = 0.0000                          Prob > F          =     0.0929
    
    ------------------------------------------------------------------------------
               y | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
            year |
           2020  |  -.1808679    .192046    -0.94   0.400    -.7140731    .3523373
           2021  |  -.1198562    .192046    -0.62   0.566    -.6530614     .413349
           2022  |  -.0580333    .192046    -0.30   0.778    -.5912385    .4751719
           2023  |   .5225988    .192046     2.72   0.053    -.0106064    1.055804
                 |
        1.wanted |          0  (omitted)
       1.wanted2 |          0  (omitted)
           _cons |   .3498633    .135797     2.58   0.062    -.0271697    .7268963
    -------------+----------------------------------------------------------------
         sigma_u |  .07446234
         sigma_e |  .19204602
             rho |  .13068872   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(1, 4) = 0.75                        Prob > F = 0.4349
    
    . xtreg y i.year i.sector , fe
    note: 1.sector omitted because of collinearity.
    
    Fixed-effects (within) regression               Number of obs     =         10
    Group variable: id                              Number of groups  =          2
    
    R-squared:                                      Obs per group:
         Within  = 0.8118                                         min =          5
         Between =      .                                         avg =        5.0
         Overall = 0.7841                                         max =          5
    
                                                    F(4,4)            =       4.31
    corr(u_i, Xb) = 0.0000                          Prob > F          =     0.0929
    
    -------------------------------------------------------------------------------
                y | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    --------------+----------------------------------------------------------------
             year |
            2020  |  -.1808679    .192046    -0.94   0.400    -.7140731    .3523373
            2021  |  -.1198562    .192046    -0.62   0.566    -.6530614     .413349
            2022  |  -.0580333    .192046    -0.30   0.778    -.5912385    .4751719
            2023  |   .5225988    .192046     2.72   0.053    -.0106064    1.055804
                  |
           sector |
    Non Tradable  |          0  (omitted)
            _cons |   .3498633    .135797     2.58   0.062    -.0271697    .7268963
    --------------+----------------------------------------------------------------
          sigma_u |  .07446234
          sigma_e |  .19204602
              rho |  .13068872   (fraction of variance due to u_i)
    -------------------------------------------------------------------------------
    F test that all u_i=0: F(1, 4) = 0.75                        Prob > F = 0.4349
    
    .
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Dear Carlo thank you very much for your attempt to help. I thought that the question without a data example would be clear, but now I can see that a data example is needed. I have attached a data example.

      I have variables about last year and current year sector as well as a treatment variable. I create three dummies, current sector trade, current sector non-trade, and change from last year to current year sector. When I regress current sector dummies on treatment I get results that are not in line when I regress sector change on treatment. The effect on being in trade sector is positive and the effect on being in non-trade sector is negative. Which means that workers move from non-trade sector to trade sector. However the coefficient on sector change is negative. My prior was if I see a positive effect on moving from one sector to the other, I should also see a positive effect on sector change dummy.

      Here is the corresponding code:
      Code:
      use example.dta, clear
      
      gen trade_cy=(sector_cy==1)
      
      gen nontrade_cy=(sector_cy==2)
      
      gen sector_mob=(sector_ly!=sector_cy)
      
      reg sector_mob treatment
      
      reg trade_cy treatment
      
      reg nontrade_cy treatment
      Attached Files

      Comment


      • #4
        Trevor:
        assuming that a panel data analysis is out of debate here, I would go the following way:
        Code:
        gen switch=group( sector_ly sector_cy)
        label define switch 1 "Tradable_Tradable" 2 "Tradable_Non_Tradable" 3 "Non_Tradable_Tradable" 4 "Non_Tradable_Non_Tradable"
        label val switch switch
        regress treatment i.switch
        
              Source |       SS           df       MS      Number of obs   =        20
        -------------+----------------------------------   F(3, 16)        =      1.08
               Model |  .272266853         3  .090755618   Prob > F        =    0.3843
            Residual |  1.34006066        16  .083753791   R-squared       =    0.1689
        -------------+----------------------------------   Adj R-squared   =    0.0130
               Total |  1.61232751        19  .084859343   Root MSE        =     .2894
        
        --------------------------------------------------------------------------------------------
                         treatment | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        ---------------------------+----------------------------------------------------------------
                            switch |
            Tradable_Non_Tradable  |   .0383691   .2506299     0.15   0.880    -.4929425    .5696808
            Non_Tradable_Tradable  |   .0981766   .2421315     0.41   0.691    -.4151192    .6114724
        Non_Tradable_Non_Tradable  |   .2859613   .2262363     1.26   0.224    -.1936383    .7655608
                                   |
                             _cons |   .3078787   .2046385     1.50   0.152    -.1259354    .7416928
        --------------------------------------------------------------------------------------------
        
        .
        Possibly due to the very limited sample size, switching or not has no bearing on -treatment- variations.

        As recommended by the FAQ, in your future posts please use -dataex- or CODE delimiters to share what you typed and what Stata gave you back (attachments are discouraged due to the risk of downloading active contents). Thanks.
        Last edited by Carlo Lazzaro; 28 Jan 2022, 03:24.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment

        Working...
        X