Announcement

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

  • how do I adjust decimals in PWCORR

    I know some options like corrtab mkcorr allow adjustment of decimals, but I also need stars for significance. Thanks!

  • #2
    Concerning pwcorr you should simply do what the help for pwcorr says: Use the sig and star options:
    Code:
    sysuse auto, clear
    pwcorr price headroom mpg displacement, sig star(0.05)

    Comment


    • #3
      I need to only keep two decimals in pwcorr, which doesn't seem to allow it.

      Comment


      • #4
        You can help yourself and could save the pairwise correlations in a matrix which elements are rounded to two decimals.

        Code:
        sysuse auto, clear
        corr price mpg headroom
        matrix A = r(C)
        matrix C = J(3, 3, 0)
        forvalues i=1/3 {
            forvalues j=1/3 {
                matrix C[`i',`j']= round(A[`i',`j'], 0.01)    
            }
        }
        matrix list C
        To add significance levels you could run univariate regressions for each pair and save the p-value of the Ftail(1, e(N), e(F)). If you further wish to add stars for the significance levels -- what seems redundant given that you already state p-values, you can work with if/else statements in the loop.

        Comment

        Working...
        X