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 use scatterplotMatrix in R language to draw scatter plot matrix

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

Share

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

This article is about how to use scatterplotMatrix in R language to draw scatter map matrix, the editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

Before using R software to do correlation coefficient matrix heat map, see using corrplot in R language to draw correlation coefficient matrix heat map, now to introduce the use of R language scatterplotMatrix to draw scatter plot matrix, a relatively simple command can be applied to the analysis of multivariables.

Take the house price data of Boston in Boston as an example, which is commonly used in data mining and machine learning. It can be downloaded from UCI's machine learning database: https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data

The dataset has 506 observation samples and 14 variables:

Image

First, import the data into the R software:

> mydata summary (mydata)

Next, install the car package and analyze the scatter matrix:

> install.packages ("car")

> library (car)

ScatterplotMatrix (mydata,spread=FALSE,lty.smooth=2,main= "Scatter Plot Matrix")

The result is shown in the figure:

Image

From the scatter chart, we can see that the line of MEDV and the variable MEDV have a linear trend, including: ZN, RM, BRATIO, LSTAT.

The above is how to use scatterplotMatrix in R language to draw scatter matrix. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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