crosshyou

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

OECD Business confidence Index(BCI) data analysis 2 - BCI average by region are the same but...

f:id:cross_hyou:20211023081350j:plain

Photo by T S on Unsplash 

www.crosshyou.info

This post is following of above post.

I have another CSV flile like below.

f:id:cross_hyou:20211023082912p:plain

I read this file too.

f:id:cross_hyou:20211023083059p:plain

Let' merge this dataframe and previous dataframe.

f:id:cross_hyou:20211023083417p:plain

I convert region and sub.region to factor class.

f:id:cross_hyou:20211023083631p:plain

Since Business confidence Index means good if it is greater than 100, I made bernouil variables, good.

f:id:cross_hyou:20211023083921p:plain

Let's see summary of df again.

f:id:cross_hyou:20211023085518p:plain

Mean of good is 0.5391, it means 53.91% observations are above 100 bci.

Let's see bci average and good by region.

f:id:cross_hyou:20211023084739p:plain

It is interesting that some regions have above 0.5 good_avg some have below 0.5 while all regions have the same bci_avg, 100. Americas has the highest good_acg, 0.569 and Africa has the lowest good_avg, 0.410.

Let's see  by sub.region average.

f:id:cross_hyou:20211023085635p:plain

Again, bci average is 100 for all sub.region. 

Let's make boxplot for bci by region.

f:id:cross_hyou:20211023090345p:plain

f:id:cross_hyou:20211023090357p:plain

We see Asia has the most varaince and Africa has the least variance.

Let's see bci boxplot by sub.region

f:id:cross_hyou:20211023090853p:plain

f:id:cross_hyou:20211023090910p:plain

Western-Asia has the most variance.

That's it. Thank you!

Next post is

 

www.crosshyou.info

 



To read from the 1st post,

 

www.crosshyou.info