{"id":1418,"date":"2023-07-16T16:08:58","date_gmt":"2023-07-16T08:08:58","guid":{"rendered":"https:\/\/stu.chcmu.asia\/?p=1418"},"modified":"2024-05-22T16:04:56","modified_gmt":"2024-05-22T08:04:56","slug":"multipleroc","status":"publish","type":"post","link":"https:\/\/stu.chcmu.asia\/index.php\/2023\/07\/16\/multipleroc\/","title":{"rendered":"multipleROC"},"content":{"rendered":"<pre><code class=\"language-r\"># remotes::install_github(&quot;cardiomoon\/multipleROC&quot;) # \u5b89\u88c5\u5305\n# remotes::install_github(&quot;PengBingming\/multipleROC&quot;) # \u5b89\u88c5\u81ea\u5df1\u4fee\u6539\u7684\u5305\n\nlibrary(pROC)\nlibrary(multipleROC)\nlibrary(ggplot2)\n\ndf &lt;- as.data.frame(aSAH) # \u6570\u636e\nhead(df)\n\n# 1\u3001\u5355\u4e2a\u53d8\u91cf\np &lt;- multipleROC(outcome~s100b,data=df, plot = F)\nplot_ROC(p,\n         show.points = T,\n         show.eta = T,\n         show.sens = T,\n         show.AUC = T,\n         facet = F )+\n#  theme_bw()+ # \u4e3b\u9898\n#  geom_line(color=&#039;red&#039;)+ # roc \u7ebf \u989c\u8272\n#  geom_abline(intercept = ,slope = 1,color=&#039;white&#039;,size=2)+\n#  geom_abline(intercept = 0,slope = 1,color=&#039;red&#039;,size=1,linetype=&quot;dashed&quot;)+ \u5bf9\u89d2\u7ebf \u7ebf\u6761\u3001\u989c\u8272\n  theme(\n    text = element_text(size = 20)\n  )\n\n# 2\u3001\u591a\u4e2a\u53d8\u91cf\np1 &lt;- multipleROC(outcome~s100b,data=df)\np2 &lt;- multipleROC(outcome~ndka,data=df)\np3 &lt;- multipleROC(outcome~age,data=df)\n# \u4e00\u8d77\u663e\u793a\nplot_ROC(list(p1,p2,p3),\n         show.points = T,\n         show.eta = T,\n         show.sens = T,\n         show.AUC = T,\n         facet = F )+\n  theme(\n    text = element_text(size = 20)\n  )\nplot\n\n# \u5206\u9762\nsupp.labs &lt;- c(&#039;s100b&#039;,&#039;ndka&#039;,&#039;age&#039;)\nnames(supp.labs) &lt;- 1:3\n\nplot + facet_grid(.~no,labeller = labeller(no=supp.labs) )\nplot + facet_grid(no~.,labeller = labeller(no=supp.labs) )\n\n  # 1\u3001\u591a\u4e2a\u53d8\u91cf\u8054\u5408\np &lt;- multipleROC(outcome~s100b+age,data=df, plot = F)\nplot_ROC(p,\n         show.points = T,\n         show.eta = T,\n         show.sens = T,\n         show.AUC = T,\n         facet = F )+\n  theme(\n    text = element_text(size = 20)\n  )<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p># remotes::install_github(&quot;cardiomoon\/multipleROC&#038; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1487,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,31],"tags":[],"class_list":["post-1418","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-statistics"],"_links":{"self":[{"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/posts\/1418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/comments?post=1418"}],"version-history":[{"count":10,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/posts\/1418\/revisions"}],"predecessor-version":[{"id":1428,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/posts\/1418\/revisions\/1428"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/media\/1487"}],"wp:attachment":[{"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/media?parent=1418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/categories?post=1418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/tags?post=1418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}