www.crosshyou.info

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

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

都道府県別の医療施設調査の病院数のデータ分析3 - Rのinferパッケージを利用して、相関係数の検定を行う。

UnsplashのBob Brewerが撮影した写真 www.crosshyou.info 前回は、cor.test()関数を使って病院の数の変化幅と、開始年の病院の数の相関を検定しました。結果は、相関係数は-0.725と負の強い相関があり、95%信頼区間は-0.838 ~ -0.553でした。 今回は、infer…

都道府県別の医療施設調査の病院数のデータ分析2 - Rで棒グラフや散布図を描く。相関関係の検定をcor.test()関数で行う。

UnsplashのJoseph Chanが撮影した写真 www.crosshyou.info の続きです。 前回は、CSVファイルのデータをRのread_csv()関数で読み込み、summary()関数で平均値などの統計値を見ました。 1999年から病院の数は減り続けていることがわかりました。 そして、病院…

都道府県別の医療施設調査の病院数のデータ分析1 - RにCSVファイルのデータを 読み込む。

Unsplashのaboodi vesakaranが撮影した写真 今回は都道府県別の医療施設調査のデータを分析してみます。 政府統計の総合窓口(www.e-stat.go.jp)のウェブサイトからCSVファイルをダウンロードしました。 このようなCSVファイルです。年ごとの病院数と、2019年…

読書記録 - 「ドキュメント 豪雨災害 - そのとき人は何を見るか」 稲泉 連 著 (岩波新書)

ドキュメント 豪雨災害-そのとき人は何を見るか (岩波新書) 作者:稲泉 連 岩波書店 Amazon 2014年に出版の本です。2011年の台風12号で被災した、奈良県十津川村の様子が第1章、和歌山県那智勝浦町の様子が第2章、そして台風12号からは離れて、首都圏の水害…

OECD Crop production data analysis 9 - ANOVA(ANalysis Of VAriance) analysis with "infer" package using R

UnsplashのAnisur Rahmanが撮影した写真 www.crosshyou.info This post is followoing of the above post. In this post I will do ANOVA analysis with "infer" package using R. I would like to see crop production are different by crop, maize, rice,…

OECD Crop production data analysis 8 - Hierarchical Clustering using R

UnsplashのDustin Humesが撮影した写真 www.crosshyou.info This post is following of the above post. In this post, I will do Hierarchical Clustering using R. First, I make a matrix for clustering. I start with subsetting only year 2020 data. …

OECD Crop production data analysis 7 - time series data analysis using R - creating "ts" class object and visualize with TSstudio package.

UnsplashのMelanie Kreutzが撮影した写真 www.crosshyou.info This post is following of the above post.I will see time-seires trend of productivity of crop production data in this post. I refrer to Hands-On Time Series Analysis with R: Perform…

OECD Crop production data analysis 6 - correlation matrix and scatter plots matrix using R

UnsplashのOchir-Erdene Oyunmedegが撮影した写真 www.crosshyou.info This post is following of the above post. In this post, I will analyze correlations of vatiables. Let's begin with crop field area. I can use cor() function to see correlati…

読書記録 - 「脱炭素投資入門 (日経ムック)」日経BP 日本経済新聞出版 協力:三井住友トラスト・アセットマネジメント

