2021-01-01から1年間の記事一覧
Photo by V Srinivasan on Unsplash www.crosshyou.info This post is following of the above post. In this post, let's do simple linaer regression anaysis using R. First, I use df_country data frame. Coefficients of avg_gr_us is -1.002e-04, it…
OECD Household disposable income data analysis 4 - make a data frame by country and by year using R.
Photo by Olga Tsai on Unsplash www.crosshyou.info This post is following of above post. In this post, let's make average value data frame by country and by year. First, I make a data frame for average value by country using group_by() func…
Photo by Lorena Schmidt on Unsplash www.crosshyou.info This post is following of above post. In this post, let's make some graphs to understand data distributions, data relationship. Fisrt, a histgram of gr_us. ecdf plot of gr_us. boxplot …
Photo by CHUTTERSNAP on Unsplash www.crosshyou.info This post is following of above post. In the previous post, we made a dafa frame called a "df". We see there are two values in subject, GROSSADJ and NET, two values in measure, AGRWTH and…
Photo by Bob Brewer on Unsplash In this post, I will analyze OECD Household disposable income. Household accounts - Household disposable income - OECD Data I got below CSV file from the web site. I will import this data into R. First of al…
Photo by Matt Anderson on Unsplash www.crosshyou.info の続きです。 前回の続きで、今度は交差項を含んだ回帰分析をします。 まずは、per_shobuをincとその他で回帰分析します。 p-valueが1.387e-13とかなり小さいの有意なモデルです。Multiple R-sauared…
Photo by Sam Mgrdichian on Unsplash www.crosshyou.info の続きです。 前回までの分析で気づいたことは、1人当たり県民所得が大きいところは1人当たりの書籍・文房具販売額も大きいということです。 相関係数を確認してみると、 というように相関係数は0.8…
Photo by Thor Alvis on Unsplash www.crosshyou.info の続きです。 今回はR言語でデータを可視化します。 ggplot2パッケージでのチャートをいくつか作ってみます。 per_shobu: 1人当たり年間書籍・文房具販売額(千円)のチャートです。geom_barでバーチャー…
Photo by Jan Haerer on Unsplash www.crosshyou.info の続きです。 今回は各変数の基本的な記述統計量をみてみます。 最小値はmin()関数、最大値はmax関数、平均値はmean()関数、中央値はmedian()関数、標準変数はsd()関数、パーセンタイル値は、quantile()…
Photo by Wil Stewart on Unsplash 今回は都道府県別の書籍・文房具の販売金額のデータを分析しようと思います。 データは政府統計の総合窓口、e-statから取得しました。(www.e-stat.go.jp) 47都道府県を選択して、 総人口、15~64歳の男性の割合、15~64歳の…
Photo by JJ Ying on Unsplash www.crosshyou.info This post is following of above post.In this post, I woll do time series data regression using R , dynlm package. Firstly, I wll make time series data. Then, let's see how data is looking. Le…
Photo by Yoksel Zok on Unsplash www.crosshyou.info This post is following of above post.In the previous post, we see it is better to convert all variables to logarithm to make more normal distribition looking.So, let's make new variables.…
Photo by Robert Lukeman on Unsplash www.crosshyou.info This post is following og above post. We have five combinations for value, 1. ACCI & NBR 2. DEATH & HAB 3. DEATH & VEH 4. DEATH & NBR 5. INJURE & NBR So, I will make five sub data fram…
コロナ感染者が日ごとに増加していますね。。 年齢別では30代以下が7割との報道がありましたが、 感染者急増 30代以下が7割超 - Yahoo!ニュース 職業別ではどうなっているのでしょうか? 気になったので、東京都のデータで調べてみました。 上の画像の東京都…
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…
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 …
Photo by Taisiia Shestopal on Unsplash www.crosshyou.info の続きです。 今回はlm()関数で回帰分析をして、その結果をstargazer()関数で美しく出力してみたいと思います。 shotoku_1617: 所得の2016年から2017年の変化幅を被説明変数にして、その他の変数…
Photo by Lesly Juarez on Unsplash www.crosshyou.info このブログは、上のブログの続きです。 今回は所得の変化幅をもう少し詳しくみてみます。 まずは、big6との関係を見てみます。 2016年から2017年の所得の変化幅は、big6は1万2千円、そうでないところ…
Photo by Karsten Winegeart on Unsplash www.crosshyou.info の続きです。 今回は前回作成したワイド型のデータフレームを使って、各データの変化幅を計算していましょう。 mutate()関数を使います。 select()関数とsummary()関数を使って各変化幅のサマリ…
Photo by Sharon Pittaway on Unsplash www.crosshyou.info このブログは上のブログの続きです。 今回はR言語のでロング型のデータフレームをワイド型に変換しようと思います。 ロング型のデータフレームは、 このように「科目」の列と「点数」で一つのデー…
Photo by JUNHØ on Unsplash www.crosshyou.info このブログは上のブログの続きです。 今回はデータをグラフにして視覚化しましょう。 まずは、ヒストグラムです。geom_histogram()関数を使います。 shotokuからいきます。 右端に離れ小島のように高額所得の…
Photo by Manuel Sardo on Unsplash 今回は都道府県別の後期高齢者医療制度被保険者実態調査のデータを分析してみようと思います。データは、政府統計の総合窓口(www.e-stat.go.jp)から取得しました。 この中から、都道府県別1人当たり所得額・保険料調定額…
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…
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…
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…
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…
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…
Photo by MusicFox Fx on Unsplash www.crosshyou.info 前回は差分でバス会社の数と人口や県内総生産額の回帰分析をしました。人口が10万増加すると、バス会社が8社増えるという関係でした。なんかそんなに増えるのか!という感じがします。 今回はもともと…
Photo by david Griffiths on Unsplash www.crosshyou.info の続きです。 今回は前回作成した、2001年と2013年の差分のデータで回帰分析をしてみようと思います。 まず。各変数の散布図をみてみます。 firm_pop_diffとfirm_gdp_diffは非常に相関が強いですね…
Photo by Brady Stoeltzing on Unsplash www.crosshyou.info の続きです。 前回の分析で、山梨県や島根県が人口や経済規模のわりにバス会社の数が多いことがわかりました。 今回は最新年の2013年と一番古い年の2001年でどれだけ各データが変化したのか見てみ…