Announcement

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

  • Choice of model for panel data analysis

    I have a question on panel data and two way fixed effects models:
    I have a panel dataset on 267 danish municipalities in the time period 1978-2006, and I have formatted the data "long".
    I am trying to run a regression where my dependent variable is an index including three different variables on the municipality's spending and the independent variable is the percentage of each municipality who voted for a right wing party. I want to investigate if the preferences that the citizens express through their voting behavior is listened to by the municipalities - i.e. is the municipalities responsive to their citizens?

    I have been told that a two way fixed effects might be the right fit for this kind of data, but I wanted to ask if that is correct? Right now my commands look like this:
    xtset muni year
    xi: reg index bluevote1 i.muni i.year

    I hope you can help!

    Best
    Karoline

  • #2
    Karoline:
    welcome to this forum.
    Please note:
    1) you probably meant:
    Code:
    xtset muni year
    xtreg index bluevote i.year, vce(cluster muni)
    or (right, but less advisable if you have evidence of a panel-wise effect):
    2)
    Code:
    reg index bluevote1 i.muni i.year, vce(cluster muni)
    In addition:
    a) -regress- does not need previous -xset-;
    b) -vce(cluster panelid) standard error is mandatory if you go -regress- (that is not conceived for panel data regression); otherwise, Stata will consider all your observations as independent, which is not the case due to the panel structure of your dataset;
    c) with 267 -muni-, -vce(cluster panelid)- standard error is highly recommended with -xtreg,fe-, too;
    d) -xi:- prefix is now redundant for Stata built-in commands.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X