{"id":3727,"date":"2025-02-13T17:16:18","date_gmt":"2025-02-13T08:16:18","guid":{"rendered":"https:\/\/plaza.umin.ac.jp\/~OIO\/?p=3727"},"modified":"2025-02-13T17:28:24","modified_gmt":"2025-02-13T08:28:24","slug":"sah%e3%81%ae%e3%82%a2%e3%82%a6%e3%83%88%e3%82%ab%e3%83%a0%e4%ba%88%e6%b8%ac%e3%83%a2%e3%83%87%e3%83%ab%e3%81%ae%e6%a7%8b%e7%af%89","status":"publish","type":"post","link":"https:\/\/plaza.umin.ac.jp\/~OIO\/?p=3727","title":{"rendered":"SAH\u306e\u30a2\u30a6\u30c8\u30ab\u30e0\u4e88\u6e2c\u30e2\u30c7\u30eb\u306e\u69cb\u7bc9"},"content":{"rendered":"\n<p>pROC\u30d1\u30c3\u30b1\u30fc\u30b8\u306eaSAH\u30c7\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u3066\u3001\u591a\u5909\u91cf\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u89e3\u6790\u3092\u884c\u3044\u3001<code>outcome<\/code>\u3092\u4ed6\u306e\u5909\u6570\u3067\u4e88\u6e2c\u3059\u308b\u4e88\u6e2c\u5f0f\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u5177\u4f53\u7684\u306a\u624b\u9806\u3067\u3059\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8aad\u307f\u8fbc\u307f<\/strong><\/li>\n\n\n\n<li><strong>\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f<\/strong><\/li>\n\n\n\n<li><strong>\u591a\u5909\u91cf\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u69cb\u7bc9<\/strong><\/li>\n\n\n\n<li><strong>\u30e2\u30c7\u30eb\u306e\u7d50\u679c\u3092\u89e3\u91c8\u3059\u308b<\/strong><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b9\u30c6\u30c3\u30d71: \u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8aad\u307f\u8fbc\u307f<\/h3>\n\n\n\n<p>\u307e\u305a\u3001\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: r; title: ; notranslate\" title=\"\">\ninstall.packages(&quot;pROC&quot;)\ninstall.packages(&quot;dplyr&quot;)\n\nlibrary(pROC)\nlibrary(dplyr)\nlibrary(ggplot2)\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u30b9\u30c6\u30c3\u30d72: \u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f<\/h3>\n\n\n\n<p>\u6b21\u306b\u3001aSAH\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002\u4e88\u6e2c\u5f0f\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b\u306f\u30ab\u30c6\u30b4\u30ea\u30fc\u30921, 0 \u306e\u6570\u5b57\u306b\u7f6e\u304d\u63db\u3048\u305f\u307b\u3046\u304c\u3044\u3044\u306e\u3067\u3001outcome, gender wfns\u3092\u30c0\u30df\u30fc\u5909\u6570\u306b\u5909\u63db\u3057\u307e\u3059\u3002wfins\u306f\u5404\u5024\u3092\u5225\u3005\u306e\u30c0\u30df\u30fc\u5909\u6570wfns2, wfns3, wfns4, wfns5\u306b\u7f6e\u304d\u63db\u3048\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u3059\u3079\u3066\u304c0\u306a\u3089wfns1\u304c1\u306b\u306a\u308b\u306f\u305a\uff08\u6b20\u6e2c\u5024\u304c\u7121\u3044\uff09\u3068\u3044\u3046\u4e8b\u3067\u3001wfns1\u306f\u4f5c\u6210\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: r; title: ; notranslate\" title=\"\">\ndata(aSAH, package = &quot;pROC&quot;)\n\n# outcome\u5909\u6570\u3092\u6570\u5024\u578b\u306e\u30c0\u30df\u30fc\u5909\u6570\u306b\u5909\u63db\naSAH &lt;- aSAH %&gt;%\n  mutate(good_outcome = ifelse(outcome == &quot;Good&quot;, 1, 0))\n\n# gender\u5909\u6570\u3092\u6570\u5024\u578b\u306e\u30c0\u30df\u30fc\u5909\u6570\u306b\u5909\u63db\naSAH &lt;- aSAH %&gt;%\n  mutate(gender_numeric = ifelse(gender == &quot;Male&quot;, 1, 0))\n\n# wfns\u5909\u6570\u306e\u30c0\u30df\u30fc\u5909\u6570\u3092\u4f5c\u6210\u3057\u3001\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u8ffd\u52a0\naSAH &lt;- aSAH %&gt;%\n  mutate(wfns2 = ifelse(wfns == 2, 1, 0),\n         wfns3 = ifelse(wfns == 3, 1, 0),\n         wfns4 = ifelse(wfns == 4, 1, 0),\n         wfns5 = ifelse(wfns == 5, 1, 0))\n\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u30b9\u30c6\u30c3\u30d73: \u591a\u5909\u91cf\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u69cb\u7bc9<\/h3>\n\n\n\n<p>\u591a\u5909\u91cf\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001<code>outcome<\/code>\u3092\u4ed6\u306e\u5909\u6570\u3067\u4e88\u6e2c\u3059\u308b\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: r; title: ; notranslate\" title=\"\">\n# \u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u69cb\u7bc9\nmodel &lt;- glm(good_outcome ~ gender_numeric + age + wfns2 + wfns3 + wfns4 + wfns5 + s100b + ndka, \n             data = aSAH, family = binomial)\n\n# \u30e2\u30c7\u30eb\u306e\u6982\u8981\u3092\u8868\u793a \u4fc2\u6570coef\u3092\u62bd\u51fa\nsummary(model)\nsummary_model &lt;- summary(model)\ncoef_model &lt;- summary_model$coefficients\n\n# \u30e2\u30c7\u30eb\nlogit_P = coef_model&#x5B;1] + coef_model&#x5B;2]*aSAH$gender_numeric + coef_model&#x5B;3]*aSAH$age +\n coef_model&#x5B;4]*aSAH$wfns2 + coef_model&#x5B;5]*aSAH$wfns3 + coef_model&#x5B;6]*aSAH$wfns4 +\n coef_model&#x5B;7]*aSAH$wfns5 + coef_model&#x5B;8]*aSAH$s100b + coef_model&#x5B;9]*aSAH$ndka\n\naSAH$logit_P &lt;- logit_P\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u30b9\u30c6\u30c3\u30d74: \u30e2\u30c7\u30eb\u306e\u7d50\u679c\u3084\u4e88\u6e2c\u5f0f\u306e\u6027\u80fd\u3092\u898b\u3066\u307f\u3088\u3046<\/h3>\n\n\n\n<p>\u30b9\u30c6\u30c3\u30d7\uff13\u307e\u3067\u3067\u3001\u30e2\u30c7\u30eb\u306b\u57fa\u3065\u3044\u3066\u4e88\u6e2c\u5f0f\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: r; title: ; notranslate\" title=\"\">\n# \u6563\u5e03\u56f3\u306e\u4f5c\u6210 \u30c7\u30fc\u30bf\u306e\u5916\u89b3\u3092\u78ba\u8a8d\u3059\u308b\nggplot(aSAH, aes(x=outcome, y=logit_P, color=outcome)) +\n  geom_point() +\n  labs(title=&quot;aSAH Data: wfns vs s100b&quot;,\n       x=&quot;outcome&quot;,\n       y=&quot;logit_P value&quot;) + \n  scale_y_continuous(limits = c(-6, 7))\n\n# \u3068\u308a\u3042\u3048\u305aROC\u30ab\u30fc\u30d6\u3092\u63cf\u3044\u3066\u307f\u3088\u3046\n# roc1 &lt;- aSAH %&gt;% roc(outcome, logit_P)\n# ggroc(roc1)\n\n# \u6563\u5e03\u56f3\u306e\u4f5c\u6210 \u30c7\u30fc\u30bf\u306e\u5916\u89b3\u3092\u78ba\u8a8d\u3059\u308b\nggplot(aSAH, aes(x=outcome, y=logit_P, color=outcome)) +\n  geom_point() +\n  labs(title=&quot;aSAH Data: outcome vs logit_P&quot;,\n       x=&quot;outcome&quot;,\n       y=&quot;logit_P value&quot;)+\n  scale_y_continuous(limits = c(-6, 7))\n\n# ROC\u66f2\u7dda\u306e\u4f5c\u6210\u3000s100b\u8840\u6e05\u5024\u3067SAH\u306e\u4e88\u5f8c\u4e88\u6e2c\u3059\u308b\u8a2d\u5b9a\nroc_obj &lt;- roc(aSAH$outcome, aSAH$logit_P)\n\n# ROC\u66f2\u7dda\u306e\u30d7\u30ed\u30c3\u30c8\nplot(roc_obj, main=&quot;ROC Curve predicting outcome of SAH using multivariate logistic model&quot;)\n\n# AUC\u306e\u8a08\u7b97\nauc_value &lt;- auc(roc_obj)\nprint(paste(&quot;AUC:&quot;, auc_value))\n\n# \u611f\u5ea6\u3001\u7279\u7570\u5ea6\u3001\u967d\u6027\u7684\u4e2d\u7387\u3001\u9670\u6027\u7684\u4e2d\u7387\u3092\u8a08\u7b97\ncoords_obj &lt;- coords(roc_obj, x=&quot;best&quot;, ret=c(&quot;sensitivity&quot;, &quot;specificity&quot;, &quot;ppv&quot;, &quot;npv&quot;))\n\n# \u7d50\u679c\u3092\u51fa\u529b\nprint(paste(&quot;\u611f\u5ea6:&quot;, coords_obj&#x5B;&quot;sensitivity&quot;]))\nprint(paste(&quot;\u7279\u7570\u5ea6:&quot;, coords_obj&#x5B;&quot;specificity&quot;]))\nprint(paste(&quot;\u967d\u6027\u7684\u4e2d\u7387:&quot;, coords_obj&#x5B;&quot;ppv&quot;]))\nprint(paste(&quot;\u9670\u6027\u7684\u4e2d\u7387:&quot;, coords_obj&#x5B;&quot;npv&quot;]))\n\n# \u5c24\u5ea6\u6bd4\u3092\u7b97\u51fa\u3001\u305d\u306e\u524d\u306b\u6539\u3081\u3066\u611f\u5ea6\u3068\u7279\u7570\u5ea6\u3092\u53d6\u5f97\ncoords_obj &lt;- coords(roc_obj, x=&quot;best&quot;, ret=c(&quot;sensitivity&quot;, &quot;specificity&quot;))\nsensitivity &lt;- coords_obj&#x5B;&quot;sensitivity&quot;]\nspecificity &lt;- coords_obj&#x5B;&quot;specificity&quot;]\n\n# \u967d\u6027\u5c24\u5ea6\u6bd4 (LR+) \u3068 \u9670\u6027\u5c24\u5ea6\u6bd4 (LR-) \u3092\u8a08\u7b97\npositive_likelihood_ratio &lt;- sensitivity \/ (1 - specificity)\nnegative_likelihood_ratio &lt;- (1 - sensitivity) \/ specificity\n\n# \u7d50\u679c\u3092\u51fa\u529b\nprint(paste(&quot;\u967d\u6027\u5c24\u5ea6\u6bd4 (LR+):&quot;, positive_likelihood_ratio))\nprint(paste(&quot;\u9670\u6027\u5c24\u5ea6\u6bd4 (LR-):&quot;, negative_likelihood_ratio))\n\n# \u6700\u9069\u306a\u95be\u5024\u3092\u53d6\u5f97\nbest_coords &lt;- coords(roc_obj, x = &quot;best&quot;, ret = c(&quot;threshold&quot;, &quot;sensitivity&quot;, &quot;specificity&quot;))\n\n# \u6700\u9069\u306a\u95be\u5024\u3092\u8868\u793a\nbest_coords\n\n\n<\/pre><\/div>\n\n\n<p>\u30c7\u30fc\u30bf\u306e\u6563\u5e03\u56f3\u3001\u6559\u79d1\u66f8\u306e\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u306elogit\u306e\u8aac\u660e\u3067\u898b\u305f\u3053\u3068\u3042\u308b\u3088\u3046\u306a\u96f0\u56f2\u6c17<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"406\" src=\"https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-12-700x406.png\" alt=\"\" class=\"wp-image-3732\" srcset=\"https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-12-700x406.png 700w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-12-300x174.png 300w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-12-150x87.png 150w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-12-768x446.png 768w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-12-800x464.png 800w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-12.png 1037w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p>\u7d50\u679c\u306eROC\u66f2\u7dda\u3067\u3059\u3002\u7d50\u69cb\u3044\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"406\" src=\"https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-11-700x406.png\" alt=\"\" class=\"wp-image-3729\" srcset=\"https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-11-700x406.png 700w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-11-300x174.png 300w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-11-150x87.png 150w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-11-768x446.png 768w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-11-800x464.png 800w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-11.png 1037w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p>\u305d\u306e\u4ed6\u6027\u80fd\u3084\u95be\u5024\u3067\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"517\" src=\"https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-13-700x517.png\" alt=\"\" class=\"wp-image-3734\" srcset=\"https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-13-700x517.png 700w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-13-300x221.png 300w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-13-150x111.png 150w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-13-768x567.png 768w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-13-80x60.png 80w, https:\/\/plaza.umin.ac.jp\/~OIO\/wp-content\/uploads\/2025\/02\/image-13.png 791w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>pROC\u30d1\u30c3\u30b1\u30fc\u30b8\u306eaSAH\u30c7\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u3066\u3001\u591a\u5909\u91cf\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u89e3\u6790\u3092\u884c\u3044\u3001outcome\u3092\u4ed6\u306e\u5909\u6570\u3067\u4e88\u6e2c\u3059\u308b\u4e88\u6e2c\u5f0f\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u4ee5\u4e0b\u306f\u5177\u4f53\u7684\u306a\u624b\u9806\u3067\u3059\uff1a \u30b9\u30c6\u30c3\u30d71: \u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8aad\u307f\u8fbc\u307f \u307e&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-3727","post","type-post","status-publish","format-standard","hentry","category-miscellaneous"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p9b6zl-Y7","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/posts\/3727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3727"}],"version-history":[{"count":4,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/posts\/3727\/revisions"}],"predecessor-version":[{"id":3735,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/posts\/3727\/revisions\/3735"}],"wp:attachment":[{"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}