www.crosshyou.info

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

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

OECD Road accidents data analysis 2 - R summary() function is very useful to see a data frame statistics.

Photo by Clyde RS on Unsplash www.crosshyou.info This post is following of above post.In the previous post, I made a data frame named "df".Let's see the data frame in detail. I will use summary() function in R. Before using summary() funct…

OECD Road accidents data analysis 1 - import CSV file data using R and make a data frame tidy.

Photo by Stephen Leonardi on Unsplash In this post, I will analyze OECD Road accidents data. The CSV file I donwloaded from the OECD web site(Transport - Road accidents - OECD Data) is like below. Let' analuze this data using R.Firstly, I …

都道府県別の後期高齢者医療制度被保険者実態調査のデータ分析6 - R言語のstargazer()関数で回帰分析の結果を美しく出力する。

Photo by Taisiia Shestopal on Unsplash www.crosshyou.info の続きです。 今回はlm()関数で回帰分析をして、その結果をstargazer()関数で美しく出力してみたいと思います。 shotoku_1617: 所得の2016年から2017年の変化幅を被説明変数にして、その他の変数…

都道府県別の後期高齢者医療制度被保険者実態調査のデータ分析5 - 所得の変化幅をt.test()関数でt検定する。

Photo by Lesly Juarez on Unsplash www.crosshyou.info このブログは、上のブログの続きです。 今回は所得の変化幅をもう少し詳しくみてみます。 まずは、big6との関係を見てみます。 2016年から2017年の所得の変化幅は、big6は1万2千円、そうでないところ…

都道府県別の後期高齢者医療制度被保険者実態調査のデータ分析4 - 各変数の変化幅を計算してグラフにする。

Photo by Karsten Winegeart on Unsplash www.crosshyou.info の続きです。 今回は前回作成したワイド型のデータフレームを使って、各データの変化幅を計算していましょう。 mutate()関数を使います。 select()関数とsummary()関数を使って各変化幅のサマリ…

都道府県別の後期高齢者医療制度被保険者実態調査のデータ分析3 - R言語でロング型のデータフレームをワイド型に変換する。

Photo by Sharon Pittaway on Unsplash www.crosshyou.info このブログは上のブログの続きです。 今回はR言語のでロング型のデータフレームをワイド型に変換しようと思います。 ロング型のデータフレームは、 このように「科目」の列と「点数」で一つのデー…

都道府県別の後期高齢者医療制度被保険者実態調査のデータ分析2 - R言語でヒストグラム、箱ひげ図、散布図を描く。

Photo by JUNHØ on Unsplash www.crosshyou.info このブログは上のブログの続きです。 今回はデータをグラフにして視覚化しましょう。 まずは、ヒストグラムです。geom_histogram()関数を使います。 shotokuからいきます。 右端に離れ小島のように高額所得の…

都道府県別の後期高齢者医療制度被保険者実態調査のデータの分析1 - R言語にデータを読み込む。

Photo by Manuel Sardo on Unsplash 今回は都道府県別の後期高齢者医療制度被保険者実態調査のデータを分析してみようと思います。データは、政府統計の総合窓口(www.e-stat.go.jp)から取得しました。 この中から、都道府県別1人当たり所得額・保険料調定額…

OECD International Student Mobility Data Analysis 5 - Making a slope chart using R plot(), lines(), points() and text() functions.

Photo by Aditi Jain on Unsplash www.crosshyou.info This post is following of above post.In this post, I will make a slope chart using R.We can get an idea of changes based on the slope of the lines, so we can see which country has improved…

OECD International Student Mobility Data Analysis 4 - Which country has the largest net change for International Student Mobility?

Photo by Kumiko SHIMIZU on Unsplash www.crosshyou.info This post is following of above post. Let's make data frame which contains 2005 data only. Then, let's make data frame which contains 2018 data only. Then, join these two data frames w…

OECD International Student Mobility Data Analysis 3 - t-test with t.test() function using R

Photo by Tegar Surya on Unsplash www.crosshyou.info This post is following of above post.In this post, let's do t-test with t.test() function using R. In the previous post we see International Mobility is gradually increasing.Let's confirm…

OECD International Student Mobility Data Analysis 2 - making graphs with ggplot2() function.

Photo by Lance Anderson on Unsplash www.crosshyou.info This post is following of above post. In this post, let's make some graphs to see data distributions. First, let's see overall student_mobility data histogram. We see there are a few o…

OECD International Student Mobility Data Analysis 1 - load CSV file data into R with read_csv() function

Photo by Kenrick Baksh on Unsplash In this post I will analyze OECD International Student Mobility data using R. You can download data from Students - International student mobility - OECD Data CSV file image is below. Let's upload this da…

