Announcement

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

  • Fixed Effect troubles

    Hello, I'm a first-time poster and newbie to the world of Stata. I am trying to estimate a fixed effects model with city as the entity variable and year as the time variable in a panel data set I have. I am typing "xtreg city year, fe" and getting an error message "must specify panelvar; use xtset."

    I then entered the command "xtset city year", then "xtreg city year, fe" and got a different error message. This time it says "the panel variable city may not be included as an independent variable."

    I have no idea what this means or how to fix it. I would appreciate any tips. Thank you very much for your time.

  • #2
    Also, my apologies for not displaying the stata commands in the proper format. I installed "ssc install dataex" but am unsure how to use it correctly.

    Comment


    • #3
      Maybe try
      Code:
      xtset city
      xtreg <response variable> i.year, fe
      where you substitute the name of your response (independent) variable in for <response variable>.

      You can also
      Code:
      xtreg <response variable> i.year, i(city) fe
      which I prefer, but others don't.

      I think that -dataex- is for listing a tease of your dataset, and not for showing commands. Use the code delimiters for that.

      Comment

      Working...
      X