cor shows only NA or 1 for correlations - Why?

后端 未结 6 1245
别那么骄傲
别那么骄傲 2020-12-08 07:03

I\'m running cor() on a data.framewith all numeric values and I\'m getting this as the result:

       price exprice...
price      1         


        
6条回答
  •  鱼传尺愫
    2020-12-08 07:24

    The NA can actually be due to 2 reasons. One is that there is a NA in your data. Another one is due to there being one of the values being constant. This results in standard deviation being equal to zero and hence the cor function returns NA.

提交回复
热议问题