{"id":4330,"date":"2025-07-26T22:35:12","date_gmt":"2025-07-26T13:35:12","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/?p=4330"},"modified":"2025-07-26T22:35:14","modified_gmt":"2025-07-26T13:35:14","slug":"regression-analysis-with-interaction-terms-describing-significant-interactions-and-subgroup-analyses","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/regression-analysis-with-interaction-terms-describing-significant-interactions-and-subgroup-analyses\/","title":{"rendered":"\u4ea4\u4e92\u4f5c\u7528\u9805\u306e\u3042\u308b\u56de\u5e30\u5206\u6790\uff1a\u6709\u610f\u306a\u4ea4\u4e92\u4f5c\u7528\u3068\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u306e\u8a18\u8ff0\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u56de\u5e30\u5206\u6790\u3092\u884c\u3046\u969b\u30012\u3064\u4ee5\u4e0a\u306e\u8aac\u660e\u5909\u6570\u304c\u5f93\u5c5e\u5909\u6570\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u304c\u3001\u4e92\u3044\u306e\u6c34\u6e96\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308b\u3002\u3053\u306e\u3088\u3046\u306a\u73fe\u8c61\u3092\u300c<strong>\u4ea4\u4e92\u4f5c\u7528\uff08interaction\uff09<\/strong>\u300d\u3068\u547c\u3073\u3001\u7d71\u8a08\u30e2\u30c7\u30eb\u306b\u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3067\u3001\u3088\u308a\u8a73\u7d30\u306a\u95a2\u4fc2\u6027\u3092\u660e\u3089\u304b\u306b\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001\u4ea4\u4e92\u4f5c\u7528\u304c\u6709\u610f\u3067\u3042\u3063\u305f\u5834\u5408\u306b\u3001\u3069\u306e\u3088\u3046\u306b\u305d\u306e\u7d50\u679c\u3092\u8a18\u8ff0\u3057\u3001\u3055\u3089\u306b\u6df1\u6398\u308a\u3057\u305f\u89e3\u6790\uff08\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\uff09\u3092\u3069\u306e\u3088\u3046\u306b\u8ad6\u6587\u306b\u843d\u3068\u3057\u8fbc\u3080\u3079\u304d\u304b\u3001\u60a9\u3080\u7814\u7a76\u8005\u306f\u5c11\u306a\u304f\u306a\u3044\u3060\u308d\u3046\u3002<\/p>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u91cd\u56de\u5e30\u5206\u6790\u306b\u304a\u3044\u3066<strong>\u9023\u7d9a\u30c7\u30fc\u30bf\u306e\u8aac\u660e\u5909\u6570<\/strong>\u3068<strong>\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u30c7\u30fc\u30bf\u306e\u4ea4\u4e92\u4f5c\u7528\u9805<\/strong>\u304c\u6709\u610f\u3067\u3042\u3063\u305f\u5834\u5408\u306e\u8a18\u8ff0\u65b9\u6cd5\u3001\u7279\u306b\u305d\u306e\u5f8c\u306e\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u306e\u8ad6\u6587\u3067\u306e\u8a18\u8ff0\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001R\u306e\u5177\u4f53\u4f8b\u3092\u4ea4\u3048\u306a\u304c\u3089\u89e3\u8aac\u3059\u308b\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4ea4\u4e92\u4f5c\u7528\u3068\u306f\u4f55\u304b\uff1f<\/h2>\n\n\n\n<p>\u4ea4\u4e92\u4f5c\u7528\u3068\u306f\u3001\u3042\u308b\u8aac\u660e\u5909\u6570\u3068\u5225\u306e\u8aac\u660e\u5909\u6570\u304c\u3001\u76ee\u7684\u5909\u6570\u306b\u5bfe\u3057\u3066\u72ec\u7acb\u306b\u5f71\u97ff\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u4e92\u3044\u306b\u5f71\u97ff\u3057\u5408\u3044\u306a\u304c\u3089\u76ee\u7684\u5909\u6570\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u73fe\u8c61\u3092\u6307\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u300c<strong>\u5b66\u7fd2\u6642\u9593<\/strong>\u300d\u3068\u300c<strong>\u6027\u5225<\/strong>\u300d\u304c\u300c<strong>\u8a66\u9a13\u306e\u70b9\u6570<\/strong>\u300d\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u5834\u5408\u3092\u8003\u3048\u3066\u307f\u3088\u3046\u3002\u3082\u3057\u7537\u6027\u306e\u65b9\u304c\u5b66\u7fd2\u6642\u9593\u304c\u5897\u3048\u308b\u307b\u3069\u70b9\u6570\u304c\u4f38\u3073\u3084\u3059\u3044\u304c\u3001\u5973\u6027\u3067\u306f\u5b66\u7fd2\u6642\u9593\u304c\u5897\u3048\u3066\u3082\u70b9\u6570\u306f\u3042\u307e\u308a\u4f38\u3073\u306a\u3044\u3001\u3068\u3044\u3046\u50be\u5411\u304c\u3042\u308c\u3070\u3001\u3053\u308c\u306f\u5b66\u7fd2\u6642\u9593\u3068\u6027\u5225\u306e\u9593\u306b\u4ea4\u4e92\u4f5c\u7528\u304c\u3042\u308b\u3068\u8a00\u3048\u308b\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56de\u5e30\u30e2\u30c7\u30eb\u306b\u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u542b\u3081\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<p>R\u3067\u306f\u3001\u56de\u5e30\u30e2\u30c7\u30eb\u306b\u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u542b\u3081\u308b\u306e\u306f\u975e\u5e38\u306b\u7c21\u5358\u3067\u3042\u308b\u3002<code>*<\/code> \u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u304b\u3001<code>:<\/code> \u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u3066\u500b\u5225\u306b\u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>\u4f8b:<\/strong><\/p>\n\n\n\n<p>\u76ee\u7684\u5909\u6570 <code>Y<\/code>\u3001\u9023\u7d9a\u8aac\u660e\u5909\u6570 <code>X<\/code>\u3001\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u8aac\u660e\u5909\u6570 <code>Group<\/code>\uff082\u3064\u306e\u6c34\u6e96A\u3068B\u3092\u6301\u3064\u3068\u3059\u308b\uff09\u304c\u3042\u308b\u5834\u5408<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>*<\/code> \u6f14\u7b97\u5b50\u3092\u7528\u3044\u308b\u65b9\u6cd5\uff08\u4e3b\u52b9\u679c\u3068\u4ea4\u4e92\u4f5c\u7528\u306e\u4e21\u65b9\u3092\u542b\u3080\uff09:<\/strong>R<code>model &lt;- lm(Y ~ X * Group, data = mydata) <\/code>\u3053\u308c\u306f <code>Y ~ X + Group + X:Group<\/code> \u3068\u540c\u7b49\u3067\u3042\u308b\u3002<\/li>\n\n\n\n<li><strong><code>:<\/code> \u6f14\u7b97\u5b50\u3092\u7528\u3044\u308b\u65b9\u6cd5\uff08\u4ea4\u4e92\u4f5c\u7528\u306e\u307f\u3092\u542b\u3080\uff09:<\/strong>R<code>model &lt;- lm(Y ~ X + Group + X:Group, data = mydata)<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u591a\u304f\u306e\u5834\u5408\u3001<code>*<\/code> \u6f14\u7b97\u5b50\u3092\u7528\u3044\u308b\u65b9\u6cd5\u304c\u7c21\u6f54\u3067\u5206\u304b\u308a\u3084\u3059\u3044\u3060\u308d\u3046\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div id=\"biost-238975987\" class=\"biost- biost-entity-placement\"><p style=\"text-align: center;\"><span style=\"font-size: 20px;\"><strong><a href=\"https:\/\/best-biostatistics.com\/kmhl\">\uff1e\uff1e\u3082\u3046\u7d71\u8a08\u3067\u60a9\u3080\u306e\u306f\u7d42\u308f\u308a\u306b\u3057\u307e\u305b\u3093\u304b\uff1f\u00a0<\/a><\/strong><\/span><\/p>\r\n<a href=\"https:\/\/best-biostatistics.com\/kmhl\"><img class=\"aligncenter wp-image-2794 size-full\" src=\"https:\/\/best-biostatistics.com\/wp\/wp-content\/uploads\/2023\/11\/bn_r_03.png\" alt=\"\" width=\"500\" height=\"327\" \/><\/a>\r\n<p style=\"text-align: center;\"><span style=\"color: #ff0000; font-size: 20px;\"><strong><span class=\"marker2\">\u21911\u4e07\u4eba\u4ee5\u4e0a\u306e\u533b\u7642\u5f93\u4e8b\u8005\u304c\u8cfc\u8aad\u4e2d<\/span><\/strong><\/span><\/p><\/div><h2 class=\"wp-block-heading\">\u8ad6\u6587\u3067\u306e\u8a18\u8ff0\u65b9\u6cd5\uff1a\u4ea4\u4e92\u4f5c\u7528\u304c\u6709\u610f\u306a\u5834\u5408<\/h2>\n\n\n\n<p>\u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u542b\u3080\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u5206\u6790\u3057\u3001\u305d\u306e\u7d50\u679c\u3001\u4ea4\u4e92\u4f5c\u7528\u304c\u7d71\u8a08\u7684\u306b\u6709\u610f\u3067\u3042\u3063\u305f\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u70b9\u3092\u660e\u78ba\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e2\u30c7\u30eb\u306e\u63d0\u793a\u3068\u4ea4\u4e92\u4f5c\u7528\u306e\u78ba\u8a8d<\/h3>\n\n\n\n<p>\u307e\u305a\u3001\u69cb\u7bc9\u3057\u305f\u56de\u5e30\u30e2\u30c7\u30eb\u3068\u3001\u4ea4\u4e92\u4f5c\u7528\u9805\u306e\u6709\u610f\u6027\u3092\u793a\u3059\u7d71\u8a08\u91cf\u3092\u63d0\u793a\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>\u8a18\u8ff0\u4f8b:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u76ee\u7684\u5909\u6570\u3067\u3042\u308b<strong>Y<\/strong>\u306b\u5bfe\u3059\u308b\u9023\u7d9a\u5909\u6570<strong>X<\/strong>\u3068\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570<strong>Group<\/strong>\u306e\u5f71\u97ff\u3092\u691c\u8a0e\u3059\u308b\u305f\u3081\u3001\u91cd\u56de\u5e30\u5206\u6790\u3092\u5b9f\u65bd\u3057\u305f\u3002\u5206\u6790\u306e\u7d50\u679c\u3001<strong>\u30e2\u30c7\u30eb\u5168\u4f53\u306f\u7d71\u8a08\u7684\u306b\u6709\u610f<\/strong>\u3067\u3042\u308a ($F(\\text{df1, df2}) = \u301c, p &lt; .001$)\u3001<strong>\u6c7a\u5b9a\u4fc2\u6570<\/strong> R2 \u306f \u301c \u3067\u3042\u3063\u305f\u3002\u7279\u306b\u3001\u9023\u7d9a\u5909\u6570<strong>X<\/strong>\u3068\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570<strong>Group<\/strong>\u306e\u9593\u306e<strong>\u4ea4\u4e92\u4f5c\u7528\u306f\u7d71\u8a08\u7684\u306b\u6709\u610f\u3067\u3042\u3063\u305f<\/strong>\uff08p=\u301c\uff09\u3002<\/p>\n<\/blockquote>\n\n\n\n<p>\u3053\u3053\u3067\u3001<code>Group<\/code>\u304c\u30c0\u30df\u30fc\u5909\u6570\u3068\u3057\u3066\u3069\u306e\u3088\u3046\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3055\u308c\u3066\u3044\u308b\u304b\uff08\u4f8b\uff1aGroup A\u3092\u57fa\u6e96\u3068\u3057\u305f\u5834\u5408\u306a\u3069\uff09\u3082\u660e\u8a18\u3059\u308b\u3068\u826f\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4ea4\u4e92\u4f5c\u7528\u306e\u89e3\u91c8<\/h3>\n\n\n\n<p>\u4ea4\u4e92\u4f5c\u7528\u304c\u6709\u610f\u3067\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u4e00\u65b9\u306e\u5909\u6570\u306e\u5f71\u97ff\u304c\u3082\u3046\u4e00\u65b9\u306e\u5909\u6570\u306e\u6c34\u6e96\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u3053\u3068\u3092\u610f\u5473\u3059\u308b\u3002\u3053\u306e\u300c\u7570\u306a\u308b\u300d\u3068\u3044\u3046\u70b9\u3092\u5177\u4f53\u7684\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>\u8a18\u8ff0\u4f8b:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u3053\u306e\u6709\u610f\u306a\u4ea4\u4e92\u4f5c\u7528\u306f\u3001<strong>\u9023\u7d9a\u5909\u6570X\u304c\u76ee\u7684\u5909\u6570Y\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u304c\u3001\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570Group\u306e\u6c34\u6e96\u306b\u3088\u3063\u3066\u7570\u306a\u308b<\/strong>\u3053\u3068\u3092\u793a\u5506\u3057\u3066\u3044\u308b\u3002\u5177\u4f53\u7684\u306b\u306f\u3001Group\u304cA\u306e\u30b0\u30eb\u30fc\u30d7\u3067\u306fX\u306e\u52b9\u679c\u304c\u3007\u3007\u3067\u3042\u3063\u305f\u306e\u306b\u5bfe\u3057\u3001Group\u304cB\u306e\u30b0\u30eb\u30fc\u30d7\u3067\u306fX\u306e\u52b9\u679c\u304c\u25b3\u25b3\u3067\u3042\u3063\u305f\u3002<\/p>\n<\/blockquote>\n\n\n\n<p>\u3053\u306e\u89e3\u91c8\u3092\u88cf\u4ed8\u3051\u308b\u305f\u3081\u306b\u3001\u5f8c\u8ff0\u3059\u308b<strong>\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790<\/strong>\u304c\u975e\u5e38\u306b\u91cd\u8981\u3068\u306a\u308b\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u6709\u610f\u306a\u4ea4\u4e92\u4f5c\u7528\u5f8c\u306e\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u3068\u8a18\u8ff0\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u4ea4\u4e92\u4f5c\u7528\u304c\u6709\u610f\u3067\u3042\u3063\u305f\u5834\u5408\u3001\u305d\u308c\u305e\u308c\u306e<strong>\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7<\/strong>\uff08\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570\u306e\u5404\u6c34\u6e96\uff09\u306b\u304a\u3044\u3066\u3001\u9023\u7d9a\u5909\u6570\u304c\u76ee\u7684\u5909\u6570\u306b\u3069\u306e\u3088\u3046\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u306e\u304b\u3092\u8a73\u7d30\u306b\u5206\u6790\u3059\u308b\u300c<strong>\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790<\/strong>\u300d\u3092\u884c\u3046\u306e\u304c\u4e00\u822c\u7684\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u306e\u5b9f\u65bd<\/h3>\n\n\n\n<p>\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u306f\u3001\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570\u306e\u5404\u6c34\u6e96\u3054\u3068\u306b\u30c7\u30fc\u30bf\u3092\u5206\u5272\u3057\u3001\u305d\u308c\u305e\u308c\u306e\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u5185\u3067\u56de\u5e30\u5206\u6790\u3092\u884c\u3046\u3053\u3068\u3067\u5b9f\u65bd\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>R\u3067\u306e\u5177\u4f53\u4f8b:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u4eee\u60f3\u30c7\u30fc\u30bf\u306e\u4f5c\u6210\nset.seed(123)\nmydata &lt;- data.frame(\n  Y = rnorm(100, 50, 10),\n  X = rnorm(100, 10, 2),\n  Group = sample(c(\"A\", \"B\"), 100, replace = TRUE)\n)\n\n# \u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u542b\u3080\u30e2\u30c7\u30eb\nmodel_interaction &lt;- lm(Y ~ X * Group, data = mydata)\nsummary(model_interaction)\n\n# \u3053\u3053\u3067\u3001X:Group \u306ep\u5024\u304c\u6709\u610f\u3067\u3042\u3063\u305f\u3068\u4eee\u5b9a\u3059\u308b\uff08\u5b9f\u969b\u306f\u4ee5\u4e0b\u306e\u7d50\u679c\u306e\u3068\u304a\u308a\u6709\u610f\u3067\u306f\u306a\u304b\u3063\u305f\uff09\n\n# \u30b5\u30d6\u30b0\u30eb\u30fc\u30d7A\u306e\u89e3\u6790\ndata_groupA &lt;- subset(mydata, Group == \"A\")\nmodel_groupA &lt;- lm(Y ~ X, data = data_groupA)\nsummary(model_groupA)\n\n# \u30b5\u30d6\u30b0\u30eb\u30fc\u30d7B\u306e\u89e3\u6790\ndata_groupB &lt;- subset(mydata, Group == \"B\")\nmodel_groupB &lt;- lm(Y ~ X, data = data_groupB)\nsummary(model_groupB)\n<\/code><\/pre>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> # \u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u542b\u3080\u30e2\u30c7\u30eb\n> model_interaction &lt;- lm(Y ~ X * Group, data = mydata)\n> summary(model_interaction)\n\nCall:\nlm(formula = Y ~ X * Group, data = mydata)\n\nResiduals:\n     Min       1Q   Median       3Q      Max \n-22.3817  -6.1564  -0.4205   5.3336  21.1901 \n\nCoefficients:\n            Estimate Std. Error t value Pr(>|t|)    \n(Intercept) 48.94371    6.99528   6.997 3.52e-10 ***\nX            0.03418    0.71035   0.048    0.962    \nGroupB       8.84534    9.47952   0.933    0.353    \nX:GroupB    -0.56560    0.95193  -0.594    0.554    \n---\nSignif. codes:  0 \u2018***\u2019 0.001 \u2018**\u2019 0.01 \u2018*\u2019 0.05 \u2018.\u2019 0.1 \u2018 \u2019 1\n\nResidual standard error: 9.086 on 96 degrees of freedom\nMultiple R-squared:  0.03925,   Adjusted R-squared:  0.009224 \nF-statistic: 1.307 on 3 and 96 DF,  p-value: 0.2766\n\n\n> # \u30b5\u30d6\u30b0\u30eb\u30fc\u30d7A\u306e\u89e3\u6790\n> data_groupA &lt;- subset(mydata, Group == \"A\")\n> model_groupA &lt;- lm(Y ~ X, data = data_groupA)\n> summary(model_groupA)\n\nCall:\nlm(formula = Y ~ X, data = data_groupA)\n\nResiduals:\n    Min      1Q  Median      3Q     Max \n-22.382  -6.239  -1.437   6.908  21.190 \n\nCoefficients:\n            Estimate Std. Error t value Pr(>|t|)    \n(Intercept) 48.94371    7.84947   6.235 1.09e-07 ***\nX            0.03418    0.79709   0.043    0.966    \n---\nSignif. codes:  0 \u2018***\u2019 0.001 \u2018**\u2019 0.01 \u2018*\u2019 0.05 \u2018.\u2019 0.1 \u2018 \u2019 1\n\nResidual standard error: 10.2 on 48 degrees of freedom\nMultiple R-squared:  3.832e-05, Adjusted R-squared:  -0.02079 \nF-statistic: 0.001839 on 1 and 48 DF,  p-value: 0.966\n\n > # \u30b5\u30d6\u30b0\u30eb\u30fc\u30d7B\u306e\u89e3\u6790\n> data_groupB &lt;- subset(mydata, Group == \"B\")\n> model_groupB &lt;- lm(Y ~ X, data = data_groupB)\n> summary(model_groupB)\n\nCall:\nlm(formula = Y ~ X, data = data_groupB)\n\nResiduals:\n     Min       1Q   Median       3Q      Max \n-17.3641  -4.9425   0.7553   3.4312  20.0368 \n\nCoefficients:\n            Estimate Std. Error t value Pr(>|t|)    \n(Intercept)  57.7890     5.5065  10.495 5.09e-14 ***\nX            -0.5314     0.5454  -0.974    0.335    \n---\nSignif. codes:  0 \u2018***\u2019 0.001 \u2018**\u2019 0.01 \u2018*\u2019 0.05 \u2018.\u2019 0.1 \u2018 \u2019 1\n\nResidual standard error: 7.821 on 48 degrees of freedom\nMultiple R-squared:  0.01939,   Adjusted R-squared:  -0.001038 \nF-statistic: 0.9492 on 1 and 48 DF,  p-value: 0.3348\n\n> \n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u8ad6\u6587\u3067\u306e\u8a18\u8ff0\u65b9\u6cd5\uff1a\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u306e\u7d50\u679c<\/h3>\n\n\n\n<p>\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u306e\u7d50\u679c\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u304a\u3051\u308b\u9023\u7d9a\u5909\u6570\u306e\u52b9\u679c\u3092\u660e\u78ba\u306b\u6bd4\u8f03\u3067\u304d\u308b\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>\u8a18\u8ff0\u4f8b:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u9023\u7d9a\u5909\u6570<strong>X<\/strong>\u3068\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570<strong>Group<\/strong>\u306e\u6709\u610f\u306a\u4ea4\u4e92\u4f5c\u7528\u304c\u78ba\u8a8d\u3055\u308c\u305f\u305f\u3081\u3001\u3055\u3089\u306b<strong>Group<\/strong>\u306e\u5404\u6c34\u6e96\u306b\u304a\u3051\u308b<strong>X<\/strong>\u306e<strong>Y<\/strong>\u306b\u5bfe\u3059\u308b\u5f71\u97ff\u3092\u8abf\u3079\u308b\u305f\u3081\u3001\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u3092\u5b9f\u65bd\u3057\u305f\u3002<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u300cGroup A\u306b\u304a\u3051\u308b\u89e3\u6790\u300d<\/p>\n\n\n\n<p>Group\u304cA\u306e\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u306b\u304a\u3044\u3066\u3001\u9023\u7d9a\u5909\u6570X\u306f\u76ee\u7684\u5909\u6570Y\u306b\u5bfe\u3057\u3066\u7d71\u8a08\u7684\u306b\u6709\u610f\u306a\u6b63\u306e\u5f71\u97ff\u3092\u793a\u3057\u305f\uff08\u56de\u5e30\u4fc2\u6570 = Estimate of GroupA, SE=SE of GroupA, t=t\u2212value of GroupA, p=p\u2212value of GroupA\uff09\u3002\u5177\u4f53\u7684\u306b\u306f\u3001X\u304c1\u5358\u4f4d\u5897\u52a0\u3059\u308b\u3054\u3068\u306b\u3001Y\u306f Estimate of GroupA \u5358\u4f4d\u5897\u52a0\u3059\u308b\u3068\u63a8\u5b9a\u3055\u308c\u305f\u3002\uff08\u8868\u3067\u63d0\u793a\u3057\u306a\u3044\u5834\u5408\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306b\u8a73\u7d30\u306b\u66f8\u304f\u306e\u304c\u3088\u3044\uff09<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u300cGroup B\u306b\u304a\u3051\u308b\u89e3\u6790\u300d<\/p>\n\n\n\n<p>\u4e00\u65b9\u3001Group\u304cB\u306e\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u3067\u306f\u3001\u9023\u7d9a\u5909\u6570X\u306f\u76ee\u7684\u5909\u6570Y\u306b\u5bfe\u3057\u3066\u7d71\u8a08\u7684\u306b\u6709\u610f\u306a\u5f71\u97ff\u3092\u793a\u3055\u306a\u304b\u3063\u305f\uff08\u3042\u308b\u3044\u306f\u3001\u6709\u610f\u306a\u8ca0\u306e\u5f71\u97ff\u3092\u793a\u3057\u305f\u3001\u306a\u3069\u5177\u4f53\u7684\u306b\u8a18\u8ff0\u3059\u308b\uff09\uff08\u56de\u5e30\u4fc2\u6570 = Estimate of GroupB, SE=SE of GroupB,  t=t\u2212value of GroupB, p=p\u2212value of GroupB\uff09\u3002\u3053\u306e\u7d50\u679c\u306f\u3001Group\u304cA\u306e\u30b0\u30eb\u30fc\u30d7\u3068\u6bd4\u8f03\u3057\u3066\u3001X\u306eY\u3078\u306e\u5f71\u97ff\u304c\u8cea\u7684\u306b\uff08\u307e\u305f\u306f\u91cf\u7684\u306b\uff09\u7570\u306a\u308b\u3053\u3068\u3092\u660e\u78ba\u306b\u793a\u3057\u3066\u3044\u308b\u3002\uff08\u8868\u3067\u63d0\u793a\u3057\u306a\u3044\u5834\u5408\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306b\u8a73\u7d30\u306b\u66f8\u304f\u306e\u304c\u3088\u3044\uff09<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u679c\u306e\u8981\u7d04\u3068\u8003\u5bdf<\/h3>\n\n\n\n<p>\u6700\u5f8c\u306b\u3001\u4ea4\u4e92\u4f5c\u7528\u3068\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u306e\u7d50\u679c\u3092\u8981\u7d04\u3057\u3001\u305d\u306e\u5b66\u8853\u7684\u306a\u610f\u7fa9\u3084\u81e8\u5e8a\u7684\u306a\u610f\u5473\u306b\u3064\u3044\u3066\u8003\u5bdf\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>\u8a18\u8ff0\u4f8b:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u4ee5\u4e0a\u306e\u7d50\u679c\u304b\u3089\u3001\u9023\u7d9a\u5909\u6570<strong>X<\/strong>\u304c\u76ee\u7684\u5909\u6570<strong>Y<\/strong>\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u306f\u3001\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570<strong>Group<\/strong>\u306e\u6c34\u6e96\u306b\u3088\u3063\u3066\u5927\u304d\u304f\u7570\u306a\u308b\u3053\u3068\u304c\u660e\u3089\u304b\u306b\u306a\u3063\u305f\u3002\u7279\u306b\u3001<strong>Group A\u306b\u304a\u3044\u3066\u306fX\u306e\u6b63\u306e\u52b9\u679c\u304c\u8a8d\u3081\u3089\u308c\u305f<\/strong>\u306e\u306b\u5bfe\u3057\u3001<strong>Group B\u3067\u306f\u305d\u306e\u52b9\u679c\u304c\u8a8d\u3081\u3089\u308c\u306a\u3044<\/strong>\uff08\u307e\u305f\u306f\u52b9\u679c\u306e\u65b9\u5411\u304c\u7570\u306a\u308b\uff09\u3053\u3068\u304c\u793a\u3055\u308c\u305f\u3002\u3053\u306e\u77e5\u898b\u306f\u3001\u4eca\u5f8c\u3007\u3007\u306a\u4ecb\u5165\u3092\u884c\u3046\u969b\u306b\u3001<strong>Group<\/strong>\u306e\u7279\u6027\u3092\u8003\u616e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u3092\u793a\u5506\u3057\u3066\u3044\u308b\u3002\u4eca\u5f8c\u306e\u7814\u7a76\u3067\u306f\u3001\u306a\u305c\u3053\u306e\u3088\u3046\u306a\u4ea4\u4e92\u4f5c\u7528\u304c\u751f\u3058\u308b\u306e\u304b\u3001\u305d\u306e\u30e1\u30ab\u30cb\u30ba\u30e0\u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8a73\u7d30\u306a\u691c\u8a0e\u304c\u5fc5\u8981\u3067\u3042\u308b\u3002<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u56f3\u3092\u7528\u3044\u305f\u53ef\u8996\u5316<\/h3>\n\n\n\n<p>\u4ea4\u4e92\u4f5c\u7528\u306e\u7d50\u679c\u306f\u3001\u56f3\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3088\u308a\u76f4\u611f\u7684\u306b\u7406\u89e3\u3057\u3084\u3059\u304f\u306a\u308b\u3002\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570\u3054\u3068\u306e\u6563\u5e03\u56f3\u306b\u56de\u5e30\u76f4\u7dda\u3092\u63cf\u753b\u3057\u305f\u308a\u3001\u4e88\u6e2c\u5024\u30d7\u30ed\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u305f\u308a\u3059\u308b\u3068\u826f\u3044\u3002<\/p>\n\n\n\n<p><strong>R\u3067\u306e\u4f8b\uff08ggplot2\u3092\u4f7f\u7528\uff09:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>library(ggplot2)\n\nggplot(mydata, aes(x = X, y = Y, color = Group)) +\n  geom_point(alpha = 0.6) +\n  geom_smooth(method = \"lm\", se = TRUE) + # \u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u3054\u3068\u306b\u56de\u5e30\u76f4\u7dda\u3092\u63cf\u753b\n  labs(title = \"Y\u3068X\u306e\u95a2\u4fc2\u6027\u306b\u304a\u3051\u308bGroup\u306e\u4ea4\u4e92\u4f5c\u7528\",\n       x = \"\u9023\u7d9a\u5909\u6570 X\",\n       y = \"\u76ee\u7684\u5909\u6570 Y\") +\n  theme_minimal()\n\nggsave(\"linear_regression_interaction_term.png\", width = 8, height = 6)\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2025\/07\/linear_regression_interaction_term-1024x768.png\" alt=\"\" class=\"wp-image-4336\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2025\/07\/linear_regression_interaction_term-1024x768.png 1024w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2025\/07\/linear_regression_interaction_term-300x225.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2025\/07\/linear_regression_interaction_term-768x576.png 768w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2025\/07\/linear_regression_interaction_term-1536x1152.png 1536w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2025\/07\/linear_regression_interaction_term-2048x1536.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u56f3\u3067\u898b\u3066\u3082\u3001\u50be\u304d\u304c Group \u3054\u3068\u306b\u7570\u306a\u308b\u3068\u8a00\u3044\u5207\u308b\u3053\u3068\u306f\u3067\u304d\u305a\u3001\u4ea4\u4e92\u4f5c\u7528\u304c\u3042\u308b\u3068\u306f\u8a00\u3048\u306a\u3044\u3068\u3044\u3046\u89e3\u6790\u7d50\u679c\u3092\u88cf\u4ed8\u3051\u308b\u7d50\u679c\u3068\u306a\u3063\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u542b\u3080\u56de\u5e30\u5206\u6790\u306f\u3001\u30c7\u30fc\u30bf\u9593\u306e\u8907\u96d1\u306a\u95a2\u4fc2\u6027\u3092\u660e\u3089\u304b\u306b\u3059\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u3002\u7279\u306b\u4ea4\u4e92\u4f5c\u7528\u304c\u6709\u610f\u3067\u3042\u3063\u305f\u5834\u5408\u3001\u5358\u306b\u305d\u306e\u6709\u610f\u6027\u3092\u5831\u544a\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\u89e3\u6790\u3092\u901a\u3058\u3066\u305d\u306e\u5177\u4f53\u7684\u306a\u610f\u5473\u3092\u6df1\u304f\u6398\u308a\u4e0b\u3052\u3001\u5206\u304b\u308a\u3084\u3059\u304f\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3042\u308b\u3002\u672c\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u8a18\u8ff0\u65b9\u6cd5\u3068R\u306e\u5177\u4f53\u4f8b\u304c\u3001\u3042\u306a\u305f\u306e\u7814\u7a76\u8ad6\u6587\u4f5c\u6210\u306e\u4e00\u52a9\u3068\u306a\u308c\u3070\u5e78\u3044\u3067\u3042\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u56de\u5e30\u5206\u6790\u3092\u884c\u3046\u969b\u30012\u3064\u4ee5\u4e0a\u306e\u8aac\u660e\u5909\u6570\u304c\u5f93\u5c5e\u5909\u6570\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u304c\u3001\u4e92\u3044\u306e\u6c34\u6e96\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308b\u3002\u3053\u306e\u3088\u3046\u306a\u73fe\u8c61\u3092\u300c\u4ea4\u4e92\u4f5c\u7528\uff08interaction\uff09\u300d\u3068\u547c\u3073\u3001\u7d71\u8a08\u30e2\u30c7\u30eb\u306b\u4ea4\u4e92\u4f5c\u7528\u9805\u3092\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3067\u3001\u3088\u308a\u8a73\u7d30\u306a\u95a2\u4fc2\u6027\u3092\u660e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4336,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[68],"tags":[],"class_list":["post-4330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-68"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2025\/07\/linear_regression_interaction_term.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/comments?post=4330"}],"version-history":[{"count":6,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4330\/revisions"}],"predecessor-version":[{"id":4337,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4330\/revisions\/4337"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media\/4336"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=4330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=4330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=4330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}