www.crosshyou.info

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

2021-01-01から1年間の記事一覧

OECD Business confidence Index(BCI) data analysis 7 - making a panel dataframe using plm packages pdata.frame() function.

Photo by Samuel Mwamburi on Unsplash www.crosshyou.info This post is following of above post. I have GDP and per capita GDP data file like below. Let's use this data too. I load this data with read_csv() function. Then, I will merge gdp_da…

OECD Business confidence Index(BCI) data analysis 6 - There is no monthly/quarterly seasonality for BCI.

Photo by Juliane Liebermann on Unsplash www.crosshyou.info This post is following of above post. Now, let's see df dataframe object again. df have "time" variable as Date class. I will make year and month from time.I need lubridate package…

OECD Business confidence Index(BCI) data analysis 5 - Time-Series Regression using R, Finite Distributed Lag(FDL) Model

Photo by JuniperPhoton on Unsplash www.crosshyou.info This post is follwong of abovr post.In this post, I will examone Finite Distributed Lag(FDL) Model. Firstly, I make a ts object from df_avg objrect. Then, I use dynlm() function to make…

OECD Business confidence Index(BCI) data analysis 4 - Time-Series Regression using R - static model

Photo by Elena Louca on Unsplash www.crosshyou.info This post is following of above post. Let's do time-series regression.Firstly, let's make a static time series model In time-series regression, we have to care about serial correlation of…

OECD Business confidence Index(BCI) data analysis 3 - time-series chart using ggplot() + geom_line()

Photo by NASA on Unsplash www.crosshyou.info This post is following of above post. Let's see time-series for bci average. Let's see time-series for good average. average bci and average good are both very volatile. what is the correlation …

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

Photo by T S on Unsplash www.crosshyou.info This post is following of above post. I have another CSV flile like below. I read this file too. Let' merge this dataframe and previous dataframe. I convert region and sub.region to factor class.…

読書記録 - 「系外惑星と太陽系」 井田茂 著 岩波新書

系外惑星と太陽系 (岩波新書) 作者:井田 茂 岩波書店 Amazon 私たちが住んでいる太陽系以外にある惑星を系外惑星と呼ぶそうです。 昔は、私たちの太陽系の地球は特別な星だと考えられていましたが、実際はそうでもなくて、地球と同じ大きさぐらいの惑星はか…

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

Photo by William Olivieri on Unsplash In this post, I will analyze OECD Business confidence index(BCI) using R. From the OECD web site, I download below CSV file. Firstly, I load tidyverse package. Then, I use read_csv() finction to read t…

都道府県別の婚姻件数と離婚件数のデータの分析6 - options(scipen = xxxx)で数値の表示を変更できる。

Photo by Nat Fernández on Unsplash www.crosshyou.info の続きです。 前回作成した、df_mardivのデータフレームのサマリーを見てみます。 pop: 人口とsch: 中学校数もすべての年でデータがそろっていますね。 とりあえず、これらNAの無い変数だけのデータ…

都道府県別の婚姻件数と離婚件数のデータの分析5 - 離婚レシオは上昇傾向だが、西日本のほうが高いことは変化なし。

Photo by James Wheeler on Unsplash www.crosshyou.info の続きです。 いままでは2001年度だけのデータで分析して、西日本のほうが離婚レシオが高いとわかりました。 今回は違う年度でもそうなのか調べてみます。 まず、marとdivのデータがある行だけのデー…

都道府県別の婚姻件数と離婚件数のデータの分析4 - R言語で重回帰分析をする。1人当たり県民所得が増えると離婚レシオは低下する。

Photo by Aaron Burden on Unsplash www.crosshyou.info の続きです。 前回の分析でdiv_mar: 離婚レシオは西日本のほうが高いことがわかりました。 R言語のlm()関数で重回帰分析をしてみます。 被説明変数がdiv_marで、説明変数がlei: 旅行・レジャーの行動…

読書記録 - 「日本の先史時代 旧石器・縄文・弥生・古墳時代を読みなおす」藤尾慎一郎 著 中公新書

日本の先史時代-旧石器・縄文・弥生・古墳時代を読みなおす (中公新書 2654) 作者:藤尾 慎一郎 中央公論新社 Amazon 旧石器時代から、縄文時代、弥生時代、古墳時代へとどのように日本が移ってきたのかを説明しています。 これらの時代の区分が研究者によっ…

都道府県別の婚姻件数と離婚件数のデータの分析3 - 西日本のほうが離婚レシオは高く、東京、大阪、愛知、神奈川、千葉、埼玉の都会のほうが離婚レシオは低い。

Photo by Free Nature Stock on Unsplash www.crosshyou.info の続きです。 まず、あらかじめ用意してある、各地域の属性のデータを読み込みます。 east: 東日本なら1,西日本なら0のダミー変数 big6: 東京都、神奈川県、千葉県、埼玉県、愛知県、大阪府な…

都道府県別の婚姻件数と離婚件数のデータの分析2 - R言語のmutate関数でデータフレーム内の変数を組み合わせて加工したり・変換する。

Photo by Adam Śmigielski on Unsplash www.crosshyou.info の続きです。 複数のグラフを一度に表示したいので、gridExtraというパッケージを読み込みます。 続いて、各変数の密度分布グラフを描きましょう。 まず、pop: 総人口(人)です。populationのpopで…

都道府県別の婚姻件数と離婚件数のデータの分析1 - R言語にデータを取り込む。

Photo by Boris Smokrovic on Unsplash 今回は都道府県別の婚姻件数と離婚件数を調べてみます。 政府統計の総合窓口(www.e-stat.go.jp)からデータを取得します。 まず、47都道府県を選択します。 婚姻件数・離婚件数の他に総人口、県内総生産額、中学校数、…

