crosshyou

主にクロス表(分割表)分析をしようかなと思いはじめましたが、あまりクロス表の分析はできず。R言語の練習ブログになっています。

OECD Net ODA data analysis 7 - making a correlation matrix and scatter plots.

f:id:cross_hyou:20210704094510j:plain

Photo by Eugene Golovesov on Unsplash

 

www.crosshyou.info

 This post is following of above post.

In this post let's ee make a correlation matirx.

To begin with, I make a data frame for average ODAFLOWS & MLN_USD by country.

f:id:cross_hyou:20210704095644p:plain

Next, I make ODAFLOWS & PC_GNI data frame

f:id:cross_hyou:20210704095808p:plain

 

Next, I make ODAGRANT & MLN_USD average by country.

f:id:cross_hyou:20210704095916p:plain

Lastly, I make ODAGRANT & PC_GNI average by country data frame.

f:id:cross_hyou:20210704100033p:plain

Now, we have four data frames. I will merge them into one data frame with inner_join() function.

f:id:cross_hyou:20210704100211p:plain

Then, I add logarithm of flow_usd and grant_usd because these two variables became more normal distribution when it is converted to logatirthm.

f:id:cross_hyou:20210704100415p:plain

All right, let's see correlation matrix.

f:id:cross_hyou:20210704100617p:plain

We see lflow_usd and lgrant_usd are strongly correlated.

 

Let's make a scatter plot matrix.

f:id:cross_hyou:20210704100904p:plain

f:id:cross_hyou:20210704100916p:plain

That's it. Thank you!

 Next post is..

 

www.crosshyou.info

 

To see the 1st post,

 

www.crosshyou.info