Announcement

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

  • Display Format

    Greetings Everyone!

    Hopefully, you all be doing well, I have a question regarding the display format for a table i.e
    Code:
    pwcorr MCDA REALEM DIS_ERM RCFO PROD_RM BIND BEXP BF FD
    
                 |     MCDA   REALEM  DIS_ERM     RCFO  PROD_RM     BIND     BEXP
    -------------+---------------------------------------------------------------
            MCDA |   1.0000 
          REALEM |  -0.0598   1.0000 
         DIS_ERM |  -0.0059   0.2531   1.0000 
            RCFO |  -0.2504   0.7301  -0.0068   1.0000 
         PROD_RM |   0.0398   0.8289   0.0069   0.5848   1.0000 
            BIND |   0.0190  -0.0958   0.0181  -0.0683  -0.1203   1.0000 
            BEXP |  -0.0310  -0.1156  -0.0043  -0.0692  -0.1164   0.1972   1.0000 
              BF |  -0.0020   0.0694   0.0205   0.0687   0.0301  -0.0472  -0.1783 
              FD |   0.0045   0.1195  -0.0089   0.0728   0.1436  -0.1967  -0.0021 
    
                 |       BF       FD
    -------------+------------------
              BF |   1.0000 
              FD |   0.2440   1.0000
    As shown in the table that there is 4 digit after the decimal, I want to reduce it to two-digit, in regression we do that by b(2) t(2), How we will do it in this situation?

    Thanks in Advance

  • #2
    Try:

    Code:
    sysuse auto
    pwcorr price length weight // can't specify format here
    matrix list r(C), format(%6.2f) // can specify format here

    Comment


    • #3
      Originally posted by Sergiy Radyakin View Post
      Try:

      Code:
      sysuse auto
      pwcorr price length weight // can't specify format here
      matrix list r(C), format(%6.2f) // can specify format here
      Kindy Sergiy elaborate it , because it is not working

      Comment


      • #4
        It is not working, is not enough information for us to identify what the problem is. Besides the code given by Sergiy works just fine:
        Code:
        . sysuse auto
        (1978 automobile data)
        
        . pwcorr price length weight // can't specify format here
        
                     |    price   length   weight
        -------------+---------------------------
               price |   1.0000
              length |   0.4318   1.0000
              weight |   0.5386   0.9460   1.0000
        
        . matrix list r(C), format(%6.2f) // can specify format here
        
        symmetric r(C)[3,3]
                 price  length  weight
         price    1.00
        length    0.43    1.00
        weight    0.54    0.95    1.00
        What did you do exactly (emphasis on exactly), and why do you think that it is not working?
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Originally posted by Maarten Buis View Post
          It is not working, is not enough information for us to identify what the problem is. Besides the code given by Sergiy works just fine:
          Code:
          . sysuse auto
          (1978 automobile data)
          
          . pwcorr price length weight // can't specify format here
          
          | price length weight
          -------------+---------------------------
          price | 1.0000
          length | 0.4318 1.0000
          weight | 0.5386 0.9460 1.0000
          
          . matrix list r(C), format(%6.2f) // can specify format here
          
          symmetric r(C)[3,3]
          price length weight
          price 1.00
          length 0.43 1.00
          weight 0.54 0.95 1.00
          What did you do exactly (emphasis on exactly), and why do you think that it is not working?
          Thanks for your comment Maarten, what should I write "can specify format here" after running the code the result was as follows
          Code:
          pwcorr MCDA REALEM DIS_ERM RCFO PROD_RM BIND BEXP BF FD
          
                       |     MCDA   REALEM  DIS_ERM     RCFO  PROD_RM     BIND     BEXP
          -------------+---------------------------------------------------------------
                  MCDA |   1.0000 
                REALEM |  -0.0598   1.0000 
               DIS_ERM |  -0.0059   0.2531   1.0000 
                  RCFO |  -0.2504   0.7301  -0.0068   1.0000 
               PROD_RM |   0.0398   0.8289   0.0069   0.5848   1.0000 
                  BIND |   0.0190  -0.0958   0.0181  -0.0683  -0.1203   1.0000 
                  BEXP |  -0.0310  -0.1156  -0.0043  -0.0692  -0.1164   0.1972   1.0000 
                    BF |  -0.0020   0.0694   0.0205   0.0687   0.0301  -0.0472  -0.1783 
                    FD |   0.0045   0.1195  -0.0089   0.0728   0.1436  -0.1967  -0.0021 
          
                       |       BF       FD
          -------------+------------------
                    BF |   1.0000 
                    FD |   0.2440   1.0000 
          
          . matrix list r(C), format(%6.2f)
          
          symmetric r(C)[2,2]
                FD    FD
          FD  1.00
          FD  1.00  1.00

          Comment


          • #6
            OK, so it looks like you have Stata 13 or less. This is a good illustration why it is so important that you tell us from the very beginning when you have an older version of Stata.

            If you use corr instead of pwcorr, then it should work. corr is probably better than pwcorr anyhow for most applications: If you are displaying a correlation table in your paper, then you want the sample for that table to correspond to the sample used in the later analysis.
            ---------------------------------
            Maarten L. Buis
            University of Konstanz
            Department of history and sociology
            box 40
            78457 Konstanz
            Germany
            http://www.maartenbuis.nl
            ---------------------------------

            Comment


            • #7
              Originally posted by Maarten Buis View Post
              OK, so it looks like you have Stata 13 or less. This is a good illustration why it is so important that you tell us from the very beginning when you have an older version of Stata.

              If you use corr instead of pwcorr, then it should work. corr is probably better than pwcorr anyhow for most applications: If you are displaying a correlation table in your paper, then you want the sample for that table to correspond to the sample used in the later analysis.
              Thank You Mr. Maarten, I got it, it's work on corr.

              Comment


              • #8
                Although I agree with Maarten Buis, which is why I rarely use pwcorr rather than correlate, I note that a quick

                1. copy pwcorr.ado to your space

                2. edit 7.4f to 7.2f

                3. change the program name and save it to a new file with the same name

                seems to work. See also corrci from the Stata Journal.

                Comment


                • #9
                  Originally posted by Nick Cox View Post
                  Although I agree with Maarten Buis, which is why I rarely use pwcorr rather than correlate, I note that a quick

                  1. copy pwcorr.ado to your space

                  2. edit 7.4f to 7.2f

                  3. change the program name and save it to a new file with the same name

                  seems to work. See also corrci from the Stata Journal.
                  Thank you for your comment Mr. Nick

                  Comment

                  Working...
                  X