Announcement

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

  • How to display multiple stars in correlation matrix

    I have generated a Pearson correlation matrix using the pwcorr command.

    Could anyone help me out with a way to display one or several stars
    depending on the significance level?
    E.g.: * for p<0.05 and ** for p<0.001.

    Thank you In advance

  • #2
    Dear Badar,

    This is the example provided in http://repec.org/bocode/e/estout/est...tml#estpost112 using the user-written estout package. In that page you will find further details on how to use estout and its different features.

    Code:
    . sysuse auto
    (1978 Automobile Data)
    
    . estpost correlate price turn foreign rep78, matrix listwise
    
                 |      e(b)     e(rho)       e(p)   e(count) 
    -------------+--------------------------------------------
    price        |                                            
           price |         1          1                    69 
            turn |  .3302013   .3302013   .0055897         69 
         foreign | -.0173639  -.0173639   .8873872         69 
           rep78 |  .0065533   .0065533     .95738         69 
    turn         |                                            
            turn |         1          1                    69 
         foreign |  -.676836   -.676836   1.72e-10         69 
           rep78 | -.4961308  -.4961308   .0000146         69 
    foreign      |                                            
         foreign |         1          1                    69 
           rep78 |  .5922369   .5922369   8.31e-08         69 
    rep78        |                                            
           rep78 |         1          1                    69 
    
    . esttab, unstack not noobs compress
    
    --------------------------------------------------------------
                     (1)                                          
                                                                  
                   price         turn      foreign        rep78   
    --------------------------------------------------------------
    price              1                                          
    turn           0.330**          1                             
    foreign      -0.0174       -0.677***         1                
    rep78        0.00655       -0.496***     0.592***         1   
    --------------------------------------------------------------
    * p<0.05, ** p<0.01, *** p<0.001
    
    . 
    end of do-file

    Comment


    • #3
      Dear Enrigue - Thank you very much for you reply and the example which I found so useful. the issue is solved.

      Comment


      • #4
        Dear Enrigue - How I can I determine the significance levels based on the levels I want. estout package has default significance leveIs which are * p<0.05, ** p<0.01, *** p<0.001. However, I would like to determine the significance level at * 10%, ** 5% and *** 1%..

        Please have look on the commands and the results that I have got

        . estpost correlate MF_Board MF_AUD MF_COM MF_NOM ,matrix listwise
        | e(b) e(rho) e(p) e(count)
        -------------+--------------------------------------------
        MF_Board |
        MF_Board | 1 1 3500
        MF_AUD | .1912578 .1912578 3.46e-30 3500
        MF_COM | .1178301 .1178301 2.69e-12 3500
        MF_NOM | .1063175 .1063175 2.87e-10 3500
        MF_AUD |
        MF_AUD | 1 1 3500
        MF_COM | .4905427 .4905427 2.2e-211 3500
        MF_NOM | .3753164 .3753164 1.7e-117 3500
        MF_COM |
        MF_COM | 1 1 3500
        MF_NOM | .6459245 .6459245 0 3500
        MF_NOM |
        MF_NOM | 1 1 3500

        . esttab, unstack not noobs compress
        --------------------------------------------------------------
        (1)

        MF_Board MF_AUD MF_COM MF_NOM
        --------------------------------------------------------------
        MF_Board 1
        MF_AUD 0.191*** 1
        MF_COM 0.118*** 0.491*** 1
        MF_NOM 0.106*** 0.375*** 0.646*** 1
        --------------------------------------------------------------
        * p<0.05, ** p<0.01, *** p<0.001
        .


        Thank you in advance..

        Comment

        Working...
        X