www.crosshyou.info

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

2021-09-01から1ヶ月間の記事一覧

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歳以上人口割合、就業者率、…

OECD Meat Consumption Data Analysis 8 - Serial Correlation Robust Inference using R

Photo by T o T on Unsplash www.crosshyou.info This post is following of above post. In this post, I will check if there is serial correlation in the previous regression model. First, I make residual with resid() function. Then, let's make …

OECD Meat Consumption Data Analysis 7 - Time Series Regression using R dynlm() function.

Photo by Ashutosh Saraswat on Unsplash www.crosshyou.info This post is following of aabove post.In this post, I will do some time-series regression with R. First, I made JPN only dataframe. Let's see df_jpn. Then, I make ts object form df_…

OECD Meat Consumption Data Analysis 6 - POULTRY Consumption is positively correlated with GDP

Photo by corina ardeleanu on Unsplash www.crosshyou.info This post is following of above post. I have GDP data like below CSV file. So, let's combine this GDP data and Meat Consumption data. Next, I use inner_join() function to combine df2…

OECD Meat Consumption Data Analysis 5 - scatter plot using R ggplot2::geom_point()

Photo by Casey Horner on Unsplash www.crosshyou.info This post is following of above post.In this post, let's draw scatter plots using R ggplot2::geom_point.First of all, let's see correlations about 4 KG_CAPs. bekg: BEEF KG_CAP and pokg: …

OECD Meat Consumption Data Analysis 4 - USA is the most meat consumption country.

Photo by Claiton Conto on Unsplash www.crosshyou.info This post is following of above post.Let's see KG_CAP data as country average. Firstly, bekg: BEEK KG_CAP ARG is the highest beef consumption country. IND is the lowest. How about pikg:…

OECD Meat Consumption Data Analysis 3 - PIG and POULTRY are on up trend while BEEF and SHEEP are on down trend.

Photo by Nathan Anderson on Unsplash www.crosshyou.info This post is following of above post. Let's see coun: country. We see all country have 40 observations. Let's see year We see all year have 38 observations.So, df2 data frame is 40 co…

OECD Meat Consumption Data Analysis 2 - PIG is the most popular meat.

Photo by boris misevic on Unsplash www.crosshyou.info This post is following above post.Now, we now there are 4 sunjects and 2 measures. 4 subjects are BEEG, PIG, POULTRY and SHEEP. 2 measures are KG_CAP and THND_TONNE.So, we have 8 combin…

OECD Meat Consumption Data Analysis 1 - Using R to read CSV data with read_csv() function.

Photo by Wolfgang Hasselmann on Unsplash Hello! This post, I will anaysis OECD Meat Consumption data using R. I got a CSV file like below from OECD web site(Agricultural output - Meat consumption - OECD Data) Firstly, I load tidyverse pack…

都道府県別の仕事の平均時間のデータ分析7 - 女性の仕事の平均時間は、1人当たり県民所得が高くなると短くなる。

Photo by Xavier von Erlach on Unsplash www.crosshyou.info の続きです。 こんどは、male_m: 男性の仕事の平均時間(分)を回帰分析してみます。 P-valueが0.703ということなので、有意なモデルではないです。 step関数でモデルを単純化してみます。 female_…

都道府県別の仕事の平均時間のデータ分析6 - R言語のprop.test()関数で比率の検定をする。

Photo by catrina farrell on Unsplash www.crosshyou.info の続きです。 各都道府県の 女性(15~64歳)の人口 / 男性(15~64歳)の人口の比率は西日本のほうが高いとわかりましたが、東日本全体の女性(15~64歳)の人口/東日本全体の男性(15~64歳)の人口と、西日…

都道府県別の仕事の平均時間のデータ分析5 - R言語でRidge Plotというものを描く。

Photo by Mark Harpur on Unsplash www.crosshyou.info rafalab.github.io というものでRidge Plotというものを知りましたので、忘れないうちに実践です。 Ridge Plotはあるデータ(身長、体重、所得など)の分布をグループごとに見るときに便利です。 早速、…

都道府県別の仕事の平均時間のデータ分析4 - 海のない県のほうが、女性の仕事の平均時間/男性の仕事の平均時間 は低い。

Photo by Manson Yim on Unsplash www.crosshyou.info の続きです。 前回の分析で西日本のほうが、女性の人口(15~64歳)/男性の人口(15~64歳)の比率が高い傾向にあることがわかりました。 統計的に有意に違うのか検定してみます。 p-valueは1.125e-06とかなり…

都道府県別の仕事の平均時間のデータ分析3 - 東日本は女性(15~64歳)が少なく、西日本は多い。

Photo by Dileep M on Unsplash www.crosshyou.info の続きです。 前回、女性の仕事時間 / 男性の仕事時間 という変数をfmという名前で作りました。 女性の人口 (15~64歳)/ 男性の人口(15~64歳) の変数をfm_popという名前で作ります。 こうしてみると東日本…

都道府県別の仕事の平均時間のデータ分析2 - 男性は鹿児島県、香川県、新潟県などが長時間、女性は大分県、沖縄県、山形県などが長時間仕事をしている。

Photo by Edrick Krozendijk on Unsplash www.crosshyou.info の続きです。 男性の仕事の平均時間の長いところ、短いところはどこでしょうか? 鹿児島県、香川県、新潟県などが長い時間働いています。 山梨県、愛媛県、高知県が短いです。 同じ四国でも香川…

都道府県別の仕事の平均時間のデータ分析1 - R言語にデータを取り込む。

Photo by frank mckenna on Unsplash 今回は都道府県別の仕事の平均時間のデータを分析しようと思います。 データは、政府統計の総合窓口(www.e-stat.go.jp)から取得しました。 47の都道府県を選択します。 取得するデータは、 15~64歳人口(男)(人) 15~64歳…

OECD Gender wage gap data analysis 5 - Serial Correlation Test using R

Photo by BP Miller on Unsplash www.crosshyou.info This post is following of the above psot. In this post, let's test if there is serial correlation. Firdt of all, load lmtest package. All right, let's start with model1. p-value of lag resi…

OECD Gender wage gap data analysis 4 - Time Series Data Regression with lag and trend using R

Photo by Masako Ishida on Unsplash www.crosshyou.info This post is following of the above post. Which chountry has many observations? NZL has 22 observations. AUT, BEL, DNK, FIN, NOR and SWE have 16 observations. Let's see NZL data. We see…

OECD Gender wage gap data analysis 3 - using facet_grid() and facet_wrap() in R.

Photo by Damien TUPINIER on Unsplash www.crosshyou.info This post is following of above post.Let's see which year has many observations. Okay, 2014, 2010, 2006 and 2018 have over 20 observations. Let's see those years more. First, emp dens…