Announcement

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

  • Combining multiple ttest in one table

    Hello,

    in an exploratory analysis I compared two subpopulations (z being a dummy variable taking the values 0/1) on a set of observables by calculating ttests:

    foreach xvar in a b c d {
    ttest `xvar', by(z)
    }

    I was wondering whether there exists a command that combines the respective means for the different observables and the respective p-values of the ttests into one table:

    a mean_a_0 mean_a_1 p-value_a
    b mean_b_0 mean_b_1 p-value_b
    etc.

    Any hints would be greatly appreciated.

    Best, Michael

  • #2
    Type in Stata the following:
    Code:
    net from http://www.adeptanalytics.org/radyakin/stata/ttesttab/
    See the help file in the above package ttesttab.

    Regards, Sergiy Radyakin

    Comment


    • #3
      Thanks a lot for your help.

      Comment


      • #4
        By the way: is there an equivalent stata command for ranksum or chi2 in Stata? Eg:

        foreach xvar in a b c d {
        tab `xvar' z, chi2
        }

        foreach xvar in a b c d {
        ranksum `xvar', by(z)
        }

        Or a command that returns a table which compares two subpopulations on a set of observables using two-sample t-tests, ranksum test as well as chi2-tests (because eg for some observables the normality assumption is violated)? Your help would be greatly appreciated.

        Best, Michael


        Comment

        Working...
        X