脱炭素投資入門 (日経ムック) 日経BP 日本経済新聞出版 Amazon おそらく、三井住友トラスト・アセットマネジメントの「脱炭素関連 世界株式戦略ファンド」を宣伝するためのMOOKだと思いますが、脱炭素(CO2やメタンなどの温室効果ガス(GHG)の排出量と吸収量を…

OECD Crop production data analysis 5 - Using pivot_wider(), select() and rename() function to make a new "wider format" data frame.

UnsplashのSina Baharが撮影した写真 www.crosshyou.info This post is followiing of the above post. In this post, I will make wider format data frame from "df" data frame object. First, let's see "df" data frame. I see SUBJECT variable has 4 …

OECD Crop production data analysis 4 - crop productivity ranking using R

www.crosshyou.info This post is following of the above post. In this post, I will make crop productivity ranking by country. Crop productivity is "crop volume / crop field area", it is measured as TONNE_HA. Let's start with MAIZE. ISR(Isra…

OECD Crop production data analysis 3 - crop volume ranking using R ggplot() + geom_boxplot(). China is only one country which are in top 4 countries for all crops.

UnsplashのSpenser Sembratが撮影した写真 www.crosshyou.info This post is following of the above post.The above post is ti make crop field are ranking. In this post, I will make crop volume ranling by location. First, MAIZE. USA, China, Bras…

読書記録 - 「モンスーンの世界 日本、アジア、地球の風土の未来可能性」 安成 哲三 著 中公新書

モンスーンの世界 日本、アジア、地球の風土の未来可能性 (中公新書) 作者:安成哲三 中央公論新社 Amazon 西はインドから東は日本までのアジア地域一帯をモンスーンアジアと呼んで、この地域の気候、風土、文化などを学際的に解説している地理の教科書といっ…

OECD Crop production data analysis 2 - crop field area ranking using R visualization tool

UnsplashのMack Songが撮影した写真 www.crosshyou.info This post is following of the above post.In the previous post, I imported CSV file data into R. Then, let's visialize those data. First, let's see each 4 kinds of crops field area. Let's…

OECD Crop production data analysis 1 - Import CSV file into R using read_csv() function. MAIZE has the largest cropfields and volume.

UnsplashのMelissa Askewが撮影した写真 In this post, I will analyzie OECD Crop production data. Firstly, I downloaded data from "OECD (2023), Crop production (indicator). doi: 10.1787/49a4e677-en (Accessed on 01 July 2023)" I use R to analy…

都道府県別の工業統計調査のデータの分析7 - RでHeteroskedasticity Robust Inference とWLS(Weighted Least Square)

UnsplashのWolfgang Hasselmannが撮影した写真 www.crosshyou.info の続きです。 前回は、Rのlm()関数で線形回帰分析をしました。そして、そのモデルはHeteroskedasticityだとわかりました。このときの対処方法は、ひとつは、Heteroskedasticity Robustな標…

都道府県別の工業統計調査のデータの分析6 - Rのlm()関数で線形回帰分析を実行して、Heteroskedasticityをチェックした。

UnsplashのEugene Golovesovが撮影した写真 www.crosshyou.info の続きです。 今回は、Rで回帰分析をしてみたいと思います。 被説明変数を gdp : 県内総生産額にして、説明変数を num_jin, sta_num, sal_sta, inp_num, out_inp, add_staにしてみます。 まず…

読書記録 - 「プルトニウムの恐怖」 高木 仁三郎 著 岩波新書

プルトニウムの恐怖 (岩波新書) 作者:高木 仁三郎 岩波書店 Amazon 1981年に出版された本ですが、2023年の今でも読める本だと思います。 最近、SDGs(持続可能な開発目標)や脱炭素を推進しよう!と言っている人の中に、石炭・石油の火力発電から原子力発電に…

都道府県別の工業統計調査のデータの分析5 - クラスタリングするときはデータを標準化することが大事

UnsplashのMarjolein vVが撮影した写真 www.crosshyou.info の続きです。 前回はクラスタリング分析をしたのですが、少し気になる結果になりました。 それは、 このように、inp_numの値ではっきりとグループが分かれたことです。 考えてみると、クラスタリン…

都道府県別の工業統計調査のデータの分析4 - Rでクラスタリング分析 - 東京都と沖縄県は似ている。

UnsplashのKatie Aziが撮影した写真 www.crosshyou.info の続きです。 今回は、クラスタリング分析をしてみます。 まず、クラスタリング分析をするためのマトリックスオブジェクトを作成します。 今回は、num_jin : 人口当たりの事業所の数、sta_num : 事業…

都道府県別の工業統計調査のデータの分析3 - ひとつひとつの工場の規模が大きいのは山口県

UnsplashのAnthony DELANOIXが撮影した写真 www.crosshyou.info の続きです。 引き続き、各変数をグラフにしていきます。まずは、input : 原材料使用額(百万円単位)です。 summary()関数で基本統計値を確認します。 一番少ないところは、3434億円、一番多い…

都道府県別の工業統計調査のデータの分析2 - 事業所の数は大阪府が多い、現金給与総額は愛知県が多い。

UnsplashのWolfgang Hasselmannが撮影した写真 www.crosshyou.info 今回のブログは前回の続きです。前回はCSVファイルのデータをRに読み込ませました。 それでは、一つ一つの変数を詳しくみていきましょう。 まずは、num: 事業所の数です。summary()関数で基…

都道府県別の工業統計調査のデータの分析1 - データをRに読み込ませる。

UnsplashのOpal Siegalが撮影した写真 今回からしばらくは、都道府県別の工業統計調査のデータを分析してみたいと思います。 データは、政府統計の総合窓口、e-stat.go.jp から取得します。 こんな感じのデータです。 これをCSVファイルに出力します。 この…

読書記録 - 「月はすごい - 資源・開発・移住」 佐伯 和人 著 中公新書

月はすごい-資源・開発・移住 (中公新書) 作者:佐伯 和人 中央公論新社 Amazon 月への探査活動が盛り上がっているとのことです。 この本は、月に関する基礎知識、例えば、月は毎日50分ぐらい夜空に昇ってくるのが遅くなるなど、という話から始まって、月の地…

OECD Adult education level data analysis 9 - regression analysis with panel data using R

UnsplashのMartin Sanchezが撮影した写真 www.crosshyou.info This post is following of the above post. In the previous post, I made a panel data frame, n = 37, T = 2, N = 74. In this post, I do regression analysis with the panel data frame. F…

OECD Adult education level data analysis 8 - Making panel data frame using R plm package

UnsplashのDaniel Pelaez Duqueが撮影した写真 www.crosshyou.info This post is following of the above post. In the previous post, I did regression analysis with time-series data. Unfortunately, I cannot make a statistically significant model.…

OECD Adult education level data analysis 7 - Time series analysis, serial correlation, cochrane-orcutt estimation using R

UnsplashのMattia Bericchiaが撮影した写真 www.crosshyou.info This post is following of the above post. In the previous post, I did time-series regression with differenced data and found these models are not valid. So, I will do with level d…

OECD Adult education level data analysis 6 - Time series regression analysis using R

UnsplashのJohannes Wが撮影した写真 www.crosshyou.info This post is following of the above post. In this post, I will do time series regression analysis. Before starting this, let's see which LOCATION has the most obserbations. USA has 41 o…

読書記録 - 「一億三千万人のための小説教室」 高橋 源一郎 著 岩波新書

一億三千万人のための 小説教室 (岩波新書) 作者:高橋 源一郎 岩波書店 Amazon ずっと昔、高橋源一郎さんの「ゴーストバスターズ」という小説を読んだことがあります。その中の一節で太宰治の小説の真似をして書いた部分があって、「ああ、真似して書いてい…

OECD Adult education level data analysis 5 - Cross sectional regression analysis using R

UnsplashのAditi Bhattが撮影した写真 www.crosshyou.info This post is following of the above post. In the previous post, I make some scatter plots to feel some sense of variables relationships. In this post, I will do corss sectional regress…