{"id":2427,"date":"2023-07-22T07:47:44","date_gmt":"2023-07-22T07:47:44","guid":{"rendered":"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/"},"modified":"2023-07-22T07:47:44","modified_gmt":"2023-07-22T07:47:44","slug":"glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/","title":{"rendered":"R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u3042\u308a)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">R \u306e<strong>glm()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001\u4e00\u822c\u5316\u7dda\u5f62\u30e2\u30c7\u30eb\u3092\u8fd1\u4f3c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u3053\u306e\u95a2\u6570\u306f\u6b21\u306e\u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>glm(\u5f0f\u3001\u30d5\u30a1\u30df\u30ea\u30fc=\u30ac\u30a6\u30b9\u3001\u30c7\u30fc\u30bf\u3001\u2026)<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">\u91d1\uff1a<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\"><strong>\u5f0f:<\/strong>\u7dda\u5f62\u30e2\u30c7\u30eb\u306e\u5f0f (\u4f8b: y ~ x1 + x2)<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>family:<\/strong>\u30e2\u30c7\u30eb\u306e\u9069\u5408\u306b\u4f7f\u7528\u3059\u308b\u7d71\u8a08\u7684\u30d5\u30a1\u30df\u30ea\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u30ac\u30a6\u30b9\u3067\u3059\u304c\u3001\u4ed6\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u306f\u4e8c\u9805\u3001\u30ac\u30f3\u30de\u3001\u30dd\u30a2\u30bd\u30f3\u306a\u3069\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>data:<\/strong>\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30c7\u30fc\u30bf \u30d6\u30ed\u30c3\u30af\u306e\u540d\u524d<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u5b9f\u969b\u306b\u306f\u3001\u3053\u306e\u95a2\u6570\u306f\u300c\u4e8c\u9805\u300d\u30d5\u30a1\u30df\u30ea\u30fc\u3092\u6307\u5b9a\u3057\u3066<a href=\"https:\/\/statorials.org\/ja\/\u30ed\u30b7\u3099\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30-1\/\" target=\"_blank\" rel=\"noopener\">\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u3092<\/a>\u8fd1\u4f3c\u3059\u308b\u305f\u3081\u306b\u6700\u3082\u3088\u304f\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u4f8b\u306f\u3001\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u306e R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<h2><span style=\"color: #000000;\"><strong>\u4f8b: R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">\u3053\u306e\u4f8b\u3067\u306f\u3001R \u306b\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b<a href=\"https:\/\/statorials.org\/ja\/mtcars-r-\u30c6\u3099\u30fc\u30bf\u30bb\u30c3\u30c8\/\" target=\"_blank\" rel=\"noopener\">mtcars<\/a>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#view first six rows of <em>mtcars<\/em> dataset\n<\/span>head(mtcars)\n\n                   mpg cyl disp hp drat wt qsec vs am gear carb\nMazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4\nMazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4\nDatsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1\nHornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1\nHornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2\nValiant 18.1 6 225 105 2.76 3,460 20.22 1 0 3 1\n<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u5909\u6570<strong>disp<\/strong>\u3068<strong>hp<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u3001\u7279\u5b9a\u306e\u8eca\u304c\u5909\u6570<strong>am<\/strong>\u306e\u5024 1 \u3092\u53d6\u308b\u78ba\u7387\u3092\u4e88\u6e2c\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3001 <strong>glm()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3053\u306e\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u306b\u9069\u5408\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#fit logistic regression model\n<\/span>model &lt;- glm(am ~ disp + hp, data=mtcars, family=binomial)\n\n<span style=\"color: #008080;\">#view model summary\n<\/span>summary(model)\n\nCall:\nglm(formula = am ~ disp + hp, family = binomial, data = mtcars)\n\nDeviance Residuals: \n    Min 1Q Median 3Q Max  \n-1.9665 -0.3090 -0.0017 0.3934 1.3682  \n\nCoefficients:\n            Estimate Std. Error z value Pr(&gt;|z|)  \n(Intercept) 1.40342 1.36757 1.026 0.3048  \navailable -0.09518 0.04800 -1.983 0.0474 *\nhp 0.12170 0.06777 1.796 0.0725 .\n---\nSignificant. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n\n(Dispersion parameter for binomial family taken to be 1)\n\n    Null deviance: 43,230 on 31 degrees of freedom\nResidual deviance: 16,713 on 29 degrees of freedom\nAIC: 22,713\n\nNumber of Fisher Scoring iterations: 8\n<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u7d50\u679c\u306e\u5404\u8981\u7d20\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u4fc2\u6570\u3068 P \u5024<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u7d50\u679c\u306e<strong>\u4fc2\u6570\u63a8\u5b9a\u5024\u306f\u3001<\/strong>\u5404\u4e88\u6e2c\u5909\u6570\u306e 1 \u5358\u4f4d\u306e\u5897\u52a0\u306b\u95a2\u9023\u3059\u308b\u5fdc\u7b54\u5909\u6570\u306e\u5bfe\u6570\u5c24\u5ea6\u306e\u5e73\u5747\u5909\u5316\u3092\u793a\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u305f\u3068\u3048\u3070\u3001\u4e88\u6e2c\u5909\u6570 disp \u306e 1 \u5358\u4f4d\u306e\u5897\u52a0\u306f\u3001\u5fdc\u7b54\u5909\u6570 am \u304c\u5024 1 \u3092\u3068\u308b\u5bfe\u6570\u5c24\u5ea6\u306e\u5e73\u5747\u5909\u5316 -0.09518 \u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u3001disp \u306e\u5024\u304c\u9ad8\u3044\u307b\u3069\u3001disp \u306e\u5024\u304c\u4f4e\u3044\u307b\u3069\u95a2\u9023\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u78ba\u7387\u3002\u5909\u6570\u306e\u5024\u306f 1 \u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>\u6a19\u6e96\u8aa4\u5dee\u306f\u3001<\/strong>\u4fc2\u6570\u63a8\u5b9a\u306b\u95a2\u9023\u3059\u308b\u5909\u52d5\u6027\u306e\u30a2\u30a4\u30c7\u30a2\u3092\u4e0e\u3048\u3066\u304f\u308c\u307e\u3059\u3002\u6b21\u306b\u3001\u4fc2\u6570\u63a8\u5b9a\u5024\u3092\u6a19\u6e96\u8aa4\u5dee\u3067\u5272\u3063\u3066\u3001az \u5024\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u305f\u3068\u3048\u3070\u3001\u4e88\u6e2c\u5b50\u5909\u6570 disp \u306e<strong>z \u5024\u306f<\/strong>\u3001-.09518 \/ .048 = -1.983 \u3068\u3057\u3066\u8a08\u7b97\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>p \u5024<\/strong>Pr(&gt;|z|) \u306f\u3001\u7279\u5b9a\u306e Z \u5024\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u78ba\u7387\u3092\u793a\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u57fa\u672c\u7684\u306b\u3001\u5404\u4e88\u6e2c\u5b50\u5909\u6570\u304c\u30e2\u30c7\u30eb\u5185\u306e\u5fdc\u7b54\u5909\u6570\u306e\u5024\u3092\u3069\u306e\u7a0b\u5ea6\u6b63\u78ba\u306b\u4e88\u6e2c\u3067\u304d\u308b\u304b\u3092\u793a\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u305f\u3068\u3048\u3070\u3001\u5909\u6570 disp \u306e Z \u5024\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f p \u5024\u306f 0.0474 \u3067\u3059\u3002\u3053\u306e\u5024\u306f 0.05 \u672a\u6e80\u3067\u3042\u308b\u305f\u3081\u3001disp \u306f\u30e2\u30c7\u30eb\u5185\u3067\u7d71\u8a08\u7684\u306b\u6709\u610f\u306a\u4e88\u6e2c\u5909\u6570\u3067\u3042\u308b\u3068\u8a00\u3048\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u597d\u307f\u306b\u5fdc\u3058\u3066\u30010.01\u30010.05\u3001\u307e\u305f\u306f 0.10 \u306e\u6709\u610f\u6c34\u6e96\u3092\u4f7f\u7528\u3057\u3066\u3001\u5404\u4e88\u6e2c\u5909\u6570\u304c\u7d71\u8a08\u7684\u306b\u6709\u610f\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u30bc\u30ed\u9038\u8131\u3068\u6b8b\u7559\u9038\u8131<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u51fa\u529b\u306e<strong>\u30bc\u30ed\u9038\u8131\u306f\u3001<\/strong>\u5143\u306e\u9805\u306e\u307f\u3092\u542b\u3080\u30e2\u30c7\u30eb\u306b\u3088\u3063\u3066\u5fdc\u7b54\u5909\u6570\u304c\u3069\u306e\u7a0b\u5ea6\u6b63\u78ba\u306b\u4e88\u6e2c\u3067\u304d\u308b\u304b\u3092\u793a\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>\u6b8b\u5dee\u9038\u8131\u5ea6\u306f\u3001<\/strong> <em>p \u500b<\/em>\u306e\u4e88\u6e2c\u5b50\u5909\u6570\u3067\u30d5\u30a3\u30c3\u30c6\u30a3\u30f3\u30b0\u3057\u3066\u3044\u308b\u7279\u5b9a\u306e\u30e2\u30c7\u30eb\u306b\u3088\u3063\u3066\u5fdc\u7b54\u5909\u6570\u304c\u3069\u306e\u7a0b\u5ea6\u6b63\u78ba\u306b\u4e88\u6e2c\u3067\u304d\u308b\u304b\u3092\u793a\u3057\u307e\u3059\u3002\u5024\u304c\u4f4e\u3044\u307b\u3069\u3001\u30e2\u30c7\u30eb\u306f\u5fdc\u7b54\u5909\u6570\u306e\u5024\u3092\u3088\u308a\u9069\u5207\u306b\u4e88\u6e2c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u30e2\u30c7\u30eb\u304c\u300c\u6709\u7528\u300d\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u30ab\u30a4\u4e8c\u4e57\u7d71\u8a08\u91cf\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>X <sup>2<\/sup><\/strong> = \u30bc\u30ed\u9038\u8131 \u2013 \u6b8b\u7559\u9038\u8131<\/span><\/p>\n<p><span style=\"color: #000000;\"><em>p \u500b<\/em>\u306e\u81ea\u7531\u5ea6\u3092\u6301\u3061\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6b21\u306b\u3001\u3053\u306e\u30ab\u30a4\u4e8c\u4e57\u7d71\u8a08\u91cf\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f p \u5024\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 p \u5024\u304c\u4f4e\u3044\u307b\u3069\u3001\u5143\u306e\u9805\u306e\u307f\u3092\u542b\u3080\u30e2\u30c7\u30eb\u3068\u6bd4\u8f03\u3057\u3066\u3001\u30e2\u30c7\u30eb\u306f\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u9069\u5408\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u305f\u3068\u3048\u3070\u3001\u56de\u5e30\u30e2\u30c7\u30eb\u3067\u306f\u3001\u30bc\u30ed\u304a\u3088\u3073\u6b8b\u5dee\u504f\u5dee\u306e\u51fa\u529b\u3067\u6b21\u306e\u5024\u3092\u89b3\u5bdf\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\"><strong>\u9038\u8131\u30bc\u30ed<\/strong>: 43.23 (df = 31)<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>\u6b8b\u7559\u504f\u5dee<\/strong>: 16.713 (df = 29)<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u3053\u308c\u3089\u306e\u5024\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e2\u30c7\u30eb\u306e X <sup>2<\/sup>\u7d71\u8a08\u3092\u8a08\u7b97\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">X <sup>2<\/sup> = \u30bc\u30ed\u9038\u8131 \u2013 \u6b8b\u7559\u9038\u8131<\/span><\/li>\n<li><span style=\"color: #000000;\"><sup>X2<\/sup> = 43.23 \u2013 16.713<\/span><\/li>\n<li> <span style=\"color: #000000;\"><sup>X2<\/sup> = 26,517<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u4e88\u6e2c\u5909\u6570\u306b\u306f<em>p<\/em> = 2 \u306e\u81ea\u7531\u5ea6\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/ja\/\u30ab\u30a4\u4e8c\u4e57-p-\u5024\u8a08\u7b97\u6a5f\/\" target=\"_blank\" rel=\"noopener\">\u30ab\u30a4\u4e8c\u4e57\u304b\u3089 P \u5024\u3078\u306e\u8a08\u7b97\u30c4\u30fc\u30eb<\/a>\u3092\u4f7f\u7528\u3059\u308b\u3068\u30012 \u81ea\u7531\u5ea6\u306e X <sup>2<\/sup>\u5024 26.517 \u306e p \u5024\u304c 0.000002 \u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u3053\u306e p \u5024\u306f 0.05 \u3088\u308a\u3082\u306f\u308b\u304b\u306b\u4f4e\u3044\u305f\u3081\u3001\u3053\u306e\u30e2\u30c7\u30eb\u306f\u975e\u5e38\u306b\u6709\u7528\u3067\u3042\u308b\u3068\u7d50\u8ad6\u4ed8\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>AIC<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u8d64\u6c60\u60c5\u5831\u91cf\u57fa\u6e96 ( <strong>AIC<\/strong> ) \u306f\u3001\u3055\u307e\u3056\u307e\u306a\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u9069\u5408\u5ea6\u3092\u6bd4\u8f03\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\u5c3a\u5ea6\u3067\u3059\u3002\u5024\u304c\u4f4e\u3044\u307b\u3069\u3001\u56de\u5e30\u30e2\u30c7\u30eb\u306f\u30c7\u30fc\u30bf\u306b\u9069\u5408\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u3088\u3046\u306b\u8a08\u7b97\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\">AIC = 2K \u2013 2 <em>ln<\/em> (\u9577\u3055)<\/span><\/p>\n<p><span style=\"color: #000000;\">\u91d1\uff1a<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>K:<\/strong>\u30e2\u30c7\u30eb\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6570\u3002<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong><em>ln<\/em> (L)<\/strong> : \u30e2\u30c7\u30eb\u306e\u5bfe\u6570\u5c24\u5ea6\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30e2\u30c7\u30eb\u304c\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3069\u306e\u7a0b\u5ea6\u3067\u3042\u308b\u304b\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">AIC \u306e\u5b9f\u969b\u306e\u5024\u306f\u610f\u5473\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u305f\u3060\u3057\u3001\u8907\u6570\u306e\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u8fd1\u4f3c\u3057\u305f\u5834\u5408\u306f\u3001\u5404\u30e2\u30c7\u30eb\u306e AIC \u5024\u3092\u6bd4\u8f03\u3067\u304d\u307e\u3059\u3002 AIC \u304c\u6700\u3082\u4f4e\u3044\u30e2\u30c7\u30eb\u304c\u6700\u9069\u306a\u9069\u5408\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>\u95a2\u9023:<\/strong><\/span><a href=\"https:\/\/statorials.org\/ja\" target=\"_blank\" rel=\"noopener\">\u9069\u5207\u306a AIC \u5024\u306f\u3069\u308c\u304f\u3089\u3044\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u304b?<\/a><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u8ffd\u52a0\u30ea\u30bd\u30fc\u30b9<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001R \u3067<strong>glm()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u306b\u95a2\u3059\u308b\u8ffd\u52a0\u60c5\u5831\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/ja\/glm-vs-lm-in-r\/\" target=\"_blank\" rel=\"noopener\">R\u306eglm\u3068lm\u306e\u9055\u3044<\/a><br \/><a href=\"https:\/\/statorials.org\/ja\/r-glm-\u4e88\u6e2c\/\" target=\"_blank\" rel=\"noopener\">R\u306eglm\u3067predict\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001 <strong>glm()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u304d\u306b\u4e00\u822c\u7684\u306a\u30a8\u30e9\u30fc\u3092\u51e6\u7406\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/ja\/glm-\u30d5\u30a3\u30c3\u30c8-\u30a2\u30eb\u30b3\u3099\u30ea\u30b9\u3099\u30e0\u304b\u3099\u53ce\u675f\u3057\u307e\u305b\u3093\u3066\u3099\u3057\u305f\/\" target=\"_blank\" rel=\"noopener\">R \u306e\u51e6\u7406\u65b9\u6cd5 \u8b66\u544a: glm.fit: \u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u304c\u53ce\u675f\u3057\u307e\u305b\u3093\u3067\u3057\u305f<\/a><br \/><a href=\"https:\/\/statorials.org\/ja\/glm-fit-0-\u307e\u305f\u306f-1-\u304b\u3099\u767a\u751f\u3059\u308b\u78ba\u7387\u3092\u6570\u5024\u7684\u306b\u5f53\u3066\u306f\u3081\u305f\u3082\u306e\/\" target=\"_blank\" rel=\"noopener\">\u6271\u3044\u65b9: glm.fit: \u6570\u5024\u7684\u306b\u8abf\u6574\u3055\u308c\u305f\u78ba\u7387 0 \u307e\u305f\u306f 1 \u304c\u767a\u751f\u3059\u308b<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>R \u306eglm()\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001\u4e00\u822c\u5316\u7dda\u5f62\u30e2\u30c7\u30eb\u3092\u8fd1\u4f3c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u95a2\u6570\u306f\u6b21\u306e\u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 glm(\u5f0f\u3001\u30d5\u30a1\u30df\u30ea\u30fc=\u30ac\u30a6\u30b9\u3001\u30c7\u30fc\u30bf\u3001\u2026) \u91d1\uff1a \u5f0f:\u7dda\u5f62\u30e2\u30c7\u30eb\u306e\u5f0f (\u4f8b: y ~ x1 + x2) fa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2427","post","type-post","status-publish","format-standard","hentry","category-16"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u4ed8\u304d) - \u8a18\u4e8b<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u5b8c\u5168\u306a\u4f8b\u3092\u542b\u3081\u3066\u3001R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/ja\/glm-\u51fa\u529b\u3092-r-\u3066\u3099\u89e3\u91c8\u3059\u308b\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u4ed8\u304d) - \u8a18\u4e8b\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u5b8c\u5168\u306a\u4f8b\u3092\u542b\u3081\u3066\u3001R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/ja\/glm-\u51fa\u529b\u3092-r-\u3066\u3099\u89e3\u91c8\u3059\u308b\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-22T07:47:44+00:00\" \/>\n<meta name=\"author\" content=\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/\",\"url\":\"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/\",\"name\":\"R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u4ed8\u304d) - \u8a18\u4e8b\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/ja\/#website\"},\"datePublished\":\"2023-07-22T07:47:44+00:00\",\"dateModified\":\"2023-07-22T07:47:44+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83\"},\"description\":\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u5b8c\u5168\u306a\u4f8b\u3092\u542b\u3081\u3066\u3001R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/statorials.org\/ja\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u3042\u308a)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/ja\/#website\",\"url\":\"https:\/\/statorials.org\/ja\/\",\"name\":\"Statorials\",\"description\":\"\u7d71\u8a08\u80fd\u529b\u3078\u306e\u30ac\u30a4\u30c9\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/ja\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83\",\"name\":\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\"},\"description\":\"\u79c1\u306f\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u3067\u3059\u3002\u9000\u8077\u3057\u305f\u7d71\u8a08\u6559\u6388\u304b\u3089\u3001\u5c02\u4efb\u306e Statorials \u6559\u80b2\u8005\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d71\u8a08\u5206\u91ce\u306b\u304a\u3051\u308b\u8c4a\u5bcc\u306a\u7d4c\u9a13\u3068\u5c02\u9580\u77e5\u8b58\u3092\u6d3b\u304b\u3057\u3066\u3001\u79c1\u306f Statorials \u3092\u901a\u3058\u3066\u5b66\u751f\u306b\u529b\u3092\u4e0e\u3048\u308b\u305f\u3081\u306b\u81ea\u5206\u306e\u77e5\u8b58\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u306b\u5c3d\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3063\u3068\u77e5\u308b\",\"sameAs\":[\"http:\/\/statorials.org\/ja\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u4ed8\u304d) - \u8a18\u4e8b","description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u5b8c\u5168\u306a\u4f8b\u3092\u542b\u3081\u3066\u3001R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/ja\/glm-\u51fa\u529b\u3092-r-\u3066\u3099\u89e3\u91c8\u3059\u308b\/","og_locale":"ja_JP","og_type":"article","og_title":"R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u4ed8\u304d) - \u8a18\u4e8b","og_description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u5b8c\u5168\u306a\u4f8b\u3092\u542b\u3081\u3066\u3001R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/statorials.org\/ja\/glm-\u51fa\u529b\u3092-r-\u3066\u3099\u89e3\u91c8\u3059\u308b\/","og_site_name":"Statorials","article_published_time":"2023-07-22T07:47:44+00:00","author":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/","url":"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/","name":"R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u4ed8\u304d) - \u8a18\u4e8b","isPartOf":{"@id":"https:\/\/statorials.org\/ja\/#website"},"datePublished":"2023-07-22T07:47:44+00:00","dateModified":"2023-07-22T07:47:44+00:00","author":{"@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83"},"description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u5b8c\u5168\u306a\u4f8b\u3092\u542b\u3081\u3066\u3001R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/ja\/glm-%e5%87%ba%e5%8a%9b%e3%82%92-r-%e3%81%a6%e3%82%99%e8%a7%a3%e9%87%88%e3%81%99%e3%82%8b\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/statorials.org\/ja\/"},{"@type":"ListItem","position":2,"name":"R \u3067 glm \u51fa\u529b\u3092\u89e3\u91c8\u3059\u308b\u65b9\u6cd5 (\u4f8b\u3042\u308a)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/ja\/#website","url":"https:\/\/statorials.org\/ja\/","name":"Statorials","description":"\u7d71\u8a08\u80fd\u529b\u3078\u306e\u30ac\u30a4\u30c9","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/ja\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83","name":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb"},"description":"\u79c1\u306f\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u3067\u3059\u3002\u9000\u8077\u3057\u305f\u7d71\u8a08\u6559\u6388\u304b\u3089\u3001\u5c02\u4efb\u306e Statorials \u6559\u80b2\u8005\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d71\u8a08\u5206\u91ce\u306b\u304a\u3051\u308b\u8c4a\u5bcc\u306a\u7d4c\u9a13\u3068\u5c02\u9580\u77e5\u8b58\u3092\u6d3b\u304b\u3057\u3066\u3001\u79c1\u306f Statorials \u3092\u901a\u3058\u3066\u5b66\u751f\u306b\u529b\u3092\u4e0e\u3048\u308b\u305f\u3081\u306b\u81ea\u5206\u306e\u77e5\u8b58\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u306b\u5c3d\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3063\u3068\u77e5\u308b","sameAs":["http:\/\/statorials.org\/ja"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts\/2427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/comments?post=2427"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts\/2427\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/media?parent=2427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/categories?post=2427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/tags?post=2427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}