Announcement

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

  • Difference between i.year and nocons

    Hi everybody,

    I am using first difference and my code is the following:

    xtset id year

    reg d.y d.x1 d.xc i.year, nocons cluster(id)

    My question is what is the difference between i.year and nocons.

    When I run my regressions, there is not very big difference when using both or only i.year. The difference arises when I use only nocons, then my coef changes sign. For the reference I am looking how variable x influences elections and my units of observations are counties. As a side question, I would also like to know, should I use weights?
    Last edited by Ivan Ivanov; 16 Sep 2025, 21:50.

  • #2
    Ivan:
    this ild Stata thread st: Re: nocons option warns about omitting -cons- in -regress-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Since your estimation model is in deviation form, it might be useful for you to write out the model in levels, and then see what the implications would be for the model in deviation form.

      For instance, the usual justification for a model to not have a constant in deviation form is that the constant of the original model washes out when you take deviations:
      \[ Y_t = \beta_0 + \beta_1 X_t + u_t \]
      \[ \Rightarrow \Delta Y_t = \beta_1 \Delta X_t + \Delta u_t \]

      To include a dummy for each year in the deviation form would mean that you have a model of this sort:

      \[ Y_t = \beta_0 + \beta_1 X_t + \delta_{1990} D_{1990} \times t + \delta_{1991} D_{1991} \times t + \delta_{1992} D_{1992} \times t + ... + u_t \]
      \[ \Rightarrow \Delta Y_t = \beta_1 \Delta X_t + \delta_{1990} D_{1990} + \delta_{1991} D_{1991} + \delta_{1992} D_{1992} + ... + \Delta u_t \]
      where the Ds are dummies for the corresponding years.

      Also note that whenever you include i.year in the regression, Stata drops one of the levels of the variable, by default the smallest one, i.e. the first year in your data. In a model without a constant, this would mess up the interpretations of the individual coefficients. So I think either you should include the constant in the regression command (i.e. don't include the nocons option), OR explicitly tell Stata to include all levels of the factor variable by typing ibn.year instead of i.year (and keep the nocons option).
      Last edited by Hemanshu Kumar; 17 Sep 2025, 01:34.

      Comment

      Working...
      X