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
Run Seemingly unrelated regression (SUREG) with one of the explanatory variable being latentHi All I have difficulty running an SUREG translog cost function where one of my independent variabl…
How to convert my FE-IV model (with intuitions borrowed from the RDD literature) into STATA language - Is IVREGHDFE the one?Hello dear stata friends! I am having some confusion regarding the implementation of my Individual-F…
treatment turns on and offHello everyone, I hope you are very well, I have some monthly panel data at the state level, in thi…
How to Correct Data Errors in Longitudinal Format Data in Stata?I have a long format dataset with data error on the variables of kg5, k68, and k912 like this, clear…
Editing a spatial weighting matrix in neighbor list formI used spmat to create a spatial weighting matrix. I exported it in neighbor list form. The first ro…
Subscribe to:
Post Comments (Atom)
0 Response to Xtreg vs REGFEHD, time varied weights
Post a Comment