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

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

OECD Household disposable income data analysis 2 - using filter(), select(), inner_join() functions to make a date frame more analyzable.

f:id:cross_hyou:20210814085913j:plain

 Photo by CHUTTERSNAP on Unsplash  

www.crosshyou.info

This post is following of above post.

In the previous post, we made a dafa frame called a "df".

f:id:cross_hyou:20210814091303p:plain

We see there are two values in subject, GROSSADJ and NET, two values in measure, AGRWTH and USD_CAP.
Thus, there are four possible combinations, GROSSADJ & AGRWTH, GROSSADJ & USD_CAP, NET & AGRWTH and NET & USD_CAP.

Let's check them.

f:id:cross_hyou:20210814091555p:plain

We find there is no observations for GROSSADJ & AGRWTH.

f:id:cross_hyou:20210814091702p:plain

We find there is 1054 observations for GROSSADJ & USD_CAP.
Let's make a dafa frame for GROSSADJ & USD_CAP only.

f:id:cross_hyou:20210814091900p:plain

Let's see about NET & AGRWTH

f:id:cross_hyou:20210814092003p:plain

We see there are 982 observations for NET & AGRWTH.

Let's make a dafa frame for NET & AGRWTH only.

f:id:cross_hyou:20210814092146p:plain

Let's see NET & USD_CAP.

f:id:cross_hyou:20210814092237p:plain

We find there is no observations for NET & USD_CAP.

All right, we have two data frames now, one is "gr_us", which is for GROSSADJ & USD_CAP and the other is "ne_ag", which is for NET & AGRWTH.
Let's merge them with inner_join() function.

f:id:cross_hyou:20210814092621p:plain

Let's see summary of "df2".

f:id:cross_hyou:20210814092744p:plain

We see this panel data strats from 1970 to 2020.

The minumum GROSSADJ & USD_CAP is 1302, the maximum is 53202, the average is 21061.

The minumum NET & AGRWTH is -12.712, the maximum is 20.8168 and the average is 2.4073.

That's it. Thank you!

Next post is

 

www.crosshyou.info

 

To see the 1st post,

 

www.crosshyou.info