Announcement

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

  • i.year vs c.year

    I want to add time fixed effects to my panel data analysis. As far as I understood reading existing posts here, there are two ways to do it: (a) i.year (b) c.year. I understand the results obtained using the i.year. But I am not sure what c.year does. Is c.year the same as using just "year" as an explanatory variable? At least, that's what I understood from help fvvarlist. I will appreciate if someone could confirm this.

    Thanks,

    Taz Raihan

    P.S. I already sent a request to change my name from T Raihan to Taz Raihan.

  • #2
    c.year just adds year as a predictor and (as I understand it) the c. makes no difference to what is fitted, only to what is possible thereafter.


    As a simple example you might study the results of

    Code:
    webuse grunfeld
    xtreg mvalue c.year
    xtreg mvalue year
    reg mvalue c.year
    reg mvalue year

    Comment


    • #3
      Taz:
      you can see the difference between -c-. and -i.- in the following toy-example, too (by the way, I see no point in using -c.- with time variable):
      Code:
      use "http://www.stata-press.com/data/r15/nlswork.dta"
      . xtreg ln_wage c.year
      
      Random-effects GLS regression                   Number of obs     =     28,534
      Group variable: idcode                          Number of groups  =      4,711
      
      R-sq:                                           Obs per group:
           within  = 0.1022                                         min =          1
           between = 0.0804                                         avg =        6.1
           overall = 0.0709                                         max =         15
      
                                                      Wald chi2(1)      =    3093.66
      corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
      
      ------------------------------------------------------------------------------
           ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
              year |   .0186375   .0003351    55.62   0.000     .0179807    .0192942
             _cons |   .2039722   .0267605     7.62   0.000     .1515226    .2564218
      -------------+----------------------------------------------------------------
           sigma_u |   .3715966
           sigma_e |  .30347936
               rho |  .59988609   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . testparm c.year
      
       ( 1)  year = 0
      
                 chi2(  1) = 3093.66
               Prob > chi2 =    0.0000
      
      . xtreg ln_wage i.year
      
      Random-effects GLS regression                   Number of obs     =     28,534
      Group variable: idcode                          Number of groups  =      4,711
      
      R-sq:                                           Obs per group:
           within  = 0.1058                                         min =          1
           between = 0.0796                                         avg =        6.1
           overall = 0.0724                                         max =         15
      
                                                      Wald chi2(14)     =    3198.67
      corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
      
      ------------------------------------------------------------------------------
           ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
              year |
               69  |   .0854251   .0123808     6.90   0.000     .0611592    .1096911
               70  |    .069889   .0115653     6.04   0.000     .0472215    .0925566
               71  |   .1196013   .0114272    10.47   0.000     .0972043    .1419983
               72  |   .1327835   .0117484    11.30   0.000      .109757    .1558099
               73  |   .1476736   .0113915    12.96   0.000     .1253467    .1700006
               75  |   .1609048   .0112586    14.29   0.000     .1388385    .1829712
               77  |   .2207951   .0112687    19.59   0.000     .1987089    .2428814
               78  |   .2596833   .0115128    22.56   0.000     .2371186     .282248
               80  |    .267724   .0116586    22.96   0.000     .2448735    .2905745
               82  |   .2852433   .0113995    25.02   0.000     .2629007    .3075859
               83  |   .3126372   .0115421    27.09   0.000     .2900152    .3352592
               85  |   .3653587   .0114383    31.94   0.000       .34294    .3877773
               87  |   .3813851   .0113703    33.54   0.000     .3590997    .4036706
               88  |   .4370689   .0113081    38.65   0.000     .4149054    .4592325
                   |
             _cons |   1.426677   .0103611   137.70   0.000     1.406369    1.446984
      -------------+----------------------------------------------------------------
           sigma_u |  .36928787
           sigma_e |  .30294584
               rho |  .59773703   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . testparm i.year
      
       ( 1)  69.year = 0
       ( 2)  70.year = 0
       ( 3)  71.year = 0
       ( 4)  72.year = 0
       ( 5)  73.year = 0
       ( 6)  75.year = 0
       ( 7)  77.year = 0
       ( 8)  78.year = 0
       ( 9)  80.year = 0
       (10)  82.year = 0
       (11)  83.year = 0
       (12)  85.year = 0
       (13)  87.year = 0
       (14)  88.year = 0
      
                 chi2( 14) = 3198.67
               Prob > chi2 =    0.0000
      
      .
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Carlo Lazzaro Thanks, but sorry for my question was not clear. I know how the stata outputs differ across i.year and c.year. What I basically wanted to know was, how to interpret the coefficient on c.year? And if I want to add time fixed effect, which one is more appropriate? i.year or c.year?

        Nick Cox Thanks for your response. Would you please explain what you meant by "c. makes no difference to what is fitted, only to what is possible thereafter"?

        Comment


        • #5
          Taz:
          1) if you impose -c.year- Stata tells you that each year (no matter which one) increases -ln_wage- by about 1.88%:
          Code:
          . di (exp(.0186375)-1)*100
          1.8812262
          ;
          2) I would go -i.year-.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Carlo Lazzaro thank you so much for the clarification.

            Comment


            • #7
              #2, #4: Commands like margins are sensitive to what notation you used earlier.

              #3 Not quite sure what Carlo means, but with environmental data I am often checking in the first instance for a linear trend.

              Comment


              • #8
                Nick:
                my previous reply was probably influenced by the habit of checking for each year's contribution first: that's why I find more palatable (for an economist's taste, at least) to go -i.year- vs -c.year-.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Hi, I am using regife package for my panel data analysis. For example. to accommodate the interactive fixed effect model, I write the following command:

                  regife y x1 x2, a(country year) ife(country year, 1)

                  Since regife command does not work for 2SLS, how can I control the interactive fixed effect model in ivregress command? Can I write in the following way?

                  ivregress 2sls y x2 (x1=z) i.country i.year i.country#c.year, first

                  Thanks in advance for your time and effort.

                  Comment

                  Working...
                  X