Announcement

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

  • Xtreg vs REGFEHD, time varied weights

    I am running a panel regression with the returns of various mutual funds as a function of time varied macro shocks. I want to run a weighted FE regression that weights each line by the size of the fund. I have tried using both per period size weights (that are equal to “fund size this year/sum of all funds this year) and mean size weights (that are equal to the mean of fund size for all years) for the entire sample period.
    If I try to use the yearly size weights with xtreg I get an error saying that “weight must be constant within id”
    Using REGFEHD with the yearly weights seems to work but produces results that are dramatically different than those of the of mean size weights.
    I’ve tried running rolling regressions with mean weights and the results seem to be much more consistent with those of the entire sample mean weights then those of the time varied weights.
    The two lines of code are:

    xtreg returns shock_1 shock_2 shock_3 [w = size_weights], fe vce(cluster id)
    reghdfe returns shock_1 shock_2 shock_3 [pw = size_weights], a(id) vce(cluster id)

  • #2
    You didn't get a quick answer. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output (fixed spacing fonts helps), and sample data using dataex.

    If you're committed to fixed effects, you can run it with reg with i.panel as an explanatory variable (assuming you don't have too many panels). I'd worry that your weights are endogenous - the size changes over time depend on prior returns. What happens if you run the analysis by size group instead of weighting by size?

    Comment


    • #3
      Thank you so much for your help!
      1) Is there an econometrical reason that xtreg requires weights to be constant within id or is it just an artifact of the way it's coded?
      2) I'm not committed to fixed effects, I'm open to trying any panel control model such as GLS random-effects that allows me to cluster by id. I originally chose FE because regHDFE allows time variant weights.
      3) Endogeneity is one of the reasons I prefer time variable weights because then I can choose weights from the start of the period and returns from the end of the period.
      4) i.panel isn't feasible in my case, I have a few thousand panels.

      I just noticed that my original post is too old for me to fix the code delimiters and so on, but I'll to do better next time.
      Last edited by Abe Smith; 10 Apr 2019, 12:17.

      Comment

      Working...
      X