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)
Related Posts with Xtreg vs REGFEHD, time varied weights
Drop panel based on percentage missing rows (panel data)Hi stata forum, I would like to delete the whole firm if revenue is missing for more than or equal …
Help required with identifying observations between two datasetsHello, I am working with a dataset where I have identified 7,286 observations. These observations b…
unit root test short panelHi guys, I was wondering if it is possible to test for unit root on a T=2 panel dataset. I only have…
Should the TWFE estimate results from the did_multiplegt command match those generated by reghdfe command?Hello everyone, I am using the -did_multiplegt- command developed by Clément de Chaisemartin Xavier…
shortcut referring to independent variables for regressionHi STATA, I have a dataset with about 400 independent variables and 4 mill rows. I want to run a lo…
Subscribe to:
Post Comments (Atom)
0 Response to Xtreg vs REGFEHD, time varied weights
Post a Comment