www.crosshyou.info

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

OECD Business confidence Index(BCI) data analysis 1 - read CSV file data using R language read_csv() function

f:id:cross_hyou:20211017201816j:plain

Photo by William Olivieri on Unsplash 

f:id:cross_hyou:20211017201519p:plain

In this post, I will analyze OECD Business confidence index(BCI) using R.

From the OECD web site, I download below CSV file.

f:id:cross_hyou:20211017202134p:plain


Firstly, I load tidyverse package.

f:id:cross_hyou:20211017201955p:plain

Then, I use read_csv() finction to read the CSV file data into R.

f:id:cross_hyou:20211017202343p:plain

Okay, It seems I successfully loaded the data.

Let's check each variables one by one.

LOCATION

f:id:cross_hyou:20211017202548p:plain

LOCATION is ISO country code. USA has the most observations.

INDICATOR

f:id:cross_hyou:20211017203341p:plain

INDICATOR has only one value, BCI, so I will delete it later.

 

SUBJECT

f:id:cross_hyou:20211017203517p:plain

SUBJECT has only one value, AMPLITUD. I will delete SUBJECT too.

 

MEASURE

f:id:cross_hyou:20211017203652p:plain

MEASURE has only one value, LTRNDIDX. I will delete it too later.

 

FREQUENCY

f:id:cross_hyou:20211017203837p:plain

FREQUENCY has only one vatiable, M, it means Monthly. I will delete it too.

 

TIME

f:id:cross_hyou:20211017204048p:plain

TIME is observation year and month. But it is recognized as character string.
So, I have to convert it to date time class.

 

Value

f:id:cross_hyou:20211017204245p:plain

Value is BCI(Business Confidence Index). Greater than 100 means increased confidence in near future. Mean is 100.

All right, I will delete INDICATOR, SUBJECT, MEASURE and FREQUENCY

f:id:cross_hyou:20211017204607p:plain

I will change TIME from character strings to data time class.

f:id:cross_hyou:20211017205002p:plain

And, I will change variable names to some easy characters.

f:id:cross_hyou:20211017205154p:plain

All right. let's see summary of df.

f:id:cross_hyou:20211017205302p:plain

I see df has 21017 observations from iso's Length.

The oldest time si 1950-01-01 and the newest time is 2021-11-01, it is a bit strange because it is 2021-10-17 today.

bci has average 100 and minimum is 83.23 and maximum is 109.51.

That's it. Thank you!

 

Next post is

 

www.crosshyou.info