Announcement

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

  • How to add more decimal points to p-values?

    Hi everyone! I'm running several logistic regressions and I was wondering if there was any way to get more decimal places for p-values? I am using the Bonferroni correction so I want to make sure I have enough decimal points.

    Thank you!

  • #2
    There is a -set pformat- command that modifies the number of decimal places in the regression outputs. See -help pformat- for details. But the most you can get with that is 4 decimal places, which may not be enough for your purposes, and isn't much different from the default display of 3 decimal places.

    But you can also pull the pvalues out of the -r(table)- matrix that is left behind after regression, and if you don't like the way they are displayed there, you can always -display- them yourself with the desired format. For example
    Code:
    sysuse auto, clear
    regress price mpg
    matrix list r(table)
    display %12.11f r(table)[4, 1]

    Comment


    • #3
      Good morning Clyde, thank you very much for your tips.
      I wanted to know how I can get the p-value fully displayed after running the "pwcorr" command (for correlation). It does not appear in the list of stored results/outputs.
      Thanks in advance.

      Comment


      • #4
        The sig option for pwcorr displays P-values.

        Comment


        • #5
          Thank you, Nick. I see that but my p values are very small and I only see 5 zeros after the comma. I wanted to display more decimal places so that I can convert the value into the corresponding scientific notation (requested by a reviewer).

          Comment


          • #6
            If you want P-values in more detail AND also the number of non-missing values varies from correlation to correlation, then I know no alternative beyond looping over pairs of variables and showing each P-value as well as the number of values used and the correlation itself.

            In many fields, but not all, once you know that the P-value is <0.00005 you stop caring. The P-value is often dubious on other grounds any way, e.g. lack of independence.

            Comment


            • #7
              Thank you very much! Have a great day!

              Comment


              • #8
                I think I found the answer. If not mistaken, the command below provides the scientific notation of the p-value.

                Code:
                matrix list r(sig)

                Comment


                • #9
                  You're right!

                  Comment

                  Working...
                  X