Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wilcoxon Test with Esttab command?

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

    Click image for larger version

Name:	image_15900.jpg
Views:	1
Size:	51.6 KB
ID:	1736291


    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???

  • #2
    Ernesto:
    I guess that the post you're referring to (and whose link would have been beneficial to avoid guess-work) possibly pointed out to the -table- suite, available from Stata 17.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo, this is the link to the post I refer. I´m new in statalist, sorr for that. https://www.statalist.org/forums/for...rence-in-means

      Comment


      • #4
        Ernesto:
        the post you're referring to (thanks for the link. No worries, even after many years I'm still learning enormously from the Stata community) dates back to an era when -table- suite was not available.
        If you are using Stata 17 at least, just take a look at the -table- entry in Stata .pdf manual and skim trough the worked out examples.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          thanks Carlo!!

          Comment

          Working...
          X