{"id":589,"date":"2020-02-29T23:00:31","date_gmt":"2020-02-29T14:00:31","guid":{"rendered":"https:\/\/obgyn.jp\/?p=589"},"modified":"2022-03-13T19:56:09","modified_gmt":"2022-03-13T10:56:09","slug":"r-gamma","status":"publish","type":"post","link":"https:\/\/obgyn.jp\/?p=589","title":{"rendered":"R \u306b\u3088\u308b\u30ac\u30f3\u30de\u56de\u5e30\u5206\u6790"},"content":{"rendered":"\n<p><a href=\"https:\/\/stat.ethz.ch\/R-manual\/R-patched\/library\/stats\/html\/glm.html\" rel=\"noopener noreferrer\" target=\"_blank\">glm()<\/a> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u3001\u30ac\u30f3\u30de\u56de\u5e30\u5206\u6790\u3092\u884c\u3046\u3002\u4e00\u822c\u5316\u7dda\u5f62\u30e2\u30c7\u30eb\u3068\u3057\u3066\u884c\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(\u51fa\u8840\u91cf = c(10,200,300,5,5,3,250,500), \u624b\u8853\u65b9\u6cd5 = c(\"\u5185\u8996\u93e1\",\"\u958b\u8179\",\"\u958b\u8179\",\"\u5185\u8996\u93e1\",\"\u5185\u8996\u93e1\",\"\u5185\u8996\u93e1\",\"\u958b\u8179\",\"\u958b\u8179\"), \u624b\u8853\u6642\u9593 = c(60,50,60,60,30,40,60,50))<\/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\/glm.html\" rel=\"noopener noreferrer\" target=\"_blank\">glm()<\/a> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u3001\u30ac\u30f3\u30de\u56de\u5e30\u5206\u6790\u3092\u884c\u3046\u3002\u30ea\u30f3\u30af\u95a2\u6570\u306f\u9006\u95a2\u6570\u304c\u81ea\u52d5\u7684\u306b\u9078\u629e\u3055\u308c\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=\"\">result = glm(\u51fa\u8840\u91cf ~ \u624b\u8853\u65b9\u6cd5 + \u624b\u8853\u6642\u9593, data=data, family=Gamma)\nsummary(result) #\u7d50\u679c\u306e\u8868\u793a<\/pre>\n\n\n\n<p>\u30ea\u30f3\u30af\u95a2\u6570\u3092\u5bfe\u6570\u95a2\u6570\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\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=\"\">result = glm(\u51fa\u8840\u91cf ~ \u624b\u8853\u65b9\u6cd5 + \u624b\u8853\u6642\u9593, data=data, family=Gamma(log))\nsummary(result) #\u7d50\u679c\u306e\u8868\u793a<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>glm() \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u3001\u30ac\u30f3\u30de\u56de\u5e30\u5206\u6790\u3092\u884c\u3046\u3002\u4e00\u822c\u5316\u7dda\u5f62\u30e2\u30c7\u30eb\u3068\u3057\u3066\u884c\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\u7684\u306b\u4ee5\u4e0b\u306e\u7c21\u5358\u306a\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3092\u4f5c\u6210\u3057\u3001 &hellip; <a href=\"https:\/\/obgyn.jp\/?p=589\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">R \u306b\u3088\u308b\u30ac\u30f3\u30de\u56de\u5e30\u5206\u6790<\/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":[18,19,37],"class_list":["post-589","post","type-post","status-publish","format-standard","hentry","category-data-science","tag-multivariate","tag-model","tag-r"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/posts\/589","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=589"}],"version-history":[{"count":10,"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/posts\/589\/revisions"}],"predecessor-version":[{"id":986,"href":"https:\/\/obgyn.jp\/index.php?rest_route=\/wp\/v2\/posts\/589\/revisions\/986"}],"wp:attachment":[{"href":"https:\/\/obgyn.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/obgyn.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/obgyn.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}