Rで何かをしたり、読書をするブログ

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

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

都道府県別の道路平均交通量の分析2 - データの視覚化 - 大阪府が一番の交通量

(Bing Image Creator で生成: プロンプト: Close up of pink or purple Phlox subutata flowers, flowering on the sloped hill, blue sky, photo) www.crosshyou.info の続きです。今回はデータをグラフにして、どういうデータなのか、だいたいの感覚をつか…

都道府県別の道路平均交通量の分析1 - CSVファイルのデータをRに取り込む

(Bing Image Creator で生成: プロンプト: Close up of coffee flowers, photo, background is tropical rain forest and high mountains) 今回からしばらくは、都道府県別の道路平均交通量を分析してみようと思います。 政府統計の総合窓口(www.e-stat.go.j…

UCI Machine Learning Repository の Bank Marketing のデータの分析10 - ランダムフォレストによる予測

(Bing Image Creator で生成: プロンプト: Close up of pink Astragalus sinicus flowers, flowering aside water rice fields, blue sky, photo) www.crosshyou.info の続きです。 今回はランダムフォレストで予測してみましょう。randomForest パッケージ…

UCI Machine Learning Repository の Bank Marketing のデータの分析9 - ニューラルネットワークによる予測

(Bing Image Creator で生成: プロンプト: Close up of blue and red Hydrangea macrophylla flowers, flowering is rainy days on the beautiful location, photo) www.crosshyou.info の続きです。今回はニューラルネットワークによる予測をします。nnet …

UCI Machine Learning Repository の Bank Marketing のデータの分析8 - サポートベクターマシーンによる予測

(Bing Image Creator で生成: プロンプト: Closeup of white Swertia bimaculata flowers, background is deep forest, sun shining like linear thread, photo) www.crosshyou.info の続きです。 今回は、kernlab パッケージの ksvm() 関数でサポートベクタ…

UCI Machine Learning Repository の Bank Marketing のデータの分析7 - ツリーモデルでの予測

(Bing Image Creator で生成: プロンプト: Closeup of orange Pelargonium flowers, trees are in the great large grass field, photo) www.crosshyou.info の続きです。今回はツリーモデル、決定木で予測してみます。 rpart, rpart.plot パッケージの読み…

UCI Machine Learning Repository の Bank Marketing のデータの分析6 - k-Nearest Neighbors 法で予測

(Bing Image Creator で生成: プロンプト: Landscape of pink and white Spiranthes sinensis var. amoena, background is rock mountains, photo) www.crosshyou.info の続きです。 今回は、k-Nearest Neighbors 法で予測します。 class パッケージの読み込…

UCI Machine Learning Repository の Bank Marketing のデータの分析5 - Linear Probability Model での予測

(Bing Image Creator で生成: プロンプト: Close up photo of white and pink Hoya carnosa flowers, flowering on the higher mountains, background is blue sky and white clouds, photo) www.crosshyou.info の続きです。前回までデータの前処理は終わり…

読書記録 - 「リンカン 「合衆国市民」 の創造者」 紀平 英作 著 (岩波新書)

リンカン 「合衆国市民」の創造者 (岩波新書) 作者:紀平 英作 岩波書店 Amazon リンカーンじゃなくて、リンカンなんですね。リンカンはアメリカの大統領で、「人民の、人民による、人民のための政治」という言葉と、歴代大統領の中で一番尊敬されている大統…

UCI Machie Learning Repository の Bank Marketing のデータの分析4 - 外れ値の処理とデータの正規化

(Bing Image Creator で生成: プロンプト: Close up of Yellow Brassica rapa var. chinensis flowers, flowering along small clear creek, blue sky, photo) www.crosshyou.info の続きです。今回は純粋な数値のデータについて外れ値があるかどうか確認し…

UCI Machine Learning Repository の Bank Marketing のデータの分析3 - 各変数の yes の比率を調べて、カテゴリカル変数を数値変数に変換②

(Bing Image Creator で生成: プロンプト: Close up of Pink Cornus Florida flowers, background is white mountains, photo) www.crosshyou.info の続きです。残りの変数も調べていきます。 contact についてです。固定電話で話したか、携帯電話で話したか…

UCI Machine Learning Repository の Bank Marketing のデータの分析2 - 各変数の yes の比率を調べて、カテゴリカル変数を数値変数に変換①

(Bing Image Creator で生成: プロンプト: Close up of white Rhododendron flowers and pink Rhododendron flowers, flowering top of green hill, photo ) www.crosshyou.info の続きです。各変数がどんなものかチェックしていきましょう。 はじめに、作業…

読書記録 - 「地球の歴史 下 人類の台頭」 鎌田 浩毅 著 (中公新書)

地球の歴史 下 人類の台頭 (中公新書) 作者:鎌田浩毅 中央公論新社 Amazon 上・中・下の3冊シリーズの最終巻は、中生代の恐竜の話から人類のこと、そして最後は太陽が白色矮星になるまでのお話でした。 いまから6500万年前に、巨大な隕石が地球に落下して、…

UCI Machine Learning Repository の Bank Marketing のデータの分析1 - R にデータをインポート

(Bing Image Creator で生成: プロンプト: Closeup of pink Jasminum flowers and white Jasminum flowers, background is African desert land, white clouds, photo) 今回からしばらくは、UCI Machine Learning Repository の Bank Marketing のデータセッ…

都道府県別の15歳~64歳人口割合、1人当たり県民総所得、1人当たり最終エネルギー消費のデータの分析9 - R で Fixed Effect Regression Part II

(Bing Image Creator で生成: プロンプト: Closeup of purple Veronica persica flowers, flowering on the vast green up-down field, photo) www.crosshyou.info の続きです。前回は 都道府県別の固有の固定効果を説明変数に加えました。今回はさらに、年…

都道府県別の15歳~64歳人口割合、1人当たり県民総所得、1人当たり最終エネルギー消費のデータの分析8 - R で Fixed Effect Regression

(Bing Image Creator で生成: プロンプト: Close up of yellow Acacia dealbata flowers, background is beautiful night sky with many stars, photo) www.crosshyou.info の続きです。 前回は2つの年度のパネルデータで回帰分析をしました。その結果、pop…

都道府県別の15歳~64歳人口割合, 1人当たり県民総所得、1人当たり最終エネルギー消費のデータの分析7 - 2つの年度の差分のデータで回帰分析

(Bing Image Creator で生成: プロンプト: Close up of white Trifolium repens flowers, background is blue lake, blue sky, photo) www.crosshyou.info の続きです。 前回は、2011年度と2020年度の2つの年度のデータを使って、year のダミー変数を加えて…

都道府県別の15歳~64歳人口割合、1人当たり県民総所得、1人当たり最終エネルギー消費のデータの分析6- 2011年度と2020年度の2つの年度のデータで回帰分析

(Bing Image Creator で生成: プロンプト: Close up of pink and white Paeonia suffruticosa flowers, background is green grass field and blue sky, photo) www.crosshyou.info 前回の回帰分析では、15歳~64歳人口割合、1人当たり最終エネルギー消費の…

読書記録 - 「ルポ 軍事優先社会 暮らしの中の「戦争準備」」 吉田 敏浩 著 (岩波新書)

ルポ 軍事優先社会 暮らしの中の「戦争準備」 (岩波新書) 作者:吉田 敏浩 岩波書店 Amazon 日本の政府が着々と地方の空港や港湾を何かあったら米軍や自衛隊が使えるようにしたり、全国の自衛隊の基地に弾薬庫を新しく作ったり、防衛費を増加させたりして「軍…

都道府県別の15歳~64歳人口割合、1人当たり県民総所得、1人当たり最終エネルギー消費のデータの分析5- R で重回帰分析、1人当たり最終エネルギー消費の県民総所得に対する影響

(Bing Image Creator で生成: プロンプト: Close up of yellow Pieris japonica flowers, background is great long river and blue sky, photo) www.crosshyou.info の続きです。 今回は前回の線形回帰分析の説明変数に、enegy: 1人当たり最終エネルギー消…

都道府県別の15歳~64歳人口割合、1人当たり県民総所得、1人当たり最終エネルギー消費のデータの分析4 - 東京都をダミー変数にして回帰分析

(Bing Image Creator で生成: プロンプト: Close up of yellow Crocus flowers, background is higher beautiful mountain, photo) www.crosshyou.info の続きです。 前回は、東京都を含んだ状態と除いた状態で回帰分析しました。 そこで今回は、東京都を表…

都道府県別の15歳~64歳人口割合、1人当たり県民総所得、1人当たり最終エネルギー消費のデータの分析3 - R で単回帰分析

(Bing Image Creator で生成, プロンプト: Close up of purple Muscari flowers, background is blue sky and white clouds, photo) www.crosshyou.info の続きです。今回は、R で単回帰分析をしてみます。 2020年度のデータだけを使って回帰分析してみよう…

読書記録 - 「脳の意識 機械の意識 脳神経科学の挑戦」 渡辺 正峰 著 (中公新書)

脳の意識 機械の意識 脳神経科学の挑戦 (中公新書) 作者:渡辺正峰 中央公論新社 Amazon 脳の働きは、脳の神経細胞、ニューロンの活動がもとになっていて、この活動には物理的・化学的に説明がつくということです。ニューロンの中は電気信号が情報の伝達をし…

都道府県別の15歳~64歳人口割合、1人当たり県民総所得、1人当たり最終エネルギー消費のデータの分析2 - R で相関係数マトリックスや散布図を描く

(Bing Image Creator で生成: プロンプト Closeup of Primula Polyanthus flowers, purple flowers and pink flowers, background is green grass field, photo) www.crosshyou.info の続きです。 今回はデータの視覚化をしてみましょう。 まず、各変数のヒ…