Hello everyone,
I have double-sorted my data and dropped observations to include only one observation per date per company. Then, I calculate the value-weighted excess returns and then find the Newey statistics.
However, the Newey statistics do not work for EXUSD_3_VW_5_1_Size, EXUSD_4_VW_5_1_Size and EXUSD_5_VW_5_1_Size because there are too few observations. Is there any way to change that? Thank you so much!
My code is as follows:
tsset DSCode1 ymdate
gen F_Excess_USD_w=L.Excess_USD_w
drop if F_Excess_USD_w==.
* Dependent-sort portfolio - Size & IVOL
astile nq_Size_w = Size_w, nq(5)
bys nq_Size_w : astile IVOL_Size=IVOL_w , nq(5)
sort ymdate IVOL_Size DSCode1
by ymdate IVOL_Size: drop if _n >1
* Value-weighted average excess returns of each portfolio in each month (ymdate)
bys ymdate: asgen ExUSD_1_VW_1_Size = (F_Excess_USD_w / (nq_Size_w ==1 & IVOL_Size ==1)), w(MV_USD_w)
bys ymdate: asgen ExUSD_1_VW_5_Size = (F_Excess_USD_w / (nq_Size_w ==1 & IVOL_Size ==5)), w(MV_USD_w)
bys ymdate: asgen EXUSD_1_VW_5_1_Size = ExUSD_1_VW_5 - ExUSD_1_VW_1
bys ymdate: asgen ExUSD_2_VW_1_Size = (F_Excess_USD_w / (nq_Size_w ==2 & IVOL_Size ==1)), w(MV_USD_w)
bys ymdate: asgen ExUSD_2_VW_5_Size = (F_Excess_USD_w / (nq_Size_w ==2 & IVOL_Size ==5)), w(MV_USD_w)
bys ymdate: asgen EXUSD_2_VW_5_1_Size = ExUSD_2_VW_5 - ExUSD_2_VW_1
bys ymdate: asgen ExUSD_3_VW_1_Size = (F_Excess_USD_w / (nq_Size_w ==3 & IVOL_Size ==1)), w(MV_USD_w)
bys ymdate: asgen ExUSD_3_VW_5_Size = (F_Excess_USD_w / (nq_Size_w ==3 & IVOL_Size ==5)), w(MV_USD_w)
bys ymdate: asgen EXUSD_3_VW_5_1_Size = ExUSD_3_VW_5 - ExUSD_3_VW_1
bys ymdate: asgen ExUSD_4_VW_1_Size = (F_Excess_USD_w / (nq_Size_w ==4 & IVOL_Size ==1)), w(MV_USD_w)
bys ymdate: asgen ExUSD_4_VW_5_Size = (F_Excess_USD_w / (nq_Size_w ==4 & IVOL_Size ==5)), w(MV_USD_w)
bys ymdate: asgen EXUSD_4_VW_5_1_Size = ExUSD_4_VW_5 - ExUSD_4_VW_1
bys ymdate: asgen ExUSD_5_VW_1_Size = (F_Excess_USD_w / (nq_Size_w ==5 & IVOL_Size ==1)), w(MV_USD_w)
bys ymdate: asgen ExUSD_5_VW_5_Size = (F_Excess_USD_w / (nq_Size_w ==5 & IVOL_Size ==5)), w(MV_USD_w)
bys ymdate: asgen EXUSD_5_VW_5_1_Size = ExUSD_5_VW_5 - ExUSD_5_VW_1
egen mean_Size = rowmean(EXUSD_1_VW_5_1_Size EXUSD_2_VW_5_1_Size EXUSD_3_VW_5_1_Size EXUSD_4_VW_5_1_Size EXUSD_5_VW_5_1_Size)
tsset DSCode1 ymdate
sort DSCode1 ymdate,
*Value-weighted average excess returns & t-statistics of each portfolio
newey EXUSD_1_VW_5_1_Size, lag(6) force
estimates table, star(.05 .01 .001)
newey EXUSD_2_VW_5_1_Size, lag(6) force
estimates table, star(.05 .01 .001)
newey EXUSD_3_VW_5_1_Size, lag(6) force
estimates table, star(.05 .01 .001)
newey EXUSD_4_VW_5_1_Size, lag(6) force
estimates table, star(.05 .01 .001)
newey EXUSD_5_VW_5_1_Size, lag(6) force
estimates table, star(.05 .01 .001)
newey mean_Size, lag(6) force
estimates table, star(.05 .01 .001)
Related Posts with No observations - Portfolio Sorts
graph box and graph boxDear Stata users, I have a continuous variable and I want to present the minimum value, maximum valu…
Chow testArray regress c.Y c.time c.A c.B c.A#c.time c.B#c.time Then i manually group some obs (Named it grp…
_const in logistic 0?Hello everyone, I´m fitting a logistic regression model and get a constant value close to 0, is thi…
Comparing autocorrelationsDear Stata users, I'm struggling to find a robust way to compare the autocorrelations of two earnin…
Is it available to use fixed effect term in xtgee ?I read one article to identify effects of policies. The article was published from a high IF journal…
Subscribe to:
Post Comments (Atom)
0 Response to No observations - Portfolio Sorts
Post a Comment