www.crosshyou.info

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

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

都道府県別の共働き世帯割合のデータの分析1 - R言語のread_csv()関数でCSVファイルのデータを読み込む。

Photo by Riccardo Chiarini on Unsplash 今回は都道府県別の共働き世帯割合のデータを分析してみようと思います。 データは、政府統計の総合窓口(www.e-stat.go.jp)から取得します。 まず、地域を選択します。 データを選択します。 共働き世帯割合の他に関…

OECD Trust in government data analysis 8 - Trust is government cannot be explained simply by per capita GDP, inflation and long-term unemployment.

Photo by Rob Wicks on Unsplash www.crosshyou.info This post is following of above post. In the previous post I used only JPN data.Let's use whole data in this post.Firstly, I make a multiple linear regression model by year. Dependent varia…

OECD Trust in government data analysis 7 - In Japan, Trust in government and log(per capita GDP) has some relationship.

Photo by Zoltan Tasi on Unsplash www.crosshyou.info This post is following above post. I will add interst rate data and long term unpenployment data. longterm unenployment is "number of unenployee more than 12 months / number of all unenpo…

読書記録 - 「中国名文選」 興膳宏 著 岩波新書

中国名文選 (岩波新書) 作者:興膳 宏 岩波書店 Amazon 漢文の名文を12章で12人分紹介しています。 印象に残ったのは、この紹介された12人の多くが左遷されたり不遇なときを過ごしたことがあることです。

OECD Trust in government data analysis 6 - Multiple linear regression using R - log(per capita GDP) and inflation rate and iso.

Photo by Jim Cooke on Unsplash www.crosshyou.info This post is following of the above post. So far previous posts, GDP nor per capita GDP cannot explain Trust in governmnet very well. I will add more variables. I have CPI, inflation data l…

OECD Trust in government data analysis 5 - Simple linear regression using R - Trust in governance and per capita GDP, log(per capita GDP)

Photo by Annie Spratt on Unsplash www.crosshyou.info This post is following of the above post. 5. Independent variable = capi, by year Almost year except for 2010 have positive coefficientt. But only 2017 is statisticaly significant. 6. In…

OECD Trust in government data analysis 4 - Simple linear regression using R - Trust in government ~ GDP, log(GDP).

Photo by Dulana Kodithuwakku on Unsplash www.crosshyou.info This post is following of the above post. Let's make log(capi) as l_capi. Let's make a scatter plot for trust and l_capi. It seems there is not clear relationship. Then, I load br…

OECD Trust in government data analysis 3 - Correlation between Trust in government and GDP, per capita GDP using R.

Photo by Sunil Naik on Unsplash www.crosshyou.info This post is following of the above post. I have another data file like below This is GDP and per capita GDP data.I will merge this data with trust in government data. First, I load this f…

OECD Trust in government data analysis 2 - ANOVA analysis shows Trust in government are different by countries. ITA has the lowest, CAN has the highest.

Photo by SGR on Unsplash www.crosshyou.info This post is following of the above post. In the previous post, I loaded OECD Trust in government data.Let's see overall histogram of the data. I use hist() function. It looks like normal distrib…

OECD Trust in government data analysis 1 - Using R read_csv() function to load CSV file data.

Photo by Taun Stewart on Unsplash I this series of posts, I will analysis OECD data, "Trust in governmet".I got below CSV file from General government - Trust in government - OECD Data I use R to analyze this data. Firstly, I load tidyvers…

都道府県別の工業用水量のデータ7 - 都道府県別にグループ分けして回帰分析する。

Photo by Mark X. on Unsplash www.crosshyou.info の続きです。 今回が都道府県別にグループ分けしてから回帰分析をしてみます。 まず、df_lmというデータフレーム(正しくはtibble)を作成して、その中に回帰分析の結果を格納しました。 切片をみてみましょ…

都道府県別の工業用水量のデータの分析6 - R言語のbroomパッケージのtidy()関数で効率よくlm()関数で回帰分析をする。

Photo by Markus Spiske on Unsplash www.crosshyou.info の続きです。 今回もR言語のlm()関数で回帰分析をしていこうと思います。今回はbroomパッケージのtidy()関数を使ってみます。 まずは、broomパッケージを読み込みます。 broomパッケージのtidy()関数…

都道府県別の工業用水量のデータの分析5 - R言語のlm()関数で回帰分析をする。(クロスセクション・データ)

Photo by Tanya Nevidoma on Unsplash www.crosshyou.info の続きです。 今回はR言語のlm()関数を使って回帰分析をしてみようと思います。 まずは、l_waterをl_kachiで回帰分析してします。 l_water: 工業用水量(m3/日)を対数変換したもの l_kachi: 製造業付…

都道府県別の工業用水量のデータの分析4 - R言語のいろいろなパッケージで相関係数マトリックスを作成する。

Photo by Daniel Seifried on Unsplash www.crosshyou.info の続きです。 今回は、各変数間の相関関係をみてみましょう。 2014年のデータを使ってみてみます。 まずは、調べる変数名の確認です。対数変換した変数で調べます。 names()関数でデータフレームdf…

都道府県別の工業用水量のデータの分析3 - R言語でt検定 海の無い県は明らかに工業用水量の使用量は少ない。

Photo by Jerry Adney on Unsplash www.crosshyou.info の続きです。 前回の分析で、どうやら海の無い県は工業用水の使用料が海のある県よりも少ないようです。 これを統計学的に検証してみましょう。 まず、2014年の海の無い県のwater_kachi: 製造業付加価…

都道府県別の工業用水量のデータの分析2 - 千葉県が一番多く工業用水を使い、奈良県は一番使わない。

Photo by Martina Mainetti on Unsplash www.crosshyou.info の続きです。 前回は工業用水量のデータをはじめ総人口や県内総生産額などのデータが対数正規分布になっていることを確認しました。 まず、codeだけではどれがどの都道府県なのかわからないので、…

都道府県別の工業用水量のデータの分析1 - R言語にデータを取り込む。

Photo by Joanna Huang on Unsplash 今回は、都道府県別の工業用水のデータを分析してみようと思います。 データは、政府統計の総合窓口(www.e-stat.go.jp)から取得しました。 47の都道府県を選択します。 工業用水量のデータの他に総人口、県内総生産額、製…

読書記録 - 「怨霊とは何か 菅原道真・平将門・崇徳院」 山田雄司 著 中公新書

怨霊とは何か - 菅原道真・平将門・崇徳院 (中公新書) 作者:山田 雄司 中央公論新社 Amazon 怨霊とは死ぬときに深い怨念を抱いて死んで、現世の世界に祟りをもたらす存在です。 菅原道真・平将門・崇徳院が日本の三大怨霊だそうです。 崇徳院は知らなかった…