Analysis in R:I can see the relationship between indicators! The “corragram” package

RAnalytics
スポンサーリンク

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.

スポンサーリンク

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


少しでも、ウェブや実験の解析が楽になりますように!!

Amazon audibleの登録の紹介

プライム会員限定で2024年7月22日まで3か月無料体験キャンペーン開催中です。無料体験後は月額1,500円で聞き放題です。なお、聞き放題対象外の本はAudible会員であれば非会員価格の30%引きで購入することが可能です。

Amazon audibleはプロのナレーターが朗読した本をアプリで聞くことができるサービスで、オフライン再生も可能です。通勤や作業のお供にAmazon audibleのご登録はいかがでしょうか。

・AmazonのAudible

https://amzn.to/3L4FI5o

Copied title and URL