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
Putting labels for different variables in one line of code or loop?Hello, I would like to add labels for a set of different variables, i have around 15, and would lik…
New packages cprdonsutil and cprdlsoautil on SSCThanks as always to Kit Baum, 2 new packages cprdonsutil and cprdlsoautil are now available for down…
Base Level of Factor Variable in Probit with InteractionStatalist: I am running the following Probit model on pooled panel data: \[ P(y_{it} = 1 \vert x_{i…
3SLS and GMM (error correlation)??Dear Statalist users I am having a problem in my research between 2-step GMM and 3sls. I have a sys…
Test for sufficient sample size in linear probability modelHi, I run the following linear probability model: Code: reg nodad k1sex i.meduc i.state i.mdecade…
Subscribe to:
Post Comments (Atom)
0 Response to No observations - Portfolio Sorts
Post a Comment