Dear all,
is there any elegant way to plot a table filled with estimates from ttest and sum commands?
Currently, I am doing it manually, however I guess a more professional solution is achievable. First, the output table could be presented without the comands in between and second, ideally, the table would be exportable to tex and xls, e.g. with the logout command.
I am looking forward receiving helpful suggestions on how to improve my code.
Best
Christian
is there any elegant way to plot a table filled with estimates from ttest and sum commands?
Currently, I am doing it manually, however I guess a more professional solution is achievable. First, the output table could be presented without the comands in between and second, ideally, the table would be exportable to tex and xls, e.g. with the logout command.
I am looking forward receiving helpful suggestions on how to improve my code.
Best
Christian
Code:
*Store t-values and sample size qui ttest portfolio_size == 0 if sample_small == 1 local 1_n = r(N_1) local 1_t = r(t) qui ttest portfolio_size == 0 if sample_small == 1 & portfolio_size > 2 local 2_n = r(N_1) local 2_t = r(t) qui ttest portfolio_size == 0 if sample_small == 1 & portfolio_size > 5 local 3_n = r(N_1) local 3_t = r(t) qui ttest portfolio_size == 0 if sample_small == 1 & portfolio_size > 10 local 4_n = r(N_1) local 4_t = r(t) *Store PP and SD sum prox_pref if sample_small == 1 local 1_pp = r(mean) local 1_sd = r(sd) sum prox_pref if sample_small == 1 & portfolio_size > 2 local 2_pp = r(mean) local 2_sd = r(sd) sum prox_pref if sample_small == 1 & portfolio_size > 5 local 3_pp = r(mean) local 3_sd = r(sd) sum prox_pref if sample_small == 1 & portfolio_size > 10 local 4_pp = r(mean) local 4_sd = r(sd) *Store TAD sum distance_actual if sample_small == 1 local 1_tad = r(mean) sum distance_actual if sample_small == 1 & portfolio_size > 2 local 2_tad = r(mean) sum distance_actual if sample_small == 1 & portfolio_size > 5 local 3_tad = r(mean) sum distance_actual if sample_small == 1 & portfolio_size > 10 local 4_tad = r(mean) *Display noisily display _column(1) "Portf.-size" _column(20) "n" _column(30) "avg. PP" _column(40) "s.d." _column(50) "t-value" _column(65) "avg. TAD" _column(80) "avg. PP / avg. TAD" noisily display _column(1) ">= 1+1" _column(20)"`1_n'" _column(30) string(round(`1_pp',0.1)) _column(40) string(round(`1_sd',0.1)) _column(50) string(round(`1_t',0.01)) _column(65) string(round(`1_tad',0.1)) _column(80) string(round((`1_pp'/`1_tad')*100,0.1)) noisily display _column(1) ">= 2+1" _column(20)"`2_n'" _column(30) string(round(`2_pp',0.1)) _column(40) string(round(`2_sd',0.1)) _column(50) string(round(`2_t',0.01)) _column(65) string(round(`2_tad',0.1)) _column(80) string(round((`2_pp'/`2_tad')*100,0.1)) noisily display _column(1) ">= 5+1" _column(20)"`3_n'" _column(30) string(round(`3_pp',0.1)) _column(40) string(round(`3_sd',0.1)) _column(50) string(round(`3_t',0.01)) _column(65) string(round(`3_tad',0.1)) _column(80) string(round((`3_pp'/`3_tad')*100,0.1)) noisily display _column(1) ">= 10+1" _column(20)"`4_n'" _column(30) string(round(`4_pp',0.1)) _column(40) string(round(`4_sd',0.1)) _column(50) string(round(`4_t',0.01)) _column(65) string(round(`4_tad',0.1)) _column(80) string(round((`4_pp'/`4_tad')*100,0.1))
Comment