Skip to content

Commit

Permalink
iebaltab : add pair(se) pair(sd)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbjarkefur committed May 2, 2022
1 parent 11d283b commit f9b2a26
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
28 changes: 26 additions & 2 deletions run/iebaltab.do
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
restore

/***************************************************************************
Table 14 - test pair and f stats preferences
Table 14 - test showing no pair tests
***************************************************************************/
preserve

Expand All @@ -412,4 +412,28 @@
ie_test_mat_nomiss, mat1(mat1) mat2(mat2)
restore


/***************************************************************************
Table 15 - more test pair stats preferences
***************************************************************************/
preserve

local tnum 15
local csvfile "iebt-csv`tnum'"
local exlfile "iebt-xlsx`tnum'"
local texfile "iebt-tex`tnum'"
local txnfile "iebt-tex`tnum'-note"

iebaltab weight price , grpvar(tmt_cl) replace ///
ftest control(1) ///
savecsv("${out_fldr}/`csvfile'") ///
savexlsx("${out_fldr}/`exlfile'") ///
savetex("${out_fldr}/`texfile'") ///
texnotefile("${out_fldr}/`txnfile'") ///
stats(pair(se)) ///
cov(mpg) fixed(foreign)

* Test no regaular missing values in matrices
mat mat1 = r(iebaltabrmat)
mat mat2 = r(iebaltabfmat)
ie_test_mat_nomiss, mat1(mat1) mat2(mat2)
restore
14 changes: 14 additions & 0 deletions run/tex_masterfiles/iebaltab_tex_master.tex
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,18 @@
\end{adjustbox}
\end{table}

% Table 15
\begin{table}
\centering
\caption{File iebt-tex15}
\begin{adjustbox}{max width=\textwidth}
\begin{threeparttable}[!h]
\input{../output/iebaltab/iebt-tex15.tex}
\begin{tablenotes}[flushleft]
\item\hspace{-.25em}\input{../output/iebaltab/iebt-tex15-note}
\end{tablenotes}
\end{threeparttable}
\end{adjustbox}
\end{table}

\end{document}
10 changes: 8 additions & 2 deletions src/ado_files/iebaltab.ado
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,10 @@ qui {
test `dummy_pair_`ttest_pair''
mat row[1,`++colindex'] = r(p)

*Store standard error and standard deviation
mat row[1,`++colindex'] = `se_this_pair'
mat row[1,`++colindex'] = `sd_this_pair'

*Calculate and store the normalized difference
mat row[1,`++colindex'] = el(row,1,colnumb(row,"diff_`ttest_pair'")) / `sd_this_pair'
}
Expand Down Expand Up @@ -2025,7 +2029,7 @@ cap program drop setUpResultMatrix

*Locals with stats names for each category
local desc_stats = "n cl mean se sd"
local pair_stats = "diff n cl beta t p nrmd"
local pair_stats = "diff n cl beta t p se sd nrmd"
local feq_stats = "feqn feqcl feqf feqp"
local ftest_stats = "fn fcl ff fp"

Expand Down Expand Up @@ -2110,7 +2114,7 @@ cap program drop parse_and_clean_stats
local allowed_test_names "pair f feq"

*List allowed test names
local allowed_pair_stats "diff beta nrmd t p none"
local allowed_pair_stats "diff beta t p nrmd se sd none"
local allowed_f_stats "f p"
local allowed_feq_stats "f p"

Expand Down Expand Up @@ -2216,6 +2220,8 @@ cap program drop get_stat_label_stats_string
local pair_nrmd_label "Normalized difference"
local pair_t_label "t-statistics"
local pair_p_label "P-value"
local pair_se_label "Standard error"
local pair_sd_label "Standard deviation"
local pair_none_label "none"

* F-test stat labels
Expand Down

0 comments on commit f9b2a26

Please sign in to comment.