www.crosshyou.info

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

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

読書記録 - 「地政学入門 改版 - 外交戦略の政治学」 曽村 保信 著 中公新書

地政学入門 改版 - 外交戦略の政治学 (中公新書) 作者:曽村 保信 中央公論新社 Amazon 1984年が初版で、2017年が改版の初版です。 序章のタイトルが、「地球儀を片手に」ということで、地球儀を手元に置いて読んだらもっとよく理解できるだろうなと感じまし…

都道府県別の保護統計調査のデータの分析5 - R言語のgeom_col()でバーグラフ、geom_line()でライングラフを描く。

UnsplashのTom Podmoreが撮影した写真 www.crosshyou.info の続きです。 今回は2021年のデータを使い、前回作成した各保護観察処分の割合を見てみます。 まずは、1号観察の比率ランキングをみてみます。 那覇は6割、松江は2割ぐらいと、都道府県によって大…

都道府県別の保護統計調査のデータの分析4 - R言語のpivot_wider()でデータフレームをワイド型に変換して、散布図マトリックスを描く。

UnsplashのRoméo A.が撮影した写真 www.crosshyou.info の続きです。 今回は、データフレームを少し変形します。 このように、保護観察処分の1号、2号、3号、4号が一つの type の列におさまっているのを、 このように、1号は1号の列、2号は2号の列と…

都道府県別の保護統計調査のデータの分析3 - R言語のggplot()+geom_histogram()でヒストグラムを描く

UnsplashのEd Robertsonが撮影した写真 www.crosshyou.info の続きです。 前回と同様に、でも今度は2つの変数の組み合わせ別に基本統計量を算出します。 まずは、typeとlocationです。 typeとyearの基本統計量のデータセットを作ります。 三つ目は、location…

都道府県別の保護統計調査のデータの分析2 - Rのgroup_by(), summarize()などを使用して基本統計量をタイプ別、場所別、年別に算出する。

UnsplashのMarkus Spiskeが撮影した写真 www.crosshyou.info 上のブログ記事の続きです。 前回は、保護観察統計のデータをRに読み込ませるところまでやりました。 今回は、もう少し分析っぽいことをやりましょう。 まず、データの見た目を整えます。 typeの…

読書記録 - 「迫りくる核リスク <核抑止> を解体する」 吉田 文彦 著 岩波新書

迫りくる核リスク 〈核抑止〉を解体する (岩波新書 新赤版 1946) 作者:吉田 文彦 岩波書店 Amazon 核戦争がいままで起こらなかったのは、米国とソ連(ロシア)の核抑止戦略が機能していたというよりは、幸運によるところが大きかった。 核兵器を地球上から廃絶…

都道府県別の保護統計調査のデータの分析1 - Rでcsvファイルのデータを読み込み、tidyなデータフレームに修正する。

UnsplashのVishu Jooが撮影した写真 今回は、都道府県別の保護統計調査のデータを分析してみようと思います。 政府統計の総合窓口、e-statのウェブサイトからデータ取得します。 観察所別 開始人員累年比較 というデータをダウンロードしてみます。 このよう…

OECD Nuclear power plants data analysis 5 - Hypothesis test for One proportion using R infer package.

UnsplashのCraig Mannersが撮影した写真 www.crosshyou.info This post is following of the above post. In this post, I will do hypothesis test for one proportion. For Japan nuclear power plants proportion. In the previous post, I found Japan n…

OECD Nuclear power plants data analysis 4 - Getting confidence interval for one proportion using R infer package

UnsplashのMaarten van den Heuvelが撮影した写真 www.crosshyou.info This post is following of the above post. In this post, I will get confidence interval for one proportion. In this case, number of nuclear power plants in Japan / number of …

OECD Nuclear power plants data analysis 3 - Hypothesis testing using R with infer package

UnsplashのYan Agritが撮影した写真 www.crosshyou.info This post is following of the above post. In this post I do hypothesis testing using R with infer package. I refere to B Inference Examples | Statistical Inference via Data Science (mode…

OECD Nuclear power plants data analysis 2 - Getting Confidence Interval using R with infer package

UnsplashのEean Chenが撮影した写真 www.crosshyou.info This post is following of the above post.I will calculate confidence interval in this post. There are two ways to calclulate confidence interval, one is bootstrap method and the other is…

OECD Nuclear power plants data analysis 1 - Loading CSV data with R - USA has the most nuclear power plants.

UnsplashのLukáš Lehotskýが撮影した写真 In this post, I will playaround with OECD Nuclear power plants data with R. OECD Nuclear power plants data is defined as the number of nuclear units in operation as of 1 January 2019. It is measured a…

都道府県別の個人企業経済調査(製造業と卸売業、小売業)のデータ分析6 - R言語でクラシフィケーション、パラメータをチューニングしてさらに正解率を高める。

UnsplashのJonatan Pieが撮影した写真 www.crosshyou.info の続きです。 前回はR言語のcaretパッケージで、generalized liner model regressionとk-nearest neighborsの2つの方法でクラシフィケーションをしました。 k-nnはチューニングのパラメータがありま…