2021-01-01から1年間の記事一覧
Photo by T o T on Unsplash www.crosshyou.info This post is following of above post. In this post, I will check if there is serial correlation in the previous regression model. First, I make residual with resid() function. Then, let's make …
Photo by Ashutosh Saraswat on Unsplash www.crosshyou.info This post is following of aabove post.In this post, I will do some time-series regression with R. First, I made JPN only dataframe. Let's see df_jpn. Then, I make ts object form df_…
Photo by corina ardeleanu on Unsplash www.crosshyou.info This post is following of above post. I have GDP data like below CSV file. So, let's combine this GDP data and Meat Consumption data. Next, I use inner_join() function to combine df2…
Photo by Casey Horner on Unsplash www.crosshyou.info This post is following of above post.In this post, let's draw scatter plots using R ggplot2::geom_point.First of all, let's see correlations about 4 KG_CAPs. bekg: BEEF KG_CAP and pokg: …
Photo by Claiton Conto on Unsplash www.crosshyou.info This post is following of above post.Let's see KG_CAP data as country average. Firstly, bekg: BEEK KG_CAP ARG is the highest beef consumption country. IND is the lowest. How about pikg:…
Photo by Nathan Anderson on Unsplash www.crosshyou.info This post is following of above post. Let's see coun: country. We see all country have 40 observations. Let's see year We see all year have 38 observations.So, df2 data frame is 40 co…
Photo by boris misevic on Unsplash www.crosshyou.info This post is following above post.Now, we now there are 4 sunjects and 2 measures. 4 subjects are BEEG, PIG, POULTRY and SHEEP. 2 measures are KG_CAP and THND_TONNE.So, we have 8 combin…
Photo by Wolfgang Hasselmann on Unsplash Hello! This post, I will anaysis OECD Meat Consumption data using R. I got a CSV file like below from OECD web site(Agricultural output - Meat consumption - OECD Data) Firstly, I load tidyverse pack…
Photo by Xavier von Erlach on Unsplash www.crosshyou.info の続きです。 こんどは、male_m: 男性の仕事の平均時間(分)を回帰分析してみます。 P-valueが0.703ということなので、有意なモデルではないです。 step関数でモデルを単純化してみます。 female_…
Photo by catrina farrell on Unsplash www.crosshyou.info の続きです。 各都道府県の 女性(15~64歳)の人口 / 男性(15~64歳)の人口の比率は西日本のほうが高いとわかりましたが、東日本全体の女性(15~64歳)の人口/東日本全体の男性(15~64歳)の人口と、西日…
Photo by Mark Harpur on Unsplash www.crosshyou.info rafalab.github.io というものでRidge Plotというものを知りましたので、忘れないうちに実践です。 Ridge Plotはあるデータ(身長、体重、所得など)の分布をグループごとに見るときに便利です。 早速、…
Photo by Manson Yim on Unsplash www.crosshyou.info の続きです。 前回の分析で西日本のほうが、女性の人口(15~64歳)/男性の人口(15~64歳)の比率が高い傾向にあることがわかりました。 統計的に有意に違うのか検定してみます。 p-valueは1.125e-06とかなり…
Photo by Dileep M on Unsplash www.crosshyou.info の続きです。 前回、女性の仕事時間 / 男性の仕事時間 という変数をfmという名前で作りました。 女性の人口 (15~64歳)/ 男性の人口(15~64歳) の変数をfm_popという名前で作ります。 こうしてみると東日本…
Photo by Edrick Krozendijk on Unsplash www.crosshyou.info の続きです。 男性の仕事の平均時間の長いところ、短いところはどこでしょうか? 鹿児島県、香川県、新潟県などが長い時間働いています。 山梨県、愛媛県、高知県が短いです。 同じ四国でも香川…
Photo by frank mckenna on Unsplash 今回は都道府県別の仕事の平均時間のデータを分析しようと思います。 データは、政府統計の総合窓口(www.e-stat.go.jp)から取得しました。 47の都道府県を選択します。 取得するデータは、 15~64歳人口(男)(人) 15~64歳…
Photo by BP Miller on Unsplash www.crosshyou.info This post is following of the above psot. In this post, let's test if there is serial correlation. Firdt of all, load lmtest package. All right, let's start with model1. p-value of lag resi…
Photo by Masako Ishida on Unsplash www.crosshyou.info This post is following of the above post. Which chountry has many observations? NZL has 22 observations. AUT, BEL, DNK, FIN, NOR and SWE have 16 observations. Let's see NZL data. We see…
Photo by Damien TUPINIER on Unsplash www.crosshyou.info This post is following of above post.Let's see which year has many observations. Okay, 2014, 2010, 2006 and 2018 have over 20 observations. Let's see those years more. First, emp dens…
高地文明―「もう一つの四大文明」の発見 (中公新書 2647) 作者:山本 紀夫 中央公論新社 Amazon 一般に知られている四大文明は、黄河文明、エジプト文明、インダス文明、メソポタミア文明の4つで、これらの文明は大河があることによって、穀類の大量栽培が可…
Photo by Luca Bravo on Unsplash www.crosshyou.info This post is following of above post. I will makse some graphs for data visualization using R. Fist, let's see how our data are distributed. I use ggplot() + geom_histogram() First, emp(em…
Photo by Trevor McKinnon on Unsplash In this post, I will analyze OECD Gender wage gap data. From the OECD web site, I downloaded the CSV data file like below. I will use R to analyze this data. First, I load tidyverse packages Then, I use…
Photo by shay cohen on Unsplash www.crosshyou.info の続きです。前回は都道府県別の平均値のデータフレームで回帰分析しましたが、今回は生のデータフレームで回帰分析してみます。 まず、変数間の散布図マトリックスをみてみます。 相関係数マトリックス…
Photo by Sajad Nori on Unsplash www.crosshyou.info の続きです。 今回は都道府県別の平均値のデータフレームを使って、回帰分析をしてみます。 まずは、east, big6, noseaというダミー変数を加えないで回帰分析してみます。 R言語のlm()関数を使います。 …
Photo by Tanya Grypachevskaya on Unsplash www.crosshyou.info の続きです。 まず、R言語のgroup_by()関数とsummarize()関数を使って、年ごとの平均値を計算してみます。 2002年、2005年、2008年、2011年、2014年と3年ごとに5年間ぶんのデータがあったので…
Photo by Tim Mossholder on Unsplash www.crosshyou.info の続きです。 今回はriyou以外の各変数の分布をみてみます。 まずは、mitsudo: 可住地面積1平方キロメートル当たりの人数、つまり人口密度です。 右のほうに外れ値っぽい分布があるのがわかります…
Photo by Rob Sheahan on Unsplash www.crosshyou.info の続きです。 riyou: 一般病院病床利用率(%)について、もう少しグラフをみてみます。 まずは、year: 調査年との関係です。 全体として、年を追うごとに一般病院病床利用率は低くなっていることがわかり…
Photo by L J on Unsplash www.crosshyou.info の続きです。 今回はgridExtraパッケージのgrid.arrange()関数でグラフを並べて表示できることを知ったので、忘れないように実践します。 riyou: 一般病院病床利用率(%)をグラフにします。 まずは、ヒストグラ…
Photo by Federico Bottos on Unsplash 新型コロナウイルスの影響で病床利用率がひっ迫している、というニュースをよく見聞きしますので、普段の病床利用率はどんなものなのか調べてみようと思いました。 政府統計の総合窓口(www.e-stat.go.jp)からデータを…
Photo by Toni Lluch on Unsplash www.crosshyou.info This post is following of above post.In this post I will do Bootstrap and make confidence inerval of regression. First, let's check coefficients for static regression model again. Intercep…
Photo by Jeremy Bishop on Unsplash www.crosshyou.info This post is following of above post.In this post, I will do time-series data regression using R. Firstly, I converted avg_gr_us in 10000 value. Then, I converted df_year2 data frame to…