都道府県別のバスのデータの分析6 - バス会社の数を人口や県内総生産額などで回帰分析する

Photo by MusicFox Fx on Unsplash www.crosshyou.info 前回は差分でバス会社の数と人口や県内総生産額の回帰分析をしました。人口が10万増加すると、バス会社が8社増えるという関係でした。なんかそんなに増えるのか!という感じがします。 今回はもともと…

都道府県別のバスのデータの分析5 - 2001年のデータと2013年のデータの差分を回帰分析する。Breush-Pegan検定も実行。

Photo by david Griffiths on Unsplash www.crosshyou.info の続きです。 今回は前回作成した、2001年と2013年の差分のデータで回帰分析をしてみようと思います。 まず。各変数の散布図をみてみます。 firm_pop_diffとfirm_gdp_diffは非常に相関が強いですね…

都道府県別のバスのデータの分析4 - 2001年のデータと2013年のデータを比較する。

Photo by Brady Stoeltzing on Unsplash www.crosshyou.info の続きです。 前回の分析で、山梨県や島根県が人口や経済規模のわりにバス会社の数が多いことがわかりました。 今回は最新年の2013年と一番古い年の2001年でどれだけ各データが変化したのか見てみ…

都道府県別のバスのデータの分析3 - 人口当たり、県内総生産額当たりのバス会社数を調べる。東の横綱は山梨県、西の横綱は島根県。

Photo by Ernest Brillo on Unsplash www.crosshyou.info の続きです。 今回は、都道府県別の平均値を見てみます。 まずは、pop: 総人口(人)の平均値です。 明るい色は東日本、暗い色は西日本の都道府県を表しています。 東日本のほうが人口は多い傾向ですね…

都道府県別のバスのデータの分析2 - R言語で年ごとのバス会社の数の推移を見る。増加傾向にあることがわかる。

Photo by Johannes Plenio on Unsplash www.crosshyou.info の続きです。 前回までで、pop: 総人口の他はNAがあることがわかりました。とりあえず。各変数の一番新しい年がいつなのかを確認します。 まず、gdp: 県内総生産額は一番新しい年はいつのデータで…

都道府県別のバスのデータの分析1 - R言語でデータを読み込む。read_csv()関数やinner_join()関数などを使う。

Photo by Boris Smokrovic on Unsplash 今回は都道府県別のバスのデータを分析してみます。 政府統計の総合窓口(www.e-stat.go.jp)からデータを取得します。 まず、47都道府県を選択します。 選択したデータは、総人口(人)、県内総生産額(平成17年基準・百万…

OECD Net Oda data analysis 8 - PCA(Principal Component Analysis) shows G7 countries

Photo by Navi Photography on Unsplash www.crosshyou.info This post is following of above post.In this post, I use PCA(Principal Component Analysis).First, I make a data frame for PCA. Then, I use prcomp() function to do PCA. We see PC1 exp…

OECD Net ODA data analysis 7 - making a correlation matrix and scatter plots.

Photo by Eugene Golovesov on Unsplash www.crosshyou.info This post is following of above post. In this post let's ee make a correlation matirx. To begin with, I make a data frame for average ODAFLOWS & MLN_USD by country. Next, I make ODAF…

OECD Net ODA data analysis 6 - Turkey has the highest ODAGRANT & PC_GNI. There is not significant difference in year.

Photo by 301+ Kim on Unsplash www.crosshyou.info This post is following of above post. In this post, let's see ODAGRANT & PCT_GNI. What is the highest ODAGRAN & PCT_GNI country - year? 2019 Turkey has the highest ODAGRANT & PC_GNI. What is…

読書記録 - 「市民科学者として生きる」 高木仁三郎 著 (岩波新書)

市民科学者として生きる (岩波新書) 作者:高木 仁三郎 岩波書店 Amazon 「プルトニウムの危険性を世界の人々に知らしめ、また情報公開を政府に迫って一定の成果を上げるなど、市民の立場に立った科学者」の高木仁三郎博士の自伝的な本です。

OECD Net ODA data analysis 5 - United States has the largest ODAGRANT & MLN_USD

Photo by TOMOKO UJI on Unsplash www.crosshyou.info This post is following of above post.In this post, let's see how ODAGRANT & MLN_USD looks like. United States dominates. Germany is at the 2nd. Let's see average value by country. United S…

OECD Net ODA data analysis 4 - Examining ODAFLOWS & PC_GNI. Sweden has the highest ODAFLOWS & PC_GNI

Photo by Jarand K. Løkeland on Unsplash www.crosshyou.info This blog is following of above blog. In this post, let's see ODAFLOWS and PC_GNI data. To begin with, let's see time trend. I cannot see obvious trend. Let's calculate average val…