Dear Statalist,
I am using StataNow 18.5 and working with the new collect suite of commands to export regression results. I would like to add a custom row to the table, such as a note indicating whether a certain control was included in the model. Specifically, I would like to replicate what is easily done using esttab and estadd, as in the following example:
This produces a nicely formatted table with a row called “Control for Foreign” showing "No" and "Yes" for each model.
I am now attempting to do something similar using the collect framework:
This works well to show coefficient and observation rows, but I don’t see how to add a user-defined row like "Control for Foreign". I want this information included in the table layout, even though I am intentionally omitting the foreign coefficient itself.
Is there a way to manually add a custom string result to a specific cell in a collect table? Or a better approach to achieve this kind of labeling?
Thank you in advance for any guidance.
I am using StataNow 18.5 and working with the new collect suite of commands to export regression results. I would like to add a custom row to the table, such as a note indicating whether a certain control was included in the model. Specifically, I would like to replicate what is easily done using esttab and estadd, as in the following example:
Code:
sysuse auto, clear eststo reg1: reg price mpg, r quietly estadd local foreign_controls "No", replace eststo reg2: reg price mpg foreign, r quietly estadd local foreign_controls "Yes", replace esttab reg1 reg2, b(2) se(2) parentheses star(* 0.10 ** 0.05 *** 0.01) keep(mpg) /// stats(foreign_controls N, fmt(0 0) labels("Control for Foreign" "Observations"))
I am now attempting to do something similar using the collect framework:
Code:
collect clear sysuse auto, clear collect: reg price mpg, r collect: reg price mpg foreign, r collect addtags extra[N], fortags(result[N]#cmdset[1]) collect addtags extra[N], fortags(result[N]#cmdset[2]) collect layout (colname[mpg]#result[_r_b _r_se] extra) (cmdset)
Is there a way to manually add a custom string result to a specific cell in a collect table? Or a better approach to achieve this kind of labeling?
Thank you in advance for any guidance.
Comment