Announcement

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

  • Correlation output with two decimals

    Dear statalisters,

    When I run the code
    Code:
    pwcorr varlist, star (0.05) .
    the output are with 4 decimals.

    My questions are, are there any code to get the output with two decimals only? (rounded to the second decimal) and,
    are there any way to get stars for (0.1 0.05 and 0.01) at the same output?

    Thank you so much for your help.

    Best regards,

    Alejandro

  • #2
    Hello Alejandro. How about this?

    Code:
    sysuse auto, clear
    quietly pwcorr trunk weight length turn, star (0.05)
    matrix list r(C), format(%4.2f)
    Output:

    Code:
    . matrix list r(C), format(%4.2f)
    
    symmetric r(C)[4,4]
             trunk  weight  length    turn
     trunk    1.00
    weight    0.67    1.00
    length    0.73    0.95    1.00
      turn    0.60    0.86    0.86    1.00

    --
    Bruce Weaver
    Email: [email protected]
    Version: Stata/MP 19.5 (Windows)

    Comment


    • #3
      Dear Bruce,
      Thank you very much for your answer, I am going to try it right now and will let you know.
      Thank you again,

      Alejandro

      Comment


      • #4
        Dear Bruce,
        there are not stars in the output, I tried to add star(0.05) after format(%4.2f) but didn't work.
        Do you know what could be happening?
        Thank you again for your time,

        Alejandro

        Comment


        • #5
          You won't be able to show the stars with that method. You might find something useful in this old thread: For more info about the -cpcorr- command mentioned there:

          net describe cpcorr, from(http://fmwww.bc.edu/RePEc/bocode/c)

          HTH.
          --
          Bruce Weaver
          Email: [email protected]
          Version: Stata/MP 19.5 (Windows)

          Comment


          • #6
            Dear Bruce,

            Thank you very much for your help again.
            Best regards !!
            Paulo

            Comment


            • #7
              Months ago I posted in the "Wishlist for Stata 16" thread a suggestion that the -cformat- specification used to format regression output should be expanded to apply to other types of results like correlation matrixes. Evidently the suggestion wasn't implemented in v16.0.

              Comment


              • #8
                The American Statistical Association has recommended that the use of the concept of statistical significance be abandoned. See https://www.tandfonline.com/doi/full...5.2019.1583913. The use of statistical significance stars is a particularly egregious use of this now banished concept.

                Comment


                • #9
                  Originally posted by John Mullahy View Post
                  Months ago I posted in the "Wishlist for Stata 16" thread a suggestion that the -cformat- specification used to format regression output should be expanded to apply to other types of results like correlation matrixes. Evidently the suggestion wasn't implemented in v16.0.
                  In fact, that is the first thing I tried when I read the original post. Unfortunately, it did not work.
                  --
                  Bruce Weaver
                  Email: [email protected]
                  Version: Stata/MP 19.5 (Windows)

                  Comment


                  • #10
                    Thank you Bruce Weaver for this answer! It really helped me out just now.

                    Comment

                    Working...
                    X