Announcement

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

  • What does dot mean in correlation matrix?

    Hi all,

    when running correlation matrix, I face the situation that the correlation is ".", I am wondering what does it mean?
    Code:
    pwcorr   profits_w1 l_sal_grow_w1 invest_w1 dividend_w1 post1, star(.05)

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	7.3 KB
ID:	1683951




  • #2
    It means the correlation is not estimable with that particular pair of variables. It could be because of missing values or lack of variation in one variable, or both. Without seeing your data we can't say much else, but the correlation matrix makes me think it's mostly due to missing data.
    Last edited by Leonardo Guizzetti; 01 Oct 2022, 14:59.

    Comment


    • #3
      Adding to the advice from Leonardo Guizzetti in post #2,
      Code:
      count if ! missing(post1,sal_grow_w1)
      will tell you how many observations do not have a missing value for either post1 or sal_grow_w1. I expect the count to be 0, or perhaps 1, which is too few observations with which to calculate a correlation.

      Or perhaps one of the variables is constant in all the observations for which the other is not missing.
      Code:
      summarize post1 if !missing(sal_grow_w1)
      summarize sal_grow_w1 if !missing(post1)
      Last edited by William Lisowski; 01 Oct 2022, 15:40.

      Comment


      • #4
        Phuc:
        as an aside to previous helpful advice, your problem is easy to replicate:
        Code:
        . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
        (1978 automobile data)
        
        . g var=.
        (74 missing values generated)
        
        . pwcorr price var mpg
        
                     |    price      var      mpg
        -------------+---------------------------
               price |   1.0000 
                 var |        .        . 
                 mpg |  -0.4686        .   1.0000 
        
        .
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X