Announcement

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

  • i.year vs year*

    Dear all,
    My aim is to estimate a model with country and year fixed effects. I both have a variable with the years in long format, and a series of dummy variables for each year.
    My concern arises because I have different estimates and standard errors depending on whether I am using
    HTML Code:
    Year*
    or
    HTML Code:
    i.Year
    in my model.

    The model looks something like this
    HTML Code:
    xtreg y x1 x2 x3 i.Year, fe robust cluster(id)
    . However if I estimate the model in the thus:
    HTML Code:
    xtreg y x1 x2 x3 Year*, fe robust cluster(id) ​​​​​​​
    estimates change and in general, appear to be more significant. Does anyone know why this is the case? I thought these two syntaxes where synonyms. Which estimates are more reliable if my aim is to account for unobserved time heterogeneity?

    Thank in advance for your help










  • #2
    Without more information, I would use the "i.year" syntax.
    You should, however, provide the results you obtain to see if there is another reason why the problems you report appear.
    Also, you dont say how the variables "Year*" are created. It seems to me that it could be another possible culprit for the problem you report.
    HTH

    Comment


    • #3
      Additionally, with xtreg we're supposed to use variables in long form. It seems the second command uses year in wide form.
      Best regards,

      Marcos

      Comment


      • #4
        It would be helpful if you could post the output of the xtreg commands (within code delimiters).

        Comment


        • #5
          I have generated Year dummies with
          Code:
          quietly tab Year, gen(yeardum)
          .
          The two models are estimated in the following manner:


          Code:
          eststo: xi: xtreg PracticePos /// dv
          l.PracticePos l.dp_USPTA_efy_agg $controls_exsnes_lag Year*, // regressors
          eststo: xi: xtreg PracticePos /// dv
          l.PracticePos l.dp_USPTA_efy_agg $controls_exsnes_lag i.Year, // regressors
          esttab, order(L.dp_USPTA_efy_agg) ///
          label se star(* 0.10 ** 0.05 *** 0.01)
          eststo clear
          And below you should see the output: as you can see the output changes quite dramatically for the variable of interest.
          I am also estimating this model with GMM
          Code:
          xtabond2
          and the results change as dramatically as with
          Code:
          xtreg
          . It would be good to find out also what is the best approach (Year* vs i.Year) for xtabond.


          Click image for larger version

Name:	Schermata 2019-10-14 alle 20.58.20.jpg
Views:	2
Size:	101.4 KB
ID:	1520382



          Thanks a lot in advance for your help






          Attached Files

          Comment


          • #6
            It really should't matter whether you use i.year or year dummies. You say that that you generated year dummies with
            Code:
            quietly tab Year, gen(yeardum)
            then to invoke year dummies you should type yeardum*. Then, these should be equivalent:
            Code:
            xtreg depvar indepvars i.year, fe
            xtreg depvar indepvars yeardum*, fe
            I think when you type year*, there are no other variables starting with year except for year itself, so you are estimating a model with a linear time trend, whereas when you include i.year you are estimating a model with year-specific effects.

            Comment


            • #7
              Remember that case is important. Therefore Year* does not include any of the yeardum variables.
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              StataNow Version: 19.5 MP (2 processor)

              EMAIL: [email protected]
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Dear Wakker is it correct to say that while "year*" estimate a time trend the "i.year" estimates year fixed effects? if this is the case it is normal to expect different results?

                Dear Prof Williams, I am not sure I fully understand what you mean when you say that case is important: would you mind elucidating on this?

                thanks in advance for your reply

                Comment


                • #9
                  Dear Wakker is it correct to say that while "year*" estimate a time trend the "i.year" estimates year fixed effects? if this is the case it is normal to expect different results?
                  Yes this is correct. I may have made it a bit confusing by not using upper case letters in the Year variable, which is what Richard is referring to. To be clear:
                  Code:
                  xtreg depvar indepvars i.Year, fe // model with year-specific effects
                  xtreg depvar indepvars yeardum*, fe // equivalent to above model
                  xtreg depvar indepvars Year, fe // model with time trend
                  When you use the wildcard * after Year, the model will include any variables that start with Year (with upper case). The thing is that your year dummies are called yeardum1, yeardum2 etc (or whatever number) with a lower case letter. So you have only one variable that starts with Year, which is the Year variable itself. Year* will therefore only include Year, which estimates a time trend instead of year fixed effects. It is normal that this results in different coefficients since they are different models.

                  Comment


                  • #10
                    Thank you very much. It was a case mistake that messed up my estimation. This is much clearer and the result coincide using yeardum.

                    Thanks for clarifying this confusion

                    Comment


                    • #11
                      what is year*... imean why *?

                      Comment


                      • #12
                        Excerpted from -help varlist-:
                        myvar just one variable
                        myvar thisvar thatvar three variables
                        myvar* variables starting with myvar
                        *var variables ending with var
                        my*var variables starting with my & ending with var with any number of other characters between
                        my~var one variable starting with my & ending with var with any number of other characters between
                        my?var variables starting with my & ending with var with one other character between
                        myvar1-myvar6 myvar1, myvar2, ..., myvar6 (probably)
                        this-that variables this through that, inclusive

                        The * character indicates to match variable names with any number of characters in the position of *. All variables matching the pattern are returned.

                        Comment

                        Working...
                        X