{"id":1453,"date":"2025-10-22T23:40:10","date_gmt":"2025-10-22T14:40:10","guid":{"rendered":"https:\/\/dm-game.net\/?p=1453"},"modified":"2025-10-30T11:51:22","modified_gmt":"2025-10-30T02:51:22","slug":"ma-01-ssdse%e3%82%92%e6%b4%bb%e7%94%a8","status":"publish","type":"post","link":"https:\/\/dm-game.net\/?p=1453","title":{"rendered":"Ma.01. SSDSE\u3092\u6d3b\u7528"},"content":{"rendered":"\n<p>SSDSE\u306f\u4f7f\u3044\u3084\u3059\u3044\u3088\u3046\u3067\u4f7f\u3044\u306b\u304f\u3044\u3002<br>\u3069\u3046\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u4e2d\u3067\u4f55\u304b\u3092\u5206\u6790\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u6271\u3044\u3084\u3059\u3044\u304c\u3001\u3069\u306e\u5909\u6570\u3082\u3042\u307e\u308a\u95a2\u5fc3\u3092\u96c6\u3081\u306a\u3044\u3002<br>\u5909\u6570\u540d\u304c\u4e01\u5be7\u306a\u65e5\u672c\u8a9e\u306a\u306e\u3067\u3001\u4e00\u3064\u3065\u3064\u771f\u9762\u76ee\u306bRename\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002\u305b\u3081\u3066\u30ed\u30fc\u30de\u5b57\u306a\u3089\u3070\u3001\u3001\u3001<br><br>SSDSE\u306e\u6d3b\u7528\u306b\u6163\u308c\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u304c\u3001\u4f7f\u3044\u59cb\u3081\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u53e9\u304f\u5fc5\u8981\u304c\u3042\u308b\u3060\u308d\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SSDSE\u306e\u524d\u51e6\u7406\uff08SSDSE-E\u306e\u5834\u5408\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#SSDSE-E\u3092\u767b\u7528\nssdse &lt;- read_csv(\"Data\/SSDSE-E-2025.csv\", \n                  locale = locale(encoding = \"CP932\"), \n                  skip = 2)\n\n#\u65e5\u672c\u8a9e\u540d\u306e\u5909\u6570\u306f\u6271\u3044\u306b\u304f\u3044\u305f\u3081Rename\u3059\u308b\n#rename\u306f\u5148\u306b\u65b0\u3057\u3044\u540d\u524d\u3092\u6307\u5b9a\u3059\u308b\n<strong>ssdse &lt;- ssdse %>% \n  rename(area_code = `\u5730\u57df\u30b3\u30fc\u30c9`)<\/strong>\n\n#R0000\uff08\u5168\u56fd\u5e73\u5747\uff09\u306f\u5206\u6790\u306e\u90aa\u9b54\u306a\u306e\u3067Filter\u3059\u308b\n<strong>ssdse &lt;- ssdse %>% \n  dplyr::filter(area_code != \"R00000\")<\/strong>\n\n#R****\u3068\u3044\u3046\u5730\u57df\u30b3\u30fc\u30c9\u306f\u6271\u3044\u3065\u3089\u3044\u305f\u3081\u3001\u6570\u5024\u30c7\u30fc\u30bf\u3068\u3057\u3066\u90fd\u9053\u5e9c\u770c\u30b3\u30fc\u30c9\u3092\u53d6\u308a\u51fa\u3059\u3002\n#\u3053\u3053\u3067\u306f\u6587\u5b57\u5217\u306e2\u6587\u5b57\u76ee\u304b\u30893\u6587\u5b57\u3081\u3092\u53d6\u308a\u51fa\u3057\u307e\u3057\u3066\u3001Tiiki\u3068\u3044\u3046\u5909\u6570\u306b\u3057\u3066\u3044\u307e\u3059\u3002\n<strong>ssdse &lt;- ssdse %>% \n  mutate(tiiki = as.numeric(str_sub(area_code, 2, 3)))<\/strong>\n\n<\/code><\/pre>\n\n\n\n<p>\u305f\u3068\u3048\u3070\u3001SSDSE\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u81ea\u6bba\u7387\u3092\u5165\u308c\u305f\u3044\u3068\u3057\u307e\u3059\u3002<br>\u305d\u306e\u5834\u5408\u306f\u3001e-stat\u304b\u3089\u81ea\u6bba\u7387\u3092\u63a2\u3057\u3066\u304d\u3066\u304f\u3060\u3055\u3044\u3002\u300cI910803_\u81ea\u6bba\u7387\uff08\u4eba\u53e310\u4e07\u5bfe\uff09\u300dI\uff08\u30a2\u30a4\uff09\u306e\u30ab\u30c6\u30b4\u30ea\u307f\u305f\u3044\u3067\u3059\u3002<br>\u305d\u308c\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u8aad\u307f\u8fbc\u307f\u3001\u4f7f\u3048\u308b\u5f62\u306b\u3057\u307e\u3059\u3002\uff08\u9762\u5012\u3067\u3059\u304c\u3001\u3053\u308c\u4ee5\u5916\u306e\u3084\u308a\u65b9\u3092\u77e5\u308a\u307e\u305b\u3093\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5225\u306e\u30c7\u30fc\u30bf\u3092DL\u3057\u3066\u7d50\u5408\u306e\u6e96\u5099\u3092\u3059\u308b<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>jisatu &lt;- read_csv(\"Data\/jisatu.csv\", \n                   col_types = \"__d__d\",#Skip,Skip,Numeric,Skip,Numeric\u3067\u8aad\u307f\u53d6\u308b\u3002\u4e0d\u8981\u306a\u5217\u3092\u5165\u308c\u8fbc\u307e\u306a\u3044\u3002\n                   locale = locale(encoding = \"CP932\"), \n                   skip = 1)<\/strong>\nnames(jisatu) #\u96e3\u89e3\u306a\u5909\u6570\u540d\u304c\u591a\u3044\u306e\u3067\u3001\u30b3\u30d4\u30fc\u3059\u308b\u305f\u3081\n\n<strong>jisatu &lt;- jisatu %>% \n  mutate(tiiki = as.numeric(`\u5730\u57df \u30b3\u30fc\u30c9`) * 0.001)<\/strong>\u3000#\u50d5\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u5730\u57df\u30b3\u30fc\u30c9\u3068\u306f\u5225\u306b\u770c\u306e\u30b3\u30fc\u30c9\uff08tiiki\uff09\u3092\u4f5c\u6210\u3057\u307e\u3059\n\n<strong>jisatu &lt;- jisatu %>% \n  rename(jisatu = 'I910803_\u81ea\u6bba\u7387\uff08\u4eba\u53e310\u4e07\u5bfe\uff09\u3010\u2010\u3011')<\/strong>  #\u3042\u307e\u308a\u306b\u6271\u3044\u306b\u304f\u3044\u306e\u3067\u3001\u5909\u6570\u540d\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002\n\n\n<\/code><\/pre>\n\n\n\n<p>\u3053\u3046\u3057\u3066\u3001tiiki\u3068\u3044\u3046\u5171\u901a\u306e\u90fd\u9053\u5e9c\u770c\u30b3\u30fc\u30c9\uff08Numeric\uff09\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u5f8c\u306f\u7d50\u5408\u304c\u697d\u306b\u3067\u304d\u307e\u3059\u3002<br>\u3061\u306a\u307f\u306b\u3001\u5730\u57df\u30b3\u30fc\u30c9\u3092\u6b8b\u3057\u305f\u306e\u3067\u3001\u3053\u306e\u5f8c\u306e\u7d50\u5408\u306f\u3001\u5730\u57df\u30b3\u30fc\u30c9\u3067\u7d50\u5408\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u5408\u306e\u5b9f\u969b\uff08left_join\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>join_df&lt;- left_join(ssdse,jisatu, #\u57fa\u6e96df,\u52a0\u3048\u308bdf\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000by = \"tiiki\", #Key\u306e\u9806\u3002\n                    suffix = c(\"_x\", \"_y\"))<\/strong>\u3000#\u4eee\u306b\u540c\u3058\u5909\u6570\u540d\u304c\u3042\u3063\u305f\u5834\u5408\u306f_x_y\u3092\u3064\u3051\u3066\u304f\u308c\u308b<\/code><\/pre>\n\n\n\n<p>\u76ee\u7684\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304c\u3067\u304d\u3042\u304c\u308c\u3070\u3001\u305d\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u7528\u3044\u3066\u5206\u6790\u3092\u884c\u3046\u3002<br>\u6700\u5f8c\u306bunmatched = \u201cdrop\u201d\u3000\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001\u30de\u30c3\u30c1\u3057\u306a\u304b\u3063\u305f\u884c\u306f\u57fa\u6e96Df\u304b\u3089\u3082\u9664\u3044\u3066\u304f\u308c\u308b\uff08Inner_join\u3068\u540c\u3058\u6319\u52d5\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e00\u90e8\u5206\u3060\u3051left_join\u3057\u305f\u3044\u3068\u304d<\/h3>\n\n\n\n<p>\u5168\u90e8left_join\u3059\u308b\u3068\u8996\u8a8d\u6027\u304c\u4f4e\u304f\u306a\u308a\u307e\u3059\u3002<br>\u4e00\u90e8\u5206\u3060\u3051\u3092left_join\u3059\u308b\u306b\u306f\u3001\u7d50\u5408\u3059\u308bdf\uff08\u52a0\u3048\u308b\u65b9\u306eDf\uff09\u304b\u3089\u5909\u6570\u3092select\u3059\u308b\u306e\u304c\u9069\u5207\u3067\u3059\u3002<br>\u4ee5\u4e0b\u306f\u3001\u5408\u8a08\u7279\u6b8a\u51fa\u751f\u7387\u3092\u629c\u304d\u51fa\u3059\u5834\u5408\u3067\u3059\u3002\uff08\u5408\u8a08\u7279\u6b8a\u51fa\u751f\u7387\u306eHigh\/Low\u3082\u51fa\u3057\u305f\u3044\uff09<br>\u305d\u306e\u5f8c\u306e\u5c55\u958b\u3092\u898b\u8fbc\u307f\u3001naiman\u306b\u7d50\u5408\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>tfr &lt;- join_df %>% \n  dplyr::select(\u5408\u8a08\u7279\u6b8a\u51fa\u751f\u7387,tiiki)\n\ntfr &lt;- tfr %>% \n  rename(tfr = '\u5408\u8a08\u7279\u6b8a\u51fa\u751f\u7387') %>% \n  mutate(tfr_f = if_else(tfr > 1.2 , 1, 0),\n         tfr_f = as.factor(tfr_f))\n\nnaiman_ketsugo &lt;- left_join(naiman, tfr, by = \"tiiki\",\n                            suffix = c(\"_x\", \"_y\"),\n                            unmatched = \"drop\")<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSDSE\u306f\u4f7f\u3044\u3084\u3059\u3044\u3088\u3046\u3067\u4f7f\u3044\u306b\u304f\u3044\u3002\u3069\u3046\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u4e2d\u3067\u4f55\u304b\u3092\u5206\u6790\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u6271\u3044\u3084\u3059\u3044\u304c\u3001\u3069\u306e\u5909\u6570\u3082\u3042\u307e\u308a\u95a2\u5fc3\u3092\u96c6\u3081\u306a\u3044\u3002\u5909\u6570\u540d\u304c\u4e01\u5be7\u306a\u65e5\u672c\u8a9e\u306a\u306e\u3067\u3001\u4e00\u3064\u3065\u3064\u771f\u9762\u76ee\u306bRename\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002\u305b\u3081\u3066\u30ed\u30fc\u30de\u5b57 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,29,31,33],"tags":[],"class_list":["post-1453","post","type-post","status-publish","format-standard","hentry","category-blog","category-dsjugyo","category-pbl","category-mapr"],"_links":{"self":[{"href":"https:\/\/dm-game.net\/index.php?rest_route=\/wp\/v2\/posts\/1453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dm-game.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dm-game.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dm-game.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dm-game.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1453"}],"version-history":[{"count":12,"href":"https:\/\/dm-game.net\/index.php?rest_route=\/wp\/v2\/posts\/1453\/revisions"}],"predecessor-version":[{"id":1550,"href":"https:\/\/dm-game.net\/index.php?rest_route=\/wp\/v2\/posts\/1453\/revisions\/1550"}],"wp:attachment":[{"href":"https:\/\/dm-game.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dm-game.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dm-game.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}