Rで何かをしたり、読書をするブログ

政府統計の総合窓口のデータや、OECDやUCIやのデータを使って、Rの練習をしています。ときどき、読書記録も載せています。

World Bank Income share held by lowest 20% data analysis 2 - Some data visualization with R

Generated by Bing Image Creator: Wide view of clear small creek, water flowers, photo

www.crosshyou.info

This post is following of the above post.
In the previous post, I import data into R and made a tidy dataframe which can be analyzed.

So, let's analyze!

First, I use summary() function.

For year, the oldest year is 1963 and the newest year is 2023.

For share, the smalled is 0.8, the largest is 11.7, the everage is 6.616.

Let's make a histogram for share. I use ggplot2 package.

I added the red vertical line with geom_vline(), which is at 6.616, average value.

Next, let's make line chart.

Oh? There is some observations which is NA for income.

Let's check it.

I see Venezuela, RB has NA for income.
So, I delete it.

Again, let's see summar().

Now, I have 2094 observations, the average share is 6.634.

Let's make boxplots for share by year.

I don't see there is clear trend.

That's it. Thank you!

Next post is

www.crosshyou.info

 

To read from the first post,

www.crosshyou.info