Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Visualization of R correlation Matrix

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

In this article, the editor introduces in detail "how to achieve R-related matrix visualization". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to achieve R-related matrix visualization" can help you solve your doubts. Let's follow the editor's ideas to learn new knowledge.

The correlation is a non-deterministic relationship, and the correlation coefficient is the quantity that studies the degree of linear correlation between variables.

The formula for solving the correlation coefficient is shown in the figure:

If there are two variables, X and Y, the meaning of the final correlation coefficient can be understood as follows:

The main results are as follows: (1) when the correlation coefficient is 0, there is no relationship between X and Y.

(2) when the value of X increases (decreases), the value of Y increases (decreases), the two variables are positively correlated, and the correlation coefficient is between 0.00 and 1.00.

(3) when the value of X increases (decreases), the value of Y decreases (increases), the two variables are negatively correlated, and the correlation coefficient is between-1.00 and 0.00.

The larger the absolute value of the correlation coefficient is, the stronger the correlation is, the closer the correlation coefficient is to 1 or-1, the stronger the correlation degree is, the closer the correlation coefficient is to 0, the weaker the correlation degree is.

In general, the correlation strength of a variable is judged by the following range of values:

0.8-1.0 strong correlation

0.6-0.8 strong correlation

0.4-0.6 moderate correlation

0.2-0.4 weak correlation

0.0-0.2 very weak correlation or no correlation

The variables we selected are shown in the following figure:

Visualization of correlation Matrix by R Software

The darker the color is, the greater the correlation is, the stronger the correlation is. Taking x1 and x4 as examples, the correlation coefficient is 0.99, and the correlation is very strong.

Dvdf

# R program

Install.packages ("ggcorrplot")

Library (ggcorrplot)

# calculation correlation matrix (cor () calculation results do not provide p-value)

Data

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report