I have seen another post where they discuss about how to create a table like this:

I got to create a table with de t-tes, but I don't know the right code to get the right column for p value Wilcoxon test. My code is the following one:
eststo español: quietly estpost summarize EDADa SEXOa estado_civil CLASE_PR IMCn diabetes_self asma_self infarto_self if pais_nacimiento == 1
eststo extranjero: quietly estpost summarize EDADa SEXOa estado_civil CLASE_PR IMCn diabetes_self asma_self infarto_self if pais_nacimiento == 2
eststo diff: quietly estpost ttest EDADa SEXOa estado_civil CLASE_PR IMCn diabetes_self asma_self infarto_self, by(pais_nacimiento) unequal
foreach v of var EDADa SEXOa estado_civil CLASE_PR IMCn diabetes_self asma_self infarto_self {
eststo quietly ranksum `v', by(pais_nacimiento) porder
scalar pval = 2*normprob(-abs(r(z)))
di "`v'{col 14}" %05.3f pval " " %6.4e pval " " %05.3f r(porder)
}
esttab español extranjero diff diff2, cells("mean(pattern(1 1 0 0) fmt(3)) sd(pattern(1 1 0 0)) b(star pattern(0 0 0 0) fmt(3)) t(pattern(0 0 1 0) par fmt(3)) p(pattern(0 0 1 1) par fmt(%5.4f))") label
Any suggestion???
I got to create a table with de t-tes, but I don't know the right code to get the right column for p value Wilcoxon test. My code is the following one:
eststo español: quietly estpost summarize EDADa SEXOa estado_civil CLASE_PR IMCn diabetes_self asma_self infarto_self if pais_nacimiento == 1
eststo extranjero: quietly estpost summarize EDADa SEXOa estado_civil CLASE_PR IMCn diabetes_self asma_self infarto_self if pais_nacimiento == 2
eststo diff: quietly estpost ttest EDADa SEXOa estado_civil CLASE_PR IMCn diabetes_self asma_self infarto_self, by(pais_nacimiento) unequal
foreach v of var EDADa SEXOa estado_civil CLASE_PR IMCn diabetes_self asma_self infarto_self {
eststo quietly ranksum `v', by(pais_nacimiento) porder
scalar pval = 2*normprob(-abs(r(z)))
di "`v'{col 14}" %05.3f pval " " %6.4e pval " " %05.3f r(porder)
}
esttab español extranjero diff diff2, cells("mean(pattern(1 1 0 0) fmt(3)) sd(pattern(1 1 0 0)) b(star pattern(0 0 0 0) fmt(3)) t(pattern(0 0 1 0) par fmt(3)) p(pattern(0 0 1 1) par fmt(%5.4f))") label
Any suggestion???
Comment