{"id":480,"date":"2020-02-06T23:00:32","date_gmt":"2020-02-06T14:00:32","guid":{"rendered":"https:\/\/obgyn.jp\/?p=480"},"modified":"2022-03-13T19:56:09","modified_gmt":"2022-03-13T10:56:09","slug":"r-correlation","status":"publish","type":"post","link":"https:\/\/obgyn.jp\/?p=480","title":{"rendered":"R \u306b\u3088\u308b\u76f8\u95a2\u4fc2\u6570\u306e\u8a08\u7b97"},"content":{"rendered":"\n<p><a href=\"https:\/\/stat.ethz.ch\/R-manual\/R-patched\/library\/stats\/html\/cor.html\" rel=\"noopener noreferrer\" target=\"_blank\">cor()<\/a> \u30b3\u30de\u30f3\u30c9\u3092\u3064\u304b\u3044\u3001\u76f8\u95a2\u4fc2\u6570\u3092\u8a08\u7b97\u3059\u308b\u3002P \u5024\u3082\u8a08\u7b97\u3057\u305f\u3044\u5834\u5408\u306b\u306f cor.test() \u30b3\u30de\u30f3\u30c9 \u3092\u4f7f\u3046\u3002<\/p>\n\n\n\n<p>\u901a\u5e38\u306f Excel \u7b49\u3067\u4f5c\u6210\u3057\u305f CSV \u30d5\u30a1\u30a4\u30eb\u3092 R \u306b\u8aad\u307f\u8fbc\u3093\u3067\u5206\u6790\u3059\u308b\u3002\u3057\u304b\u3057\u3001\u3053\u3053\u3067\u306f\u4fbf\u5b9c\u7684\u306b\u4ee5\u4e0b\u306e\u7c21\u5358\u306a\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3092\u4f5c\u6210\u3057\u3001data \u3068\u3044\u3046\u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"r\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">data = data.frame(\u7e2b\u5408\u7d50\u7d2e\u306e\u7df4\u7fd2\u6642\u9593 = c(100,150,200,250,300,1000), \u624b\u8853\u6642\u9593 = c(210,220,150,100,90,45), \u51fa\u8840\u91cf = c(50,70,60,30,20,10))<\/pre>\n\n\n\n<p>data \u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"r\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">data<\/pre>\n\n\n\n<p><a href=\"https:\/\/stat.ethz.ch\/R-manual\/R-patched\/library\/stats\/html\/cor.html\" rel=\"noopener noreferrer\" target=\"_blank\">cor()<\/a> \u30b3\u30de\u30f3\u30c9\u3067\u30d4\u30a2\u30bd\u30f3\u7a4d\u7387\u76f8\u95a2\u4fc2\u6570\uff08\u3044\u308f\u3086\u308b\u76f8\u95a2\u4fc2\u6570\uff09\u3092\u8868\u793a\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"r\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cor(data)<\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u9806\u4f4d\u76f8\u95a2\u4fc2\u6570\u3082\u8a08\u7b97\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"r\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cor(data, method = \"s\") #\u30b9\u30d4\u30a2\u30de\u30f3\u9806\u4f4d\u76f8\u95a2\u4fc2\u6570\u3002\ncor(data, method = \"k\") #\u30b1\u30f3\u30c9\u30fc\u30eb\u9806\u4f4d\u76f8\u95a2\u4fc2\u6570\u3002<\/pre>\n\n\n\n<p>P \u5024\u3082\u8a08\u7b97\u3057\u305f\u3044\u5834\u5408\u306f <a href=\"https:\/\/stat.ethz.ch\/R-manual\/R-patched\/library\/stats\/html\/cor.test.html\" rel=\"noopener noreferrer\" target=\"_blank\">cor.test()<\/a> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"r\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">x = \u7e2b\u5408\u7d50\u7d2e\u306e\u7df4\u7fd2\u6642\u9593\ny = \u624b\u8853\u6642\u9593\ncor.test(x, y) #\u30d4\u30a2\u30bd\u30f3\u7a4d\u7387\u76f8\u95a2\u4fc2\u6570\u3002\ncor.test(x, y, method = \"s\") #\u30b9\u30d4\u30a2\u30de\u30f3\u9806\u4f4d\u76f8\u95a2\u4fc2\u6570\u3002\ncor.test(x, y, method = \"k\") #\u30b1\u30f3\u30c9\u30fc\u30eb\u9806\u4f4d\u76f8\u95a2\u4fc2\u6570\u3002<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>cor() \u30b3\u30de\u30f3\u30c9\u3092\u3064\u304b\u3044\u3001\u76f8\u95a2\u4fc2\u6570\u3092\u8a08\u7b97\u3059\u308b\u3002P \u5024\u3082\u8a08\u7b97\u3057\u305f\u3044\u5834\u5408\u306b\u306f cor.test() \u30b3\u30de\u30f3\u30c9 \u3092\u4f7f\u3046\u3002 \u901a\u5e38\u306f Excel \u7b49\u3067\u4f5c\u6210\u3057\u305f CSV \u30d5\u30a1\u30a4\u30eb\u3092 R \u306b\u8aad\u307f\u8fbc\u3093\u3067\u5206\u6790\u3059\u308b\u3002\u3057\u304b\u3057\u3001\u3053\u3053\u3067\u306f\u4fbf\u5b9c &hellip; <a href=\"https:\/\/obgyn.jp\/?p=480\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">R \u306b\u3088\u308b\u76f8\u95a2\u4fc2\u6570\u306e\u8a08\u7b97<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[37],"class_list":["post-480","post","type-post","status-publish","format-standard","hentry","category-data-science","tag-r"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/posts\/480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/obgyn.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=480"}],"version-history":[{"count":8,"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/posts\/480\/revisions"}],"predecessor-version":[{"id":1051,"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/posts\/480\/revisions\/1051"}],"wp:attachment":[{"href":"https:\/\/obgyn.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/obgyn.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/obgyn.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}