There is something in how Stata 16 is set in my computer that makes the following code not to work as it should:
eststo Agreementx_gets_face: reg Agreementx_gets Forced i.round_dummy if face==1 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) qui estadd local Sample="Face-to-Face" eststo Agreementx_gets_ele: reg Agreementx_gets Forced i.round_dummy if face==0 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) qui estadd local Sample="Electronic" eststo auto_exploitation_face: reg auto_exploitation Forced i.round_dummy if face==1 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) qui estadd local Sample="Face-to-Face" eststo auto_exploitation_ele: reg auto_exploitation Forced i.round_dummy if face==0 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) qui estadd local Sample="Electronic" esttab Agreementx_gets_face Agreementx_gets_ele auto_exploitation_face auto_exploitation_ele /// using "$latex/reg_x_earnings.tex", replace /// keep (Forced) /// b(2) se(2) star(* 0.10 ** 0.05 *** .01) /// nomtitles collabels(none) /// noobs nocons booktabs nonotes /// stats(N N_clust meanc Sample, fmt(%9.0fc 0 2 0) labels("Observations" "Num. Clusters" "Dep. Var. Mean" "Sample")) eststo clear
In the computer of my research assistant, the code works properly and I get this table:
{ \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}{l*{4}{c}} \toprule &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\ multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\ &\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}\\ \midrule Forced & -115.01\sym{**} & 12.93 & 0.29\sym{***}& 0.01 \\ & (44.46) & (43.32) & (0.09) & (0.10) \\ \midrule Observations& 276 & 260 & 276 & 260 \\ Num. Clusters& 85 & 88 & 85 & 88 \\ Dep. Var. Mean& 1165.18 & 1172.06 & 0.42 & 0.42 \\ Sample &Face-to-Face & Electronic &Face-to-Face & Electronic \\ \bottomrule \end{tabular} }
However, when we run the code in my computer, I only get the local variable that I define first (whichever it is). The way the code is written, I get this (the last row is missing):
{ \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}{l*{4}{c}} \toprule &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\ multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\ &\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}\\ \midrule Forced & -115.01\sym{**} & 12.93 & 0.29\sym{***}& 0.01 \\ & (44.46) & (43.32) & (0.09) & (0.10) \\ \midrule Observations& 276 & 260 & 276 & 260 \\ Num. Clusters& 85 & 88 & 85 & 88 \\ Dep. Var. Mean& 1165.18 & 1172.06 & 0.42 & 0.42 \\ Sample & & & & \\ \bottomrule \end{tabular} }
On the contrary, if I define first the Sample then the mean:
eststo Agreementx_gets_face: reg Agreementx_gets Forced i.round_dummy if face==1 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui estadd local Sample="Face-to-Face" qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) eststo Agreementx_gets_ele: reg Agreementx_gets Forced i.round_dummy if face==0 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui estadd local Sample="Electronic" qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) eststo auto_exploitation_face: reg auto_exploitation Forced i.round_dummy if face==1 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui estadd local Sample="Face-to-Face" qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) eststo auto_exploitation_ele: reg auto_exploitation Forced i.round_dummy if face==0 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui estadd local Sample="Electronic" qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) esttab Agreementx_gets_face Agreementx_gets_ele auto_exploitation_face auto_exploitation_ele /// using "$latex/reg_x_earnings.tex", replace /// keep (Forced) /// b(2) se(2) star(* 0.10 ** 0.05 *** .01) /// nomtitles collabels(none) /// noobs nocons booktabs nonotes /// stats(N N_clust meanc Sample, fmt(%9.0fc 0 2 0) labels("Observations" "Num. Clusters" "Dep. Var. Mean" "Sample")) eststo clear
I get the opposite problem (the second to last row is missing):
{ \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}{l*{4}{c}} \toprule &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\ multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\ &\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}\\ \midrule Forced & -115.01\sym{**} & 12.93 & 0.29\sym{***}& 0.01 \\ & (44.46) & (43.32) & (0.09) & (0.10) \\ \midrule Observations& 276 & 260 & 276 & 260 \\ Num. Clusters& 85 & 88 & 85 & 88 \\ Dep. Var. Mean& & & & \\ Sample &Face-to-Face & Electronic &Face-to-Face & Electronic \\ \bottomrule \end{tabular} }
This extends to other similar tables, and persists no matter whether I define variables as scalars, locals, or globals. Most importantly, it does not happen on the computer of my research assistants, so I guess it has to do with Stata settings in my computer.
I would very much appreciate your help.
eststo Agreementx_gets_face: reg Agreementx_gets Forced i.round_dummy if face==1 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) qui estadd local Sample="Face-to-Face" eststo Agreementx_gets_ele: reg Agreementx_gets Forced i.round_dummy if face==0 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) qui estadd local Sample="Electronic" eststo auto_exploitation_face: reg auto_exploitation Forced i.round_dummy if face==1 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) qui estadd local Sample="Face-to-Face" eststo auto_exploitation_ele: reg auto_exploitation Forced i.round_dummy if face==0 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) qui estadd local Sample="Electronic" esttab Agreementx_gets_face Agreementx_gets_ele auto_exploitation_face auto_exploitation_ele /// using "$latex/reg_x_earnings.tex", replace /// keep (Forced) /// b(2) se(2) star(* 0.10 ** 0.05 *** .01) /// nomtitles collabels(none) /// noobs nocons booktabs nonotes /// stats(N N_clust meanc Sample, fmt(%9.0fc 0 2 0) labels("Observations" "Num. Clusters" "Dep. Var. Mean" "Sample")) eststo clear
In the computer of my research assistant, the code works properly and I get this table:
{ \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}{l*{4}{c}} \toprule &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\ multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\ &\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}\\ \midrule Forced & -115.01\sym{**} & 12.93 & 0.29\sym{***}& 0.01 \\ & (44.46) & (43.32) & (0.09) & (0.10) \\ \midrule Observations& 276 & 260 & 276 & 260 \\ Num. Clusters& 85 & 88 & 85 & 88 \\ Dep. Var. Mean& 1165.18 & 1172.06 & 0.42 & 0.42 \\ Sample &Face-to-Face & Electronic &Face-to-Face & Electronic \\ \bottomrule \end{tabular} }
However, when we run the code in my computer, I only get the local variable that I define first (whichever it is). The way the code is written, I get this (the last row is missing):
{ \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}{l*{4}{c}} \toprule &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\ multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\ &\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}\\ \midrule Forced & -115.01\sym{**} & 12.93 & 0.29\sym{***}& 0.01 \\ & (44.46) & (43.32) & (0.09) & (0.10) \\ \midrule Observations& 276 & 260 & 276 & 260 \\ Num. Clusters& 85 & 88 & 85 & 88 \\ Dep. Var. Mean& 1165.18 & 1172.06 & 0.42 & 0.42 \\ Sample & & & & \\ \bottomrule \end{tabular} }
On the contrary, if I define first the Sample then the mean:
eststo Agreementx_gets_face: reg Agreementx_gets Forced i.round_dummy if face==1 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui estadd local Sample="Face-to-Face" qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) eststo Agreementx_gets_ele: reg Agreementx_gets Forced i.round_dummy if face==0 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui estadd local Sample="Electronic" qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) eststo auto_exploitation_face: reg auto_exploitation Forced i.round_dummy if face==1 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui estadd local Sample="Face-to-Face" qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) eststo auto_exploitation_ele: reg auto_exploitation Forced i.round_dummy if face==0 & (Forced==1 | Baseline==1), vce(cluster Participant_id) qui estadd local Sample="Electronic" qui sum Agreementx_gets if e(sample)==1 qui estadd scalar meanc r(mean) esttab Agreementx_gets_face Agreementx_gets_ele auto_exploitation_face auto_exploitation_ele /// using "$latex/reg_x_earnings.tex", replace /// keep (Forced) /// b(2) se(2) star(* 0.10 ** 0.05 *** .01) /// nomtitles collabels(none) /// noobs nocons booktabs nonotes /// stats(N N_clust meanc Sample, fmt(%9.0fc 0 2 0) labels("Observations" "Num. Clusters" "Dep. Var. Mean" "Sample")) eststo clear
I get the opposite problem (the second to last row is missing):
{ \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}{l*{4}{c}} \toprule &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\ multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\ &\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{Decider's Profits}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}&\multicolumn{1}{c}{$\mathds{1}($ Decider's Profits$<x)$}\\ \midrule Forced & -115.01\sym{**} & 12.93 & 0.29\sym{***}& 0.01 \\ & (44.46) & (43.32) & (0.09) & (0.10) \\ \midrule Observations& 276 & 260 & 276 & 260 \\ Num. Clusters& 85 & 88 & 85 & 88 \\ Dep. Var. Mean& & & & \\ Sample &Face-to-Face & Electronic &Face-to-Face & Electronic \\ \bottomrule \end{tabular} }
This extends to other similar tables, and persists no matter whether I define variables as scalars, locals, or globals. Most importantly, it does not happen on the computer of my research assistants, so I guess it has to do with Stata settings in my computer.
I would very much appreciate your help.
Comment