OECD NEET Data Analysis 7 - Panel Data Analysis with FD(First Differenced) Estimator

Photo by Jonas Allert on Unsplash www.crosshyou.info This post is following of the above post.In this post I will try panel data analysis, FD(First Differenced) estimator.I refere to "Using R for Introductory Econometrics" by Florian Heisi…

OECD NEET Data Analysis 6- Heteroskedasticity-Robust Inference using R

Photo by Gabriel Garcia Marengo on Unsplash www.crosshyou.info This post is following of the above post. Hello. In this post, I will do Heteroskedasiticity test usung R. In te previous post, I meade regression model using R. Let's plot fit…

OECD NEET Data Analysis 5 - Regression analysis using R - NEET percentage and per capita GDP & GDP amount

Photo by JD Rincs on Unsplash www.crosshyou.info This post is gollowing of the above post. In this post, I will do regression analysis using R. I will check if GDP, per capita GDP are statistically significant factor to NEET percentage. Fi…

OECD NEET Data Analysis 4 - NEET percentage and per capita GDP has negative correlation

Photo by Stephanie LeBlanc on Unsplash www.crosshyou.info This post is following of the above post. Let's check how many observations each country has. Max observations is 24. Many country has more than 20 observations.So, let's see averag…

OECD NEET Data Analysis 3 - correlation between MEN_15_29 and WOMEN_15_29. It is positive correlation.

Photo by Michael D Beckwith on Unsplash www.crosshyou.info This post is following of above post. Let's see time-series distribution for 15_29_MEN and 15_29_WOMEN It is a bit difficult to see trends.So, I divided before 2010 and after 2011 …

OECD NEET Data Analysis 2 - 15_29_WOMEN NEET percentage is higher than MEN.

Photo by Chris Briggs on Unsplash www.crosshyou.info This post is following of above post. There are many SUBJECTs, so let's focus 15_29 first. It is NEET percentage among 15_29 old young people. Firstly, let's see a histogram. There is a …

OECD NEET Data Analysis 1 - read CSV file using R read_csv function.

Photo by 懒 羊羊 on Unsplash In this BLOG series, I will investigae NEET data. Firstly, I get data from OECD web site. CSV file is like below. Let's load this data into R.Firstly, I load tidyverse package and will use read_csv function. Al…

都道府県別の通院者率のデータの分析7 - 社会体育施設数が多い都道府県ほど通院者率が低い。

Photo by Dillon Austin on Unsplash www.crosshyou.info の続きです。 今回はoldr: 65歳以上人口割合の他の変数がhosp: 人口千人当たり通院者率に影響があるかどうかを調べようと思います。 まず。各変数の観測年を確認します。 こうしてみると、hosp, worr…

都道府県別の通院者率のデータの分析6 - 高齢者割合の変化幅、通院者率の変化幅で回帰分析する。

Photo by Ricardo Gomez Angel on Unsplash www.crosshyou.info の続きです。 前回は、hosp: 通院者率をoldr: 65歳以上人口割合と年ダミーを入れて回帰分析してみました。 hosp = β0 + β1oldr + β2year + β3oldr:year + u という回帰式でした。 今回はhospと…

読書記録 - 「法医学者の使命「人の死を生かす」ために」 吉田謙一 著 岩波新書

法医学者の使命 「人の死を生かす」ために (岩波新書 新赤版 1890) 作者:吉田 謙一 岩波書店 Amazon 60件ぐらいの法医学者が関わった死亡案件がこの本には載っています。 まず、思ったのは死亡原因を決めるはとても難しいことなんだ、ということと、 検察官…

都道府県別の通院者率のデータの分析5 - ダミー変数(year)の交差項を入れて回帰分析をする。

Photo by Aaron Burden on Unsplash www.crosshyou.info の続きです。 前回はhosp: 人口1000人当たりの通院者率をoldr: 65歳以上人口割合(%)で回帰分析しました。oldrが1ポイント高くなると、約8人通院者率が増えることがわかりました。 今回は回帰式にyear:…

都道府県別の通院者率のデータの分析4 - R言語で単回帰分析 - 65歳以上人口割合で通院者率を回帰分析

Photo by Sana Ullah on Unsplash www.crosshyou.info の続きです。 通院者率は、oldr: 65歳以上の人口割合がと関係があるかどうかを調べてみます。 やっぱり歳をとってくると病院のお世話になることが若いときよりも多くなると思うんですよね。 oldrがある…

都道府県別の通院者率のデータの分析3 - 沖縄県が一番、通院者率が低い。

Photo by John Lee on Unsplash www.crosshyou.info の続きです。 hosp: 人口1000人当たりの通院者率は何年に調査しているのかを確認します。 1989年が一番古く、2019年が最新です。1995年と2016年は観測数が46とひとつ足りないです。 2019年では、どの都道…

都道府県別の通院者率のデータの分析2 - 各変数の経年変化を箱ひげ図に原データを重ねて表現する。

Photo by Julia Zolotova on Unsplash www.crosshyou.info の続きです。 今回は各変数の経年変化をグラフにしてみてみます。 まずは、hosp: 人口千人当たりの通院者率のデータです。 まず、summary関数で平均値などを確認します。 平均値は327.7人です。最小…

都道府県別の通院者率のデータの分析1 - R言語にデータを読み込む。

Photo by Ana Markovych on Unsplash 今回は都道府県別の通院者率のデータを分析してみようと思います。 データは、政府統計の総合窓口(e-stat)から取得しました。www.e-stat.go.jp まず、47都道府県を選択しました。 続いて、65歳以上人口割合、就業者率、…