Announcement

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

  • 2SLS with two-way fixed effect and clustered error.

    Hi, I am a Stata beginner.

    I want to use xtivreg2 to do a 2SLS estimation with two way fixed effect and clustering error. My data is already in the panel setting.
    Endogenous variable: chinapeindDE
    Instrument: chinainapeindUK

    #xtivreg2 cta lntotal_assets lntotal_assetsquar cfta LnNoE salegrowth leverage PriGdp markcapGdp Growth i.year (chinapeindDE=chinapeindUK),fe vce(cluster nace)#
    Then the output is factor-variable operators not allowed
    I wonder are there any other command that allows me to do the estimation with two way fixed effect and cluster error at "nace "level?

  • #2
    You didn't get a quick answer. You'll increase your chances of a helpful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. Being able to replicate your problem makes it easier for us to help you.

    If the problem is really the factor variable issue, then the problem is i.year. You can use xi as a command to generate the dummy variables for each year and then use them (you can use _Ir* or whatever instead of writing out each year if that is easier). However, with what you are estimating, I suspect you can use the Stata provided procedure xtivreg which does take factor variable notation.

    Comment

    Working...
    X