Announcement

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

  • Extracting p-values for multiple comparisons correction

    Dear All,

    I have been trying to extract and export p-values from the kruskall-wallis test, unfortunately to no avail.

    I have a factor variable with 8 levels (coded 1 through 8) and 90 continuous variables.

    I want to extract all 90 p-values (and perhaps export them to .txt/excel?) to perform a multiple comparisons correction.

    While the ttest command saves the p-value, the kwallis command does not. Do you have any suggestions? Thank you!

    Best,

    Jasper

  • #2
    Well, -kwallis- save the chi2 statistic in r(chi2) and the degrees of freedom in r(df). So the pvalue is just chi2tail(r(df), r(chi2)). (If you want the p-value that is adjusted for ties, use r(chi2_adj) instead of r(chi2).)

    That said, it is bad practice to do any kind of analysis in Excel. Do your multiple comparisons correction calculations in Stata and then export the results to Excel. Excel leaves no audit trail of what you do. It really should be used only for displaying data, or as a way of exchanging data sets with people who use different statistical software from what you use. But it is simply not suitable as an analytic tool.
    Last edited by Clyde Schechter; 06 Feb 2017, 22:44.

    Comment


    • #3
      Within Stata you can use _mtest to do the adjustments for you, see help _mtest.
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment

      Working...
      X