官术网_书友最值得收藏!

  • R Programming By Example
  • Omar Trejo Navarro
  • 301字
  • 2021-07-02 21:30:41

Using matrix scatter plots for a quick overview

What happens if we want to visualize a lot of scatter plots in a single graph to quickly get a sense for the data? In that case, we need matrix scatter plots. We have various package options to create such matrix scatter plots (such as the car package). However, to keep things simple, we will use a built-in function instead of an external package.

By looking at the graph shown below, we can get a big-picture view of the interactions among variables. The purpose of this type of visualization is not to provide details, but to provide a general overview. To read this plot we need to look at any interesting scatter plot in the matrix, and move both horizontally and vertically until we find the name associated with its axis.

For example, if you look at the plot immediately to the right of NoQuals and simultaneously immediately on top of L4Quals_plus, what you're looking at is at the relation between those two variables (NoQuals in the y axis, L4Quals_plus in the x axis), and we find that it's an inverse relation; the higher the percentage of people in a ward with high levels of education, the lower the percentage of people with low levels of education. Another obvious relation is that the higher the education level (L4Quals_plus), the higher the occupation (HigherOccup).

Matrix scatter plot

Due to space restrictions, we were not able to show all variable relations, since the scatter plots would be too small to make sense of. However, we encourage the reader to add more variables to the matrix. There are some non-obvious relations. Finding them is left as an exercise for the reader:

desired_variables <- c(
    "AdultMeanAge",
    "White",
    "Owned",
    "NoQuals",
    "L4Quals_plus",
    "Unemp",
    "HigherOccup",
    "Deprived",
    "Proportion"
)
pairs(data[, desired_variables])
主站蜘蛛池模板: 二连浩特市| 昌图县| 临桂县| 阿拉善右旗| 瑞昌市| 绥宁县| 惠水县| 曲麻莱县| 大余县| 沅江市| 萍乡市| 克山县| 广灵县| 杭锦旗| 太白县| 吴川市| 长垣县| 额尔古纳市| 焉耆| 东乡| 兴城市| 奎屯市| 涪陵区| 宁化县| 娱乐| 曲靖市| 余姚市| 水城县| 三明市| 邮箱| 垫江县| 霞浦县| 宣威市| 霍州市| 普洱| 繁昌县| 新化县| 新营市| 苍南县| 保康县| 桃园市|