Announcement

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

  • County, time-fixed effects

    Hello,

    I am currently using Stata for my senior thesis and had some questions about fixed-effects. Currently I have county-level data on 6 states over the years 2007-2012, with monthly observations for each state. Total, I have 41,760 observation.

    To give a better idea of my dataset, this is how I have it:
    Buyer_location month year
    xyz, ga 1 2007
    xyz, ga ... ...
    xyz, ga 12 2012
    123, ga 1 2007
    123, ga ... ...
    123, ga 12 2012
    abc, nc 1 2007
    I want to make sure I am setting up my fixed effects correctly.

    egen id = group(Buyer_location)

    reg y x1 x2 i.id i.year#i.month

    Is this the correct way to go about this? Any insight would be greatly appreciated.

  • #2
    Max:
    welcome to this forum.
    If you're dealing with a panel dataset and you have a continuous regressand, your first choice should be -xtreg-.
    An aside, I fail to get why you interact -year- with -months- (and do not include the conditional main effect of those two predictors in the right-hand side of your regression equation).
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Hi Carlo,

      Thanks for the welcoming.

      I was under the impression that my id variable would be my "County Fixed Effect" and the grouping of month/year would be my "Time Fixed Effect". Is that not the best way to go about this?

      Comment


      • #4
        Max:
        I have a different take about that.
        Your -panelid-="Buyer". I would consider -location- as a predictor. This way I will capture -Buyer- fixed effect.
        Your -timevar"=
        Code:
        egen new_timevar=group(year months)
        I would start with -xtset-ting your data:
        Code:
        xtset Buyer new_timevar
        Then, provided that a panel-wise effect does exists (see -xtreg postestimation-, you should test which specification fits your data better than the other oone (ie, -fe- or -re-)?
        An aside, I still fail to get why you interacted -year- with -months-.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment

        Working...
        X