www.crosshyou.info

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

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

OECD Net ODA data analysis 3 - Visualizing data with ggplot() + geom_boxplot() and geom_line(). U.S.A. has the largest ODAFLOWS & MLN_USD.

Photo by Chris Lejarazu on Unsplash www.crosshyou.info This blog is following of above blog.This time, let's visualize ODAFLOWS & MLN_USD data. Fisrtly, let's see time x value Let'c caluculate average value by time and plot a line chart. W…

OECD Net ODA data analysis 2 - summary() function is to see summary stats. the maximum ODAFLOWS is 36551.15 million USD.

Photo by kazuend on Unsplash www.crosshyou.info This blog is following of above blog. This time, let's import country name data too. I hvae below CSV file which contains ISO code and country name. I use read_csv() function to read this dat…

OECD Net ODA data analysis 1 - using read_csv() function to read CSV file data into R.

Photo by Wengang Zhai on Unsplash In this blog, I will analyzie OECD Net ODA data I got data from OECD web site. This is what the CSV file looks like.I use R for data analysis. Firstly, I load tidyverse package. Next, use read_csv() functi…

都道府県別の献血者数のデータの分析6 - やっぱりボランティア行動者率が上昇すると、献血者率が下がる。

Photo by dilara harmanci on Unsplash www.crosshyou.info の続きです。 今回は、回帰分析の説明変数に2006年の献血者率を加えて、2011年の献血者率を回帰分析してみようと思います。 blood_popをblood_pop_2016と名前を変更しておきましょう。 続いて、201…

都道府県別の献血者数のデータの分析5 - R言語のlm関数で献血者率を回帰分析する。一人当たり県内総生産額が高いほうが献血者率が高い。ボランティア行動者率が高いほうが献血者率が低い。

Photo by Anton Maksimov juvnsky on Unsplash www.crosshyou.info の続きです。 今回は献血者率を他の変数で回帰分析してみましょう。 いままでの分析結果から、2006年と2011年では献血者率が違う、東日本と西日本では献血者率が違うなどがわかりました。 …

都道府県別の献血者数のデータの分析4 - R言語のgeom_point()関数とgeom_smotth()関数で散布図を描き、回帰直線を重ねる。

Photo by Tanner Geringer on Unsplash www.crosshyou.info の続きです。 今回は献血者数と各数値データの関係を見ていきましょう。 はじめは対数変換した人口との関係です。 geom_point()関数で散布図を描いて、geom_smooth(metho = "lm")で線形回帰の直線…

読書記録 - 「日本近代史講義 - 成功と失敗の歴史に学ぶ」 山内昌之・細谷雄一 編集著 中公新書

日本近現代史講義-成功と失敗の歴史に学ぶ (中公新書) 作者:山内昌之,細谷雄一 中央公論新社 Amazon 「歴史は無限の宝庫」これは、あとがきにある言葉です。 この無限の宝庫である歴史を活かすためには事実を正しく認識しなければなりません。 本書は2015年1…

都道府県別の献血者数のデータの分析3 - 人口と県内総生産額は対数変換したほうが正規分布に近づく。

Photo by Christoph von Gellhorn on Unsplash www.crosshyou.info の続きです。 こんどか東日本と西日本の献血者率をみてみます。 0が西日本なので、西日本のほうが少し高いです。 geom_density()関数で密度分布グラフをみてみます。 西日本のほうが献血者…

都道府県別の献血者数のデータの分析2 - t検定によると、2011年のほうが2006年よりも献血者率は高くなっていることがわかる。

Photo by Robin Schreiner on Unsplash www.crosshyou.info の続きです。 まずは、人口当たり何%の人が献血をしているのかを計算しましょう。 最小値は3.054%、最大値は5.254%、平均値は4.067%、中央値は4.129%です。 ヒストグラムを描いてみます。 すこし偏…

都道府県別の献血者数のデータの分析1 - R言語のread_csv()関数でデータを読み込む。

Photo by HalGatewood.com on Unsplash 今回は都道府県別の献血者数のデータを分析しようと思います。 まず、政府統計の総合窓口(www.e-stat.go.jp)からデータをダウンロードします。 47の都道府県を選択し、 総人口、県内総生産額、献血者数、ボランティア…

OECD Doctors' consultations data analysis 6 - using lm() function for linear regression

Photo by DAVID TANG on Unsplash www.crosshyou.info This post is following of above post. In this blog, I will do regression anaysis using lm() function in R. Let's go ahead. summary() function displays result. p-value is 0.4024, it is grea…

OECD Doctors' consultations data analysis 5 - Turkey has the most increased from 2007 to 2012.

Photo by Gwenn Klabbers on Unsplash www.crosshyou.info This post is following of above post. This time, let's see which country has the most increased doctors' consultation from 2007 to 2012. We see TUR(Turkey) is the most incleasing count…

OECD Doctors' consultations data analysis 4 - T-test shows doctors' consultations has been increased from 2007 to 2012.

Photo by Jasper Wilde on Unsplash www.crosshyou.info This post is following og above post. This time, let's see boxplot by region for 2021 data We see Asia region has the highest consultations and Afirica has the lowest. Then, how about 20…

OECD Doctors' consultations data analysis 3 - which.max() and which.min() finds which country has the max/min doctors' consultations?

Photo by Harry Cunningham on Unsplash www.crosshyou.info This post is following of above psot.Now, let's see which country has the maxmum doctors' consultations using which.max() fundtion. Korea has the max conultations per capita. 16.9 ti…

OECD Doctors' consultations data analysis 2 - use inner_join() to merge two data frames

Photo by Sergey Shmidt on Unsplash www.crosshyou.info This post is following of above post.In the previous post, I read OECD Doctors' consultation data in R. But we don't know what LOCATION is what country. So I will add those information.…

OECD Doctors' consultations data analysis 1 - Read CSV file data into R

Photo by Tobias Keller on Unsplash This time let's see OECD Dictor's consultations data. This indicator presents data on the number of consultations patiens have with doctors in a given year. I download below file from the OECD web site(He…

都道府県別の県議会議員の所属政党のデータの分析5 - 女性議員比率をR言語のlm関数で回帰分析

www.crosshyou.info 今回は女性議員の比率を他の変数で回帰分析してみます。R言語のlm関数を使います。 f_jimin: 自民党の女性議員の数、f_kyosan: 共産党の女性議員の数が有意な変数です。 自民党の女性議員の数が1人増えると、女性議員の比率は、0.0146、…