Analysis in R:I can see the relationship between indicators! The “corragram” package
Methods to show the relationship between indicators include scatter plots and correlation coefficients, and the corragram package allows you to output all of these methods together.
<おすすめのRに関する書籍です>
基礎から学ぶ統計学 | 中原 治
Amazonで中原 治の基礎から学ぶ統計学。アマゾンならポイント還元本が多数。中原 治作品ほか、お急ぎ便対象商品は当日お届けも可能。また基礎から学ぶ統計学もアマゾン配送商品なら通常配送無料。
Install Package
It can be introduced by running the following code.
URL: https://github.com/kwstat/corrgram
install.packages("corrgram", type = "source")
#or
library(devtools) #If devtools is not present, run right:install.packages("devtools")
install_github("kwstat/corrgram")スポンサーリンク
Execute command
Here are two examples.
Note that the manual says you can choose between Pearson, Spearman, and Kendall for the correlation coefficient, but the correlation coefficient calculated in the panel.conf option is Pearson. Please note this!
#Reading data provided with the corrgram package, 74 rows and 14 columns.
data(auto)
#Example 1
#Default plot. Correlation coefficients can be selected from pearson, spearman, kendall.
corrgram(auto[, -c(1:2)], cor.method = "kendall")
#Example 2
#Plot with iris data supplied with R. Densities, scatter plots, and correlation coefficients for each variable can be plotted simultaneously.
#Note that the correlation coefficients in panel.conf are output in pearson even if the method is specified in cor.method. Please be aware of this!
corrgram(iris, lower.panel = panel.pts, upper.panel = panel.conf,
diag.panel = panel.density, cor.method = "spearman")Output Examples
Example 1
Example 2
少しでも、ウェブや実験の解析が楽になりますように!!
スポンサーリンク

