2022-01-01から1年間の記事一覧
UnsplashのAlex Personが撮影した写真 www.crosshyou.info の続きです。 前回行ったクラスタリングの結果をデータフレーム、dfにくっつけます。 まず、dfがどんなものだったか、str()関数で確認します。 これにクラスタリングの結果をくっつけたいので、まず…
東京国税局査察部 (岩波新書) 作者:立石 勝規 岩波書店 Amazon 1999年に出版された本なので、東京国税局査察部が現在もこの本に書かれているようなものなのかはわかりませんが、1999年当時を思い出すことができました。 金丸信の脱税や、山一證券の自主廃業…
UnsplashのSebastian Unrauが撮影した写真 www.crosshyou.info 前回はデータフレームを大きい順、小さい順に並び替えました。東京都や大阪府などが値が大きくて、奈良県などが値が小さかったです。 そこで今回は、R言語でクラスタリングを実行してみたいと思…
UnsplashのBoris Smokrovicが撮影した写真 www.crosshyou.info の続きです。 前回は都道府県ごとの統計値のデータフレーム、(stat_prefと名前をつけた)、を作成しました。今回はこのデータフレームを並び替えてどういう都道府県が値が大きいのかを調べてみま…
UnsplashのMarek Piwnickiが撮影した写真 www.crosshyou.info の続きです。 前回はCSVファイルにあるデータをR言語に読み込ませ、分析用のデータフレームを作成するところまで進みました。 まず、hist()関数でvalue: 売上高(百万円単位)の分布をみてみましょ…
UnsplashのAaron Burdenが撮影した写真 今回は都道府県別の経済構造実態調査のデータを分析してみようと思います。 まず、政府統計の総合窓口(e-stat.go.jp)からデータをダウンロードします。 経済構造実態調査は、我が国の製造業及びサービス産業における企…
日本のコメ問題-5つの転換点と迫りくる最大の危機 (中公新書 2701) 作者:小川 真如 中央公論新社 Amazon コメ問題と田んぼ問題がごちゃまぜになっていることが問題のようです。 今世紀中、この本では2052年ごろに、日本の農地が余る状態、つまり、全部の農…
UnsplashのWolfgang Hasselmannが撮影した写真 www.crosshyou.info This post is following of the above post.In this post, I will do hierarchical clustering using R. It is very easi with R. Firstly, I make a matrix for hierarchical clustering. …
UnsplashのPierre Lemosが撮影した写真 www.crosshyou.info Thsi post is following of the above post. In this post I will arrange data frame with arrange() function of dplyr packkage. Let's make a graph with ggplot2 packages. LUX has the highe…
Unsplashのmartin bennieが撮影した写真 www.crosshyou.info This post is following of above post. Let's calculate difference between Y2016 and Y2015 Let's see a histogram of d2016 Then, let's calculate difference between Y2017 and Y2016 Let's…
UnsplashのHeather Wildeが撮影した写真 www.crosshyou.info This post is following of the above post. In this post, I will show some statistics of our data. Before investigation, I make data frame to wide format with pivot_wider() function. W…
UnsplashのJ Cruikshankが撮影した写真 www.crosshyou.info This post is following of the above post. In the previous post, I load CSV file data into R. Then, let's make some basic graphs using ggplot2 package. Scatter plot ggplot() + geom_poi…
UnsplashのJeremy Thomasが撮影した写真 In this post, I will use R for analysis about OECD Non-Financial Corporations Debt to Surplus Ratio. This ratio is debt outstanding / annual flow if gross operating surplus. So, the higher the ratio, t…
UnsplashのWexor Tmgが撮影した写真 www.crosshyou.info の続きです。前回はR言語で階層クラスタリングをしました。今回は非階層クラスタリングをしてみて、前回の結果を比較してみます。 k-means法というクラスタリング手法で、kmeans()関数で実行可能です…
UnsplashのSora Saganoが撮影した写真 www.crosshyou.info 前回までは回帰分析をしていましたが、 今回はR言語でクラスタリングをしてみようと思います。 まず、クラスタリング用のデータフレームとして、aggregate()関数とmean()関数を使って3年間の平均の…
UnsplashのLeopold Stengerが撮影した写真 www.crosshyou.info 前回は年と都道府県も説明変数に加えてtworatioを重回帰分析してみました。その結果、l_num: 健康診断を実施した事業場数の対数変換値はtworatioを説明する有意な変数ではないことがわかりまし…
UnsplashのGanapathy Kumarが撮影した写真 www.crosshyou.info の続きです。 前回の重回帰モデルに年と都道府県を説明変数に加えて、l_numの係数がどうなるかを見てみます。 まず、yearをas.factor()関数でファクター型に変換した変数をつくります。 yfがフ…
UnsplashのYoksel Zokが撮影した写真 www.crosshyou.info の続きです。 前回は tworatio: 2回以上実施した事業場数の割合をnum: 検査を実施した事業所の数で回帰分析してみました。その結果、事業所の数が大きいほど、割合は低下している傾向があることがわ…
未踏の蒼穹 (創元SF文庫) 作者:ジェイムズ・P・ホーガン 東京創元社 Amazon 大学生か高校生の頃に同じ作者の「星を継ぐもの」を読んでほんとうにSFって面白いと感じました。同じ作者の同じような話です。地球人はもう絶滅してしまっていて、金星人たちが主…
理論とケースで学ぶ 企業倫理入門 白桃書房 Amazon 企業倫理学は、誤解を恐れずに言えば、グッド・ビジネスとは何かを探求する学問である。そして、「グッド」の基準を定めることの難しさと「ビジネス」という言葉の多様性がこの学問の面白いところだと思っ…
UnsplashのCristina Anne Costelloが撮影した写真 www.crosshyou.info 今回は、上のブログの続きです。 前回は、散布図や箱ひげ図を描きました。今回は、barplot()関数を使って棒グラフを描いてみます。 まずは、ritsu: 所見のあった人数の割合を都道府県ご…
UnsplashのJean Girouxが撮影した写真 www.crosshyou.info 前回はR言語でヒストグラムを描きました。今回は散布図を描いでみます。 plot()関数で、データフレームの散布図にしたい変数を指定すると、上の画面のような散布図のマトリックスが描かれます。 rit…
Photo by Thijs Boom on Unsplash www.crosshyou.info この記事は上の記事の続きです。 今回は、R言語に読み込んだデータをグラフにしてみます。tidyverseパッケージを使わずに、通常のグラフィック関数でやってみます。 まずは、それぞれの変数の分布状況を…
Photo by Dana Luig on Unsplash 今回は、都道府県別の定期健康診断結果報告のデータを調べてみます。 政府統計の総合窓口(www.e-stat.go.jp)のウェブサイトからデータをダウンロードします。 定期健康診断結果報告は、労働安全衛生法に基づく定期健康診断結…
Photo by S. Tsuchiya on Unsplash www.crosshyou.info This post is following above post. In the previous post, I did multiple regression, s_ni_kg ~ s_po_kg + s_ni_to. Let's add 'time' variables. All time variables are not statistically signi…
Photo by Harry Gillen on Unsplash www.crosshyou.info This post is following of the above post. In the previous post, I made scaled variables in df4, let's see correlation matrix of those variables. The most highly correlated variable pair …
Photo by Philip Myrtorp on Unsplash www.crosshyou.info This post is following of above post. Since I made several objects, let me confirm what objects there is. ls() function shows current object list. So far, I have df_raw, df1, df2 and d…
Photo by Erda Estremera on Unsplash www.crosshyou.info This post is following of above post. Let's make two scatter plots and display them in a panel. Firstly, I load gridExtra package. Then, I make two objects, each object is for a scatte…
Photo by Ash from Modern Afflatus on Unsplash www.crosshyou.info This post is following of above post. In the above post, I made a dataframe which has basic statistics data for each locations. Let's look into it further, Firstly, let's see…
Photo by Stephen Leonardi on Unsplash www.crosshyou.info This post is following of above post. I will make line charts using R ggplot2 package. Let's start with ni_kg(NITROGEN measured by KG_HA) Some locations have declining trend, some ha…