I want to add the coefficients generated by lincom in esttab output along with sig * and se, by running this code I am able to add it as scalar:
ppmlhdfe trade ///
fta_other fta_ind ///
fta_other_lead_2-fta_other_lead_4 ///
fta_other_lag_2-fta_other_lag_10, ///
absorb(exp#year imp#year exp#imp) ///
cluster(exp#imp)
* Sum of the fta_other coefficients (lags and leads)
lincom ///
_b[fta_other] + ///
_b[fta_other_lead_2] + _b[fta_other_lead_4] + ///
_b[fta_other_lag_2] + _b[fta_other_lag_4] + ///
_b[fta_other_lag_6] + _b[fta_other_lag_8] + _b[fta_other_lag_10]
* Store estimate, standard error, and p-value for fta_other sum
scalar sum_fta_other = r(estimate)
scalar se_fta_other = r(se)
scalar p_fta_other = r(p)
* Add sum_fta_other as a new coefficient with se and p-value
estadd scalar sum_fta_other = sum_fta_other
estadd scalar se_fta_other = se_fta_other
estadd scalar p_fta_other = p_fta_other
* Store the regression estimates for the sector
estimates store model1
* Generate the final table with esttab, including the pooled and sector results
esttab model1 using "Results11.xls", scalars(sum_fta_other se_fta_other p_fta_other) se ar2 pr2 aic bic mtitles star(* 0.10 ** 0.05 *** 0.01) replace
can anyone suggest a more ingenious way of doing this.
ppmlhdfe trade ///
fta_other fta_ind ///
fta_other_lead_2-fta_other_lead_4 ///
fta_other_lag_2-fta_other_lag_10, ///
absorb(exp#year imp#year exp#imp) ///
cluster(exp#imp)
* Sum of the fta_other coefficients (lags and leads)
lincom ///
_b[fta_other] + ///
_b[fta_other_lead_2] + _b[fta_other_lead_4] + ///
_b[fta_other_lag_2] + _b[fta_other_lag_4] + ///
_b[fta_other_lag_6] + _b[fta_other_lag_8] + _b[fta_other_lag_10]
* Store estimate, standard error, and p-value for fta_other sum
scalar sum_fta_other = r(estimate)
scalar se_fta_other = r(se)
scalar p_fta_other = r(p)
* Add sum_fta_other as a new coefficient with se and p-value
estadd scalar sum_fta_other = sum_fta_other
estadd scalar se_fta_other = se_fta_other
estadd scalar p_fta_other = p_fta_other
* Store the regression estimates for the sector
estimates store model1
* Generate the final table with esttab, including the pooled and sector results
esttab model1 using "Results11.xls", scalars(sum_fta_other se_fta_other p_fta_other) se ar2 pr2 aic bic mtitles star(* 0.10 ** 0.05 *** 0.01) replace
can anyone suggest a more ingenious way of doing this.

Comment