{"id":4136,"date":"2025-07-06T11:34:29","date_gmt":"2025-07-06T02:34:29","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/?p=4136"},"modified":"2025-07-06T11:34:30","modified_gmt":"2025-07-06T02:34:30","slug":"mediator-factor-crucial-concept-research-design-thorough-explanation","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/mediator-factor-crucial-concept-research-design-thorough-explanation\/","title":{"rendered":"\u5a92\u4ecb\u56e0\u5b50\u3068\u306f\uff1f\u7814\u7a76\u30c7\u30b6\u30a4\u30f3\u306b\u304a\u3051\u308b\u91cd\u8981\u306a\u6982\u5ff5\u3092\u5fb9\u5e95\u89e3\u8aac"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u75ab\u5b66\u7814\u7a76\u3084\u793e\u4f1a\u79d1\u5b66\u7814\u7a76\u306b\u304a\u3044\u3066\u3001\u3042\u308b\u4e8b\u8c61\u304c\u5225\u306e\u4e8b\u8c61\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u89e3\u660e\u3059\u308b\u3053\u3068\u306f\u975e\u5e38\u306b\u91cd\u8981\u3067\u3042\u308b\u3002\u3057\u304b\u3057\u3001\u5358\u306b\u300cA\u304cB\u3092\u5f15\u304d\u8d77\u3053\u3059\u300d\u3068\u3044\u3046\u3060\u3051\u3067\u306a\u304f\u3001\u305d\u306e\u9593\u306b\u5225\u306e\u8981\u56e0\u304c\u4ecb\u5728\u3059\u308b\u3053\u3068\u304c\u3088\u304f\u3042\u308b\u3002\u3053\u306e\u3088\u3046\u306a\u6642\u306b\u767b\u5834\u3059\u308b\u306e\u304c\u300c<strong>\u5a92\u4ecb\u56e0\u5b50<\/strong>\u300d\u300c<strong>\u4e2d\u9593\u56e0\u5b50<\/strong>\u300d\u300c<strong>\u4ea4\u7d61\u56e0\u5b50<\/strong>\u300d\u3068\u3044\u3063\u305f\u6982\u5ff5\u3067\u3042\u308b\u3002\u3053\u308c\u3089\u306e\u6982\u5ff5\u306f\u6df7\u540c\u3055\u308c\u304c\u3061\u3067\u3042\u308b\u304c\u3001\u305d\u308c\u305e\u308c\u304c\u6301\u3064\u610f\u5473\u3068\u5f79\u5272\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u306f\u3001\u7814\u7a76\u7d50\u679c\u3092\u6b63\u3057\u304f\u89e3\u91c8\u3057\u3001\u3088\u308a\u9069\u5207\u306a\u4ecb\u5165\u7b56\u3092\u691c\u8a0e\u3059\u308b\u305f\u3081\u306b\u4e0d\u53ef\u6b20\u3067\u3042\u308b\u3002\u672c\u8a18\u4e8b\u3067\u306f\u3001\u7279\u306b\u300c\u5a92\u4ecb\u56e0\u5b50\u300d\u306b\u7126\u70b9\u3092\u5f53\u3066\u3001\u305d\u306e\u6982\u8981\u304b\u3089\u5177\u4f53\u7684\u306a\u4f8b\u3001\u305d\u3057\u3066\u300c\u4e2d\u9593\u56e0\u5b50\u300d\u300c\u4ea4\u7d61\u56e0\u5b50\u300d\u3068\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u3001R\u3092\u7528\u3044\u305f\u8a08\u7b97\u4f8b\u3082\u4ea4\u3048\u306a\u304c\u3089\u8a73\u3057\u304f\u89e3\u8aac\u3059\u308b\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">\u5a92\u4ecb\u56e0\u5b50\u306e\u6982\u8981\u3068\u5177\u4f53\u4f8b<\/h2>\n\n\n\n<p>\u5a92\u4ecb\u56e0\u5b50\uff08Mediator\uff09\u3068\u306f\u3001<strong>\u72ec\u7acb\u5909\u6570<\/strong>\uff08\u539f\u56e0\u3068\u306a\u308b\u5909\u6570\uff09\u304c<strong>\u5f93\u5c5e\u5909\u6570<\/strong>\uff08\u7d50\u679c\u3068\u306a\u308b\u5909\u6570\uff09\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u969b\u306b\u3001\u305d\u306e\u56e0\u679c\u95a2\u4fc2\u3092\u90e8\u5206\u7684\u306b\u3001\u3042\u308b\u3044\u306f\u5b8c\u5168\u306b\u8aac\u660e\u3059\u308b\u7b2c\u4e09\u306e\u5909\u6570\u3067\u3042\u308b\u3002\u3064\u307e\u308a\u3001\u72ec\u7acb\u5909\u6570\u306f\u76f4\u63a5\u7684\u306b\u5f93\u5c5e\u5909\u6570\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5a92\u4ecb\u56e0\u5b50\u3092\u4ecb\u3057\u3066\u5f93\u5c5e\u5909\u6570\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3002<\/p>\n\n\n\n<p>\u6a21\u5f0f\u7684\u306b\u8868\u3059\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<p>$$ \\text{\u72ec\u7acb\u5909\u6570} \\rightarrow \\text{\u5a92\u4ecb\u56e0\u5b50} \\rightarrow \\text{\u5f93\u5c5e\u5909\u6570} $$<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u300c\u5b66\u7fd2\u6642\u9593\u304c\u9577\u3044\u307b\u3069\u8a66\u9a13\u306e\u5f97\u70b9\u304c\u9ad8\u304f\u306a\u308b\u300d\u3068\u3044\u3046\u95a2\u4fc2\u306f\u7406\u306b\u304b\u306a\u3063\u3066\u3044\u308b\u3002\u3053\u306e\u6642\u3001\u300c\u5b66\u7fd2\u6642\u9593\u304c\u9577\u3044\u3068\u7406\u89e3\u5ea6\u304c\u4e0a\u304c\u308a\u3001\u305d\u306e\u7d50\u679c\u8a66\u9a13\u306e\u5f97\u70b9\u304c\u9ad8\u304f\u306a\u308b\u300d\u3068\u3044\u3046\u7e4b\u304c\u308a\u304c\u8003\u3048\u3089\u308c\u308b\u5834\u5408\u3001&#8221;\u7406\u89e3\u5ea6&#8221;\u304c\u5a92\u4ecb\u56e0\u5b50\u3068\u306a\u308b\u3002\u5b66\u7fd2\u6642\u9593\uff08\u72ec\u7acb\u5909\u6570\uff09\u304c\u7406\u89e3\u5ea6\uff08\u5a92\u4ecb\u56e0\u5b50\uff09\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u3001\u305d\u306e\u7406\u89e3\u5ea6\uff08\u5a92\u4ecb\u56e0\u5b50\uff09\u304c\u8a66\u9a13\u306e\u5f97\u70b9\uff08\u5f93\u5c5e\u5909\u6570\uff09\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u3066\u3044\u308b\u3001\u3068\u3044\u3046\u69cb\u56f3\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u5a92\u4ecb\u56e0\u5b50\u3092\u7279\u5b9a\u3057\u3001\u305d\u306e\u5f71\u97ff\u3092\u5206\u6790\u3059\u308b\u3053\u3068\u3067\u3001\u56e0\u679c\u95a2\u4fc2\u306e\u300c\u306a\u305c\uff1f\u300d\u3092\u3088\u308a\u6df1\u304f\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5a92\u4ecb\u56e0\u5b50\u3001\u4e2d\u9593\u56e0\u5b50\u3001\u4ea4\u7d61\u56e0\u5b50\u306e\u9055\u3044<\/h2>\n\n\n\n<p>\u3053\u3053\u3067\u3001\u6df7\u540c\u3057\u3084\u3059\u3044\u300c\u4e2d\u9593\u56e0\u5b50\u300d\u3068\u300c\u4ea4\u7d61\u56e0\u5b50\u300d\u3068\u306e\u9055\u3044\u3092\u660e\u78ba\u306b\u3057\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5a92\u4ecb\u56e0\u5b50\uff08Mediator\uff09:\u72ec\u7acb\u5909\u6570\u304c\u5f93\u5c5e\u5909\u6570\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u300c\u7d4c\u8def\u300d\u306e\u4e00\u90e8\u3068\u306a\u308b\u5909\u6570\u3002\u72ec\u7acb\u5909\u6570\u304c\u5a92\u4ecb\u56e0\u5b50\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u3001\u5a92\u4ecb\u56e0\u5b50\u304c\u5f93\u5c5e\u5909\u6570\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3068\u3044\u3046\u3001\u56e0\u679c\u306e\u9023\u9396\u306e\u4e2d\u306b\u4f4d\u7f6e\u3059\u308b\u3002\u5a92\u4ecb\u56e0\u5b50\u3092\u7d71\u8a08\u7684\u306b\u8abf\u6574\uff08\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\uff09\u3059\u308b\u3068\u3001\u72ec\u7acb\u5909\u6570\u3068\u5f93\u5c5e\u5909\u6570\u306e\u76f4\u63a5\u7684\u306a\u95a2\u4fc2\u304c\u5f31\u307e\u308b\u3001\u3042\u308b\u3044\u306f\u6d88\u5931\u3059\u308b\u3053\u3068\u304c\u671f\u5f85\u3055\u308c\u308b\u3002<\/li>\n\n\n\n<li>\u4e2d\u9593\u56e0\u5b50\uff08Intermediate Variable\uff09:\u5a92\u4ecb\u56e0\u5b50\u3068\u307b\u307c\u540c\u7fa9\u3067\u4f7f\u308f\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u304c\u3001\u6587\u8108\u306b\u3088\u3063\u3066\u306f\u7279\u5b9a\u306e\u6642\u70b9\u3067\u306e\u300c\u4e2d\u9593\u7684\u306a\u30a2\u30a6\u30c8\u30ab\u30e0\u300d\u3092\u6307\u3059\u3053\u3068\u3082\u3042\u308b\u3002\u3057\u304b\u3057\u3001\u56e0\u679c\u306e\u7d4c\u8def\u3092\u8aac\u660e\u3059\u308b\u5f79\u5272\u3068\u3044\u3046\u610f\u5473\u3067\u306f\u3001\u5a92\u4ecb\u56e0\u5b50\u3068\u540c\u3058\u3068\u8003\u3048\u3066\u5dee\u3057\u652f\u3048\u306a\u3044\u3002<\/li>\n\n\n\n<li>\u4ea4\u7d61\u56e0\u5b50\uff08Confounder\uff09:\u72ec\u7acb\u5909\u6570\u3068\u5f93\u5c5e\u5909\u6570\u306e\u4e21\u65b9\u306b\u95a2\u9023\u3057\u3001\u304b\u3064\u72ec\u7acb\u5909\u6570\u3068\u5f93\u5c5e\u5909\u6570\u306e\u56e0\u679c\u7d4c\u8def\u306b\u306f\u542b\u307e\u308c\u306a\u3044\u7b2c\u4e09\u306e\u5909\u6570\u3067\u3042\u308b\u3002\u4ea4\u7d61\u56e0\u5b50\u304c\u5b58\u5728\u3059\u308b\u3068\u3001\u72ec\u7acb\u5909\u6570\u3068\u5f93\u5c5e\u5909\u6570\u306e\u9593\u306e\u898b\u304b\u3051\u4e0a\u306e\u95a2\u4fc2\u304c\u3001\u5b9f\u969b\u3088\u308a\u3082\u5f37\u304f\u898b\u3048\u305f\u308a\u3001\u5f31\u304f\u898b\u3048\u305f\u308a\u3001\u3042\u308b\u3044\u306f\u5b58\u5728\u3057\u306a\u3044\u95a2\u4fc2\u304c\u3042\u308b\u3088\u3046\u306b\u898b\u3048\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u4ea4\u7d61\u56e0\u5b50\u306f\u3001\u771f\u306e\u56e0\u679c\u95a2\u4fc2\u3092\u6b6a\u3081\u308b\u305f\u3081\u3001\u7814\u7a76\u306b\u304a\u3044\u3066\u306f\u7d71\u8a08\u7684\u306b\u8abf\u6574\uff08\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\uff09\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6a21\u5f0f\u7684\u306b\u8868\u3059\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<p><strong>\u4ea4\u7d61\u56e0\u5b50\uff1a<\/strong><\/p>\n\n\n\n<p>$$ \\text{\u72ec\u7acb\u5909\u6570} \\leftarrow \\text{\u4ea4\u7d61\u56e0\u5b50} \\rightarrow \\text{\u5f93\u5c5e\u5909\u6570} $$<\/p>\n\n\n\n<p><strong>\u5a92\u4ecb\u56e0\u5b50\uff1a<\/strong><\/p>\n\n\n\n<p>$$ \\text{\u72ec\u7acb\u5909\u6570} \\rightarrow \\text{\u5a92\u4ecb\u56e0\u5b50} \\rightarrow \\text{\u5f93\u5c5e\u5909\u6570} $$<\/p>\n\n\n\n<p>\u91cd\u8981\u306a\u9055\u3044\u306f\u3001\u4ea4\u7d61\u56e0\u5b50\u304c\u300c\u72ec\u7acb\u5909\u6570\u3068\u5f93\u5c5e\u5909\u6570\u306e\u4e21\u65b9\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u5916\u90e8\u306e\u8981\u56e0\u300d\u3067\u3042\u308b\u306e\u306b\u5bfe\u3057\u3001\u5a92\u4ecb\u56e0\u5b50\u306f\u300c\u72ec\u7acb\u5909\u6570\u304c\u5f93\u5c5e\u5909\u6570\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u30e1\u30ab\u30cb\u30ba\u30e0\u306e\u4e00\u90e8\u300d\u3067\u3042\u308b\u3068\u3044\u3046\u70b9\u3067\u3042\u308b\u3002\u4ea4\u7d61\u56e0\u5b50\u306f\u300c\u53d6\u308a\u9664\u304f\u3079\u304d\u6b6a\u307f\u300d\u3067\u3042\u308a\u3001\u5a92\u4ecb\u56e0\u5b50\u306f\u300c\u89e3\u660e\u3059\u3079\u304d\u30e1\u30ab\u30cb\u30ba\u30e0\u300d\u3067\u3042\u308b\u3068\u8003\u3048\u308b\u3068\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-1385525783\" 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\">\u5177\u4f53\u4f8b\u306eR\u8a08\u7b97\u4f8b<\/h2>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u3001\u5a92\u4ecb\u52b9\u679c\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306e\u4ee3\u8868\u7684\u306a\u65b9\u6cd5\u3067\u3042\u308b\u56de\u5e30\u5206\u6790\u3092\u7528\u3044\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u3092R\u3067\u793a\u3059\u3002\u67b6\u7a7a\u306e\u30c7\u30fc\u30bf\u3092\u7528\u3044\u3066\u3001\u300c\u5b66\u7fd2\u6642\u9593\u300d\u304c\u300c\u8a66\u9a13\u306e\u5f97\u70b9\u300d\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u3092\u300c\u7406\u89e3\u5ea6\u300d\u304c\u5a92\u4ecb\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u691c\u8a3c\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>R \u30b9\u30af\u30ea\u30d7\u30c8\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u30c7\u30fc\u30bf\u306e\u4f5c\u6210 (\u67b6\u7a7a\u306e\u30c7\u30fc\u30bf)\nset.seed(123) # \u518d\u73fe\u6027\u306e\u305f\u3081\u306e\u30b7\u30fc\u30c9\u8a2d\u5b9a\nn &lt;- 100 # \u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\n\u5b66\u7fd2\u6642\u9593 &lt;- round(runif(n, 1, 10)) # 1\u6642\u9593\u304b\u308910\u6642\u9593\u306e\u9593\u3067\u4e00\u69d8\u4e71\u6570\n\u7406\u89e3\u5ea6 &lt;- round(2 * \u5b66\u7fd2\u6642\u9593 + rnorm(n, 0, 1)) # \u5b66\u7fd2\u6642\u9593\u304c\u7406\u89e3\u5ea6\u306b\u5f71\u97ff\n\u8a66\u9a13\u306e\u5f97\u70b9 &lt;- round(3 * \u7406\u89e3\u5ea6 + 5 * \u5b66\u7fd2\u6642\u9593 + rnorm(n, 0, 5)) # \u7406\u89e3\u5ea6\u3068\u5b66\u7fd2\u6642\u9593\u306e\u4e21\u65b9\u304c\u8a66\u9a13\u306e\u5f97\u70b9\u306b\u5f71\u97ff\n\n# \u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u307e\u3068\u3081\u308b\ndf &lt;- data.frame(\u5b66\u7fd2\u6642\u9593, \u7406\u89e3\u5ea6, \u8a66\u9a13\u306e\u5f97\u70b9)\n\n# 1. \u5b66\u7fd2\u6642\u9593\u304c\u8a66\u9a13\u306e\u5f97\u70b9\u306b\u4e0e\u3048\u308b\u76f4\u63a5\u52b9\u679c (\u5a92\u4ecb\u56e0\u5b50\u3092\u8003\u616e\u3057\u306a\u3044\u5834\u5408)\nmodel_total_effect &lt;- lm(\u8a66\u9a13\u306e\u5f97\u70b9 ~ \u5b66\u7fd2\u6642\u9593, data = df)\nsummary(model_total_effect)\n\n# 2. \u5b66\u7fd2\u6642\u9593\u304c\u7406\u89e3\u5ea6\u306b\u4e0e\u3048\u308b\u5f71\u97ff\nmodel_mediator_path &lt;- lm(\u7406\u89e3\u5ea6 ~ \u5b66\u7fd2\u6642\u9593, data = df)\nsummary(model_mediator_path)\n\n# 3. \u7406\u89e3\u5ea6\u304c\u8a66\u9a13\u306e\u5f97\u70b9\u306b\u4e0e\u3048\u308b\u5f71\u97ff (\u5b66\u7fd2\u6642\u9593\u3092\u8abf\u6574)\nmodel_outcome_path &lt;- lm(\u8a66\u9a13\u306e\u5f97\u70b9 ~ \u7406\u89e3\u5ea6 + \u5b66\u7fd2\u6642\u9593, data = df)\nsummary(model_outcome_path)\n\n# \u5a92\u4ecb\u52b9\u679c\u306e\u8a08\u7b97 (Baron &amp; Kenny \u306e\u624b\u6cd5\u306b\u57fa\u3065\u304f)\n# \u76f4\u63a5\u52b9\u679c (c') = model_outcome_path \u306e\u5b66\u7fd2\u6642\u9593\u306e\u4fc2\u6570\n# \u9593\u63a5\u52b9\u679c (ab) = model_mediator_path \u306e\u5b66\u7fd2\u6642\u9593\u306e\u4fc2\u6570 * model_outcome_path \u306e\u7406\u89e3\u5ea6\u306e\u4fc2\u6570\n# \u5168\u52b9\u679c (c) = model_total_effect \u306e\u5b66\u7fd2\u6642\u9593\u306e\u4fc2\u6570\n\n# \u7d50\u679c\u306e\u8868\u793a (\u624b\u8a08\u7b97\u3067\u78ba\u8a8d)\ntotal_effect &lt;- coef(model_total_effect)&#91;\"\u5b66\u7fd2\u6642\u9593\"]\ndirect_effect &lt;- coef(model_outcome_path)&#91;\"\u5b66\u7fd2\u6642\u9593\"]\nindirect_effect &lt;- coef(model_mediator_path)&#91;\"\u5b66\u7fd2\u6642\u9593\"] * coef(model_outcome_path)&#91;\"\u7406\u89e3\u5ea6\"]\n\ncat(\"\u5168\u52b9\u679c (Total Effect):\", total_effect, \"\\n\")\ncat(\"\u76f4\u63a5\u52b9\u679c (Direct Effect):\", direct_effect, \"\\n\")\ncat(\"\u9593\u63a5\u52b9\u679c (Indirect Effect):\", indirect_effect, \"\\n\")\ncat(\"\u76f4\u63a5\u52b9\u679c + \u9593\u63a5\u52b9\u679c (c' + ab):\", direct_effect + indirect_effect, \"\\n\")\n\n# \u3055\u3089\u306b\u8a73\u7d30\u306a\u5a92\u4ecb\u5206\u6790\u3092\u884c\u3046\u30d1\u30c3\u30b1\u30fc\u30b8 (\u4f8b: `mediation` \u30d1\u30c3\u30b1\u30fc\u30b8) \u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u63a8\u5968\u3055\u308c\u308b\u3002\n# install.packages(\"mediation\")\n# library(mediation)\n# med.result &lt;- mediate(model_mediator_path, model_outcome_path, treat=\"\u5b66\u7fd2\u6642\u9593\", mediator=\"\u7406\u89e3\u5ea6\", boot=TRUE)\n# summary(med.result)\n<\/code><\/pre>\n\n\n\n<p><strong>\u5b9f\u884c\u7d50\u679c\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> # 1. \u5b66\u7fd2\u6642\u9593\u304c\u8a66\u9a13\u306e\u5f97\u70b9\u306b\u4e0e\u3048\u308b\u76f4\u63a5\u52b9\u679c (\u5a92\u4ecb\u56e0\u5b50\u3092\u8003\u616e\u3057\u306a\u3044\u5834\u5408)\n> model_total_effect &lt;- lm(\u8a66\u9a13\u306e\u5f97\u70b9 ~ \u5b66\u7fd2\u6642\u9593, data = df)\n> summary(model_total_effect)\n\nCall:\nlm(formula = \u8a66\u9a13\u306e\u5f97\u70b9 ~ \u5b66\u7fd2\u6642\u9593, data = df)\n\nResiduals:\n     Min       1Q   Median       3Q      Max \n-11.7525  -3.6767  -0.6388   3.8685  13.1717 \n\nCoefficients:\n            Estimate Std. Error t value Pr(>|t|)    \n(Intercept)   0.2831     1.2234   0.231    0.817    \n\u5b66\u7fd2\u6642\u9593     10.9242     0.2026  53.908   &lt;2e-16 ***\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: 5.264 on 98 degrees of freedom\nMultiple R-squared:  0.9674,    Adjusted R-squared:  0.967 \nF-statistic:  2906 on 1 and 98 DF,  p-value: &lt; 2.2e-16\n\n> # 2. \u5b66\u7fd2\u6642\u9593\u304c\u7406\u89e3\u5ea6\u306b\u4e0e\u3048\u308b\u5f71\u97ff\n> model_mediator_path &lt;- lm(\u7406\u89e3\u5ea6 ~ \u5b66\u7fd2\u6642\u9593, data = df)\n> summary(model_mediator_path)\n\nCall:\nlm(formula = \u7406\u89e3\u5ea6 ~ \u5b66\u7fd2\u6642\u9593, data = df)\n\nResiduals:\n    Min      1Q  Median      3Q     Max \n-1.9446 -0.9234  0.0681  1.0554  2.0892 \n\nCoefficients:\n            Estimate Std. Error t value Pr(>|t|)    \n(Intercept) -0.04698    0.23770  -0.198    0.844    \n\u5b66\u7fd2\u6642\u9593     1.99578    0.03937  50.692   &lt;2e-16 ***\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: 1.023 on 98 degrees of freedom\nMultiple R-squared:  0.9633,    Adjusted R-squared:  0.9629 \nF-statistic:  2570 on 1 and 98 DF,  p-value: &lt; 2.2e-16\n\n> # 3. \u7406\u89e3\u5ea6\u304c\u8a66\u9a13\u306e\u5f97\u70b9\u306b\u4e0e\u3048\u308b\u5f71\u97ff (\u5b66\u7fd2\u6642\u9593\u3092\u8abf\u6574)\n> model_outcome_path &lt;- lm(\u8a66\u9a13\u306e\u5f97\u70b9 ~ \u7406\u89e3\u5ea6 + \u5b66\u7fd2\u6642\u9593, data = df)\n> summary(model_outcome_path)\n\nCall:\nlm(formula = \u8a66\u9a13\u306e\u5f97\u70b9 ~ \u7406\u89e3\u5ea6 + \u5b66\u7fd2\u6642\u9593, data = df)\n\nResiduals:\n    Min      1Q  Median      3Q     Max \n-7.1760 -3.6993 -0.8468  2.9250 15.3789 \n\nCoefficients:\n            Estimate Std. Error t value Pr(>|t|)    \n(Intercept)   0.3949     1.0907   0.362    0.718    \n\u7406\u89e3\u5ea6        2.3793     0.4634   5.134 1.46e-06 ***\n\u5b66\u7fd2\u6642\u9593      6.1756     0.9424   6.553 2.71e-09 ***\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: 4.692 on 97 degrees of freedom\nMultiple R-squared:  0.9743,    Adjusted R-squared:  0.9738 \nF-statistic:  1842 on 2 and 97 DF,  p-value: &lt; 2.2e-16\n\n> cat(\"\u5168\u52b9\u679c (Total Effect):\", total_effect, \"\\n\")\n\u5168\u52b9\u679c (Total Effect): 10.92419 \n> cat(\"\u76f4\u63a5\u52b9\u679c (Direct Effect):\", direct_effect, \"\\n\")\n\u76f4\u63a5\u52b9\u679c (Direct Effect): 6.175633 \n> cat(\"\u9593\u63a5\u52b9\u679c (Indirect Effect):\", indirect_effect, \"\\n\")\n\u9593\u63a5\u52b9\u679c (Indirect Effect): 4.748561 \n> cat(\"\u76f4\u63a5\u52b9\u679c + \u9593\u63a5\u52b9\u679c (c' + ab):\", direct_effect + indirect_effect, \"\\n\")\n\u76f4\u63a5\u52b9\u679c + \u9593\u63a5\u52b9\u679c (c' + ab): 10.92419 <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u679c\u89e3\u91c8<\/h3>\n\n\n\n<p>\u4e0a\u8a18R\u30b3\u30fc\u30c9\u306e\u51fa\u529b\u7d50\u679c\u3092\u57fa\u306b\u89e3\u91c8\u3092\u884c\u3046\u3002<\/p>\n\n\n\n<ul start=\"1\" class=\"wp-block-list\">\n<li><strong><code>model_total_effect<\/code>\u306e\u89e3\u91c8:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>\u5b66\u7fd2\u6642\u9593<\/code>\u306e\u4fc2\u6570\uff08Total Effect: c\uff09\u306f\u3001<code>\u5b66\u7fd2\u6642\u9593<\/code>\u304c<code>\u8a66\u9a13\u306e\u5f97\u70b9<\/code>\u306b\u4e0e\u3048\u308b\u76f4\u63a5\u7684\u306a\uff08\u5a92\u4ecb\u56e0\u5b50\u3092\u8003\u616e\u3057\u306a\u3044\uff09\u5f71\u97ff\u3092\u793a\u3059\u3002\u3053\u306e\u4fc2\u6570\u304c\u7d71\u8a08\u7684\u306b\u6709\u610f\u3067\u3042\u308c\u3070\u3001<code>\u5b66\u7fd2\u6642\u9593<\/code>\u304c<code>\u8a66\u9a13\u306e\u5f97\u70b9<\/code>\u306b\u4f55\u3089\u304b\u306e\u5f71\u97ff\u3092\u4e0e\u3048\u3066\u3044\u308b\u3053\u3068\u304c\u793a\u5506\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><code>model_mediator_path<\/code>\u306e\u89e3\u91c8:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>\u5b66\u7fd2\u6642\u9593<\/code>\u306e\u4fc2\u6570\uff08Path a: a\uff09\u306f\u3001<code>\u5b66\u7fd2\u6642\u9593<\/code>\u304c<code>\u7406\u89e3\u5ea6<\/code>\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u3092\u793a\u3059\u3002\u3053\u308c\u304c\u7d71\u8a08\u7684\u306b\u6709\u610f\u3067\u3042\u308c\u3070\u3001<code>\u5b66\u7fd2\u6642\u9593<\/code>\u304c\u5897\u3048\u308b\u3053\u3068\u3067<code>\u7406\u89e3\u5ea6<\/code>\u3082\u5411\u4e0a\u3059\u308b\u3053\u3068\u304c\u5206\u304b\u308b\u3002\u3053\u308c\u306f\u5a92\u4ecb\u52b9\u679c\u306e\u7b2c\u4e00\u6bb5\u968e\u3067\u3042\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><code>model_outcome_path<\/code>\u306e\u89e3\u91c8:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>\u7406\u89e3\u5ea6<\/code>\u306e\u4fc2\u6570\uff08Path b: b\uff09\u306f\u3001<code>\u5b66\u7fd2\u6642\u9593<\/code>\u3092\u8abf\u6574\u3057\u305f\u4e0a\u3067\u3001<code>\u7406\u89e3\u5ea6<\/code>\u304c<code>\u8a66\u9a13\u306e\u5f97\u70b9<\/code>\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u3092\u793a\u3059\u3002\u3053\u308c\u304c\u7d71\u8a08\u7684\u306b\u6709\u610f\u3067\u3042\u308c\u3070\u3001<code>\u7406\u89e3\u5ea6<\/code>\u304c\u9ad8\u3044\u307b\u3069<code>\u8a66\u9a13\u306e\u5f97\u70b9<\/code>\u3082\u9ad8\u304f\u306a\u308b\u3053\u3068\u304c\u793a\u5506\u3055\u308c\u308b\u3002<\/li>\n\n\n\n<li><code>\u5b66\u7fd2\u6642\u9593<\/code>\u306e\u4fc2\u6570\uff08Direct Effect: c\u2032\uff09\u306f\u3001<code>\u7406\u89e3\u5ea6<\/code>\u3092\u8abf\u6574\u3057\u305f\u4e0a\u3067\u306e<code>\u5b66\u7fd2\u6642\u9593<\/code>\u304c<code>\u8a66\u9a13\u306e\u5f97\u70b9<\/code>\u306b\u4e0e\u3048\u308b\u76f4\u63a5\u7684\u306a\u5f71\u97ff\u3092\u793a\u3059\u3002\u3082\u3057\u3001<code>model_total_effect<\/code>\u306e<code>\u5b66\u7fd2\u6642\u9593<\/code>\u306e\u4fc2\u6570\u3068\u6bd4\u8f03\u3057\u3066\u3053\u306e\u4fc2\u6570\u304c\u5c0f\u3055\u304f\u306a\u308b\u304b\u3001\u7d71\u8a08\u7684\u306b\u6709\u610f\u3067\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u3001<code>\u7406\u89e3\u5ea6<\/code>\u304c\u5a92\u4ecb\u56e0\u5b50\u3068\u3057\u3066\u6a5f\u80fd\u3057\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>\u5a92\u4ecb\u52b9\u679c\u306e\u5224\u65ad:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5168\u52b9\u679c (c) \u306e\u5b58\u5728:<\/strong> \u72ec\u7acb\u5909\u6570\u3068\u5f93\u5c5e\u5909\u6570\u9593\u306b\u6709\u610f\u306a\u95a2\u4fc2\u304c\u3042\u308b\u3053\u3068\u3002<\/li>\n\n\n\n<li><strong>Path a (a) \u306e\u5b58\u5728:<\/strong> \u72ec\u7acb\u5909\u6570\u304c\u5a92\u4ecb\u56e0\u5b50\u306b\u6709\u610f\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3053\u3068\u3002<\/li>\n\n\n\n<li><strong>Path b (b) \u306e\u5b58\u5728:<\/strong> \u72ec\u7acb\u5909\u6570\u3067\u8abf\u6574\u3057\u305f\u4e0a\u3067\u3001\u5a92\u4ecb\u56e0\u5b50\u304c\u5f93\u5c5e\u5909\u6570\u306b\u6709\u610f\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3053\u3068\u3002<\/li>\n\n\n\n<li><strong>\u76f4\u63a5\u52b9\u679c (c\u2032) \u306e\u6e1b\u5c11\u307e\u305f\u306f\u975e\u6709\u610f\u5316:<\/strong> \u5168\u52b9\u679c\u3068\u6bd4\u8f03\u3057\u3066\u3001\u5a92\u4ecb\u56e0\u5b50\u3092\u30e2\u30c7\u30eb\u306b\u542b\u3081\u308b\u3053\u3068\u3067\u72ec\u7acb\u5909\u6570\u304b\u3089\u5f93\u5c5e\u5909\u6570\u3078\u306e\u76f4\u63a5\u7684\u306a\u5f71\u97ff\u304c\u6709\u610f\u306b\u6e1b\u5c11\u3059\u308b\u304b\u3001\u7d71\u8a08\u7684\u306b\u6709\u610f\u3067\u306a\u304f\u306a\u308b\u3053\u3068\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u9593\u63a5\u52b9\u679c\uff08ab\uff09\u306f\u3001\u72ec\u7acb\u5909\u6570\u304c\u5a92\u4ecb\u56e0\u5b50\u3092\u4ecb\u3057\u3066\u5f93\u5c5e\u5909\u6570\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u306e\u5927\u304d\u3055\u3092\u8868\u3059\u3002\u4e00\u822c\u7684\u306b\u3001\u5168\u52b9\u679c (c) \u306f\u76f4\u63a5\u52b9\u679c (c\u2032) \u3068\u9593\u63a5\u52b9\u679c (ab) \u306e\u5408\u8a08\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b (c=c\u2032+ab)\u3002<\/p>\n\n\n\n<p>\u4e0a\u8a18\u306eR\u306e\u8a08\u7b97\u7d50\u679c\u3067\u306f\u3001\u624b\u8a08\u7b97\u3067\u3053\u308c\u3089\u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>mediation\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u3088\u3046\u306a\u5c02\u7528\u306e\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u3088\u308a\u53b3\u5bc6\u306a\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u6cd5\u306a\u3069\u3092\u7528\u3044\u305f\u4fe1\u983c\u533a\u9593\u306e\u7b97\u51fa\u3084\u3001\u3088\u308a\u8907\u96d1\u306a\u30e2\u30c7\u30eb\u306e\u5206\u6790\u304c\u53ef\u80fd\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\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u7814\u7a76\u30c7\u30b6\u30a4\u30f3\u306b\u304a\u3044\u3066\u975e\u5e38\u306b\u91cd\u8981\u306a\u6982\u5ff5\u3067\u3042\u308b\u300c<strong>\u5a92\u4ecb\u56e0\u5b50<\/strong>\u300d\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u305f\u3002\u5a92\u4ecb\u56e0\u5b50\u306f\u3001\u72ec\u7acb\u5909\u6570\u304c\u5f93\u5c5e\u5909\u6570\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u89e3\u660e\u3059\u308b\u305f\u3081\u306e\u9375\u3068\u306a\u308b\u5909\u6570\u3067\u3042\u308b\u3002\u4e2d\u9593\u56e0\u5b50\u3068\u307b\u307c\u540c\u7fa9\u3067\u7528\u3044\u3089\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u304c\u3001\u56e0\u679c\u95a2\u4fc2\u3092\u6b6a\u3081\u308b\u300c<strong>\u4ea4\u7d61\u56e0\u5b50<\/strong>\u300d\u3068\u306f\u305d\u306e\u5f79\u5272\u304c\u5927\u304d\u304f\u7570\u306a\u308b\u3002<\/p>\n\n\n\n<p>\u5a92\u4ecb\u56e0\u5b50\u3092\u9069\u5207\u306b\u5206\u6790\u3059\u308b\u3053\u3068\u306f\u3001\u5358\u306a\u308b\u76f8\u95a2\u95a2\u4fc2\u306e\u628a\u63e1\u306b\u7559\u307e\u3089\u305a\u3001\u56e0\u679c\u95a2\u4fc2\u306e\u300c\u306a\u305c\uff1f\u300d\u3092\u6df1\u304f\u7406\u89e3\u3057\u3001\u3088\u308a\u52b9\u679c\u7684\u306a\u4ecb\u5165\u7b56\u3084\u653f\u7b56\u3092\u7acb\u6848\u3059\u308b\u305f\u3081\u306e\u57fa\u790e\u3068\u306a\u308b\u3002R\u306a\u3069\u306e\u7d71\u8a08\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u3053\u308c\u3089\u306e\u8907\u96d1\u306a\u95a2\u4fc2\u6027\u3092\u5b9a\u91cf\u7684\u306b\u5206\u6790\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3042\u308b\u3002\u7814\u7a76\u3092\u884c\u3046\u969b\u306b\u306f\u3001\u5a92\u4ecb\u56e0\u5b50\u3001\u4e2d\u9593\u56e0\u5b50\u3001\u4ea4\u7d61\u56e0\u5b50\u305d\u308c\u305e\u308c\u306e\u5f79\u5272\u3092\u660e\u78ba\u306b\u7406\u89e3\u3057\u3001\u9069\u5207\u306a\u5206\u6790\u624b\u6cd5\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3001\u8cea\u306e\u9ad8\u3044\u7814\u7a76\u6210\u679c\u3078\u3068\u7e4b\u304c\u308b\u3060\u308d\u3046\u3002<\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>\u75ab\u5b66\u7814\u7a76\u3084\u793e\u4f1a\u79d1\u5b66\u7814\u7a76\u306b\u304a\u3044\u3066\u3001\u3042\u308b\u4e8b\u8c61\u304c\u5225\u306e\u4e8b\u8c61\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u89e3\u660e\u3059\u308b\u3053\u3068\u306f\u975e\u5e38\u306b\u91cd\u8981\u3067\u3042\u308b\u3002\u3057\u304b\u3057\u3001\u5358\u306b\u300cA\u304cB\u3092\u5f15\u304d\u8d77\u3053\u3059\u300d\u3068\u3044\u3046\u3060\u3051\u3067\u306a\u304f\u3001\u305d\u306e\u9593\u306b\u5225\u306e\u8981\u56e0\u304c\u4ecb\u5728\u3059\u308b\u3053\u3068\u304c\u3088\u304f\u3042\u308b\u3002\u3053\u306e\u3088\u3046\u306a\u6642\u306b\u767b\u5834 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"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":[150],"tags":[],"class_list":["post-4136","post","type-post","status-publish","format-standard","hentry","category-150"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4136","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=4136"}],"version-history":[{"count":4,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4136\/revisions"}],"predecessor-version":[{"id":4140,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4136\/revisions\/4140"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=4136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=4136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=4136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}