Announcement

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

  • Xtset Identifier - FE estimation

    Hello Stata Forum,

    I am having trouble to understand my identifier and relate with fixed effects estimation. I have a database on beverages by brand, size (ml, liter, pack) and by city. So, in order to have an identifier I use:

    egen pan_id = group(brand size city)

    However, I would like to understand if this captures the time-invariant effects, such as city fixed effects, brand fixed effects, and size fixed effects. I am not sure because when I run an areg with dummy variables with each of this item separately I get different results, but when I absorb the pan_id variable, I get the same result so I am a bit confused what the difference is.

    Thank you so much for your help. I really appreciate it.

    Best,

    Lena
    Last edited by Lena TF; 02 Jul 2019, 00:38.

  • #2
    Lena:
    if you create a new -panelid-, the fixed effect relates to all those variable taken together. Put differently, you cannot single out the fixed effect for brand, sixe and city.
    That said, it is not surprising that you obtain different coefficients with two different -areg- specifications.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Thank you, Carlo.

      So in order to capture the fixed effects separately should I include in the xtset regression dummy for these categories? I am not sure how to capture these effects, since in the literature they include the effect for each category. Any suggestions?

      Thank you again!!

      Comment


      • #4
        Lena:
        -xtset- allows one -panelid- (mandatory) and one -timevar- only.
        You can choose to -xtset- your data at, say, -brand- level and then add categorical predictors for -size- and -city- (take a loook at -fvvarlist- notation).
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          Hi Carlo,

          Thanks for the reply! Very helpful

          Although, if I may, I would like to ask you about this: I have better results when I group my id as Brand, size, and city. I might lose the fixed effects itself, but is it wrongly specified?

          Also, including interaction with year, I am trying to include for example i.brand#c.year or i.brand#i.year but I am not sure how is the difference between them. Any information would be highly appreciated.

          Thank you!

          Best,
          Lena


          Comment


          • #6
            Lena:
            1) -brand_size_city- is simply another -panelid-. The issue, if any, if presenting this approach is technically OK in your research field.
            2) first off, you should also calculate the so called main conditional effect of the predictors included in the interaction. Hence, provided that the code that makes more sense in your case should consider -year- as a categorical variable (so that you can see the contribution of each year within the same panel, as per your -fe- specification), your chunk of code should be:
            Code:
            i.brand##i.year
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment

            Working...
            X