Hi statalist user
I also want to use esttab for ttest outputs but I am running more than one variable at once using codes below, however the output come with only one variable(the first one). I am sure i missed something in the codes.
foreach var of varlist seed_bought seed_free seed_agrodealer s4a_23a s4a_23b {
estpost ttest `var', by(s2_16)
matrix ttest= (r(mu_1),r(sd_1),r(N_1),r(mu_2),r(sd_2),r(N_2),r(m u_2) - r(mu_1),r(p))
matrix rownames ttest= `var'
matrix colnames ttest= Mean1 sd1 N1 mean2 sd2 N2 mean_differences pscore
esttab `var' using "$dir/output/seeds_source.csv", cells(mu_1 mu_2 t p) wide nonumber star(* 0.1 ** 0.05 *** 0.01)
}
I also want to use esttab for ttest outputs but I am running more than one variable at once using codes below, however the output come with only one variable(the first one). I am sure i missed something in the codes.
foreach var of varlist seed_bought seed_free seed_agrodealer s4a_23a s4a_23b {
estpost ttest `var', by(s2_16)
matrix ttest= (r(mu_1),r(sd_1),r(N_1),r(mu_2),r(sd_2),r(N_2),r(m u_2) - r(mu_1),r(p))
matrix rownames ttest= `var'
matrix colnames ttest= Mean1 sd1 N1 mean2 sd2 N2 mean_differences pscore
esttab `var' using "$dir/output/seeds_source.csv", cells(mu_1 mu_2 t p) wide nonumber star(* 0.1 ** 0.05 *** 0.01)
}
Comment