{"id":4394,"date":"2025-08-05T22:48:43","date_gmt":"2025-08-05T13:48:43","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/?p=4394"},"modified":"2025-08-05T22:48:45","modified_gmt":"2025-08-05T13:48:45","slug":"iptw-regression-why-is-standard-error-estimation-so-crucial","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/iptw-regression-why-is-standard-error-estimation-so-crucial\/","title":{"rendered":"IPTW\u3092\u7528\u3044\u305f\u56de\u5e30\u30e2\u30c7\u30eb\uff1a\u306a\u305c\u6a19\u6e96\u8aa4\u5dee\u306e\u63a8\u5b9a\u304c\u305d\u3093\u306a\u306b\u91cd\u8981\u306a\u306e\u304b\uff1f"},"content":{"rendered":"\n<p>\u56e0\u679c\u63a8\u8ad6\u306e\u5206\u91ce\u3067\u306f\u3001\u89b3\u5bdf\u7814\u7a76\u304b\u3089\u30d0\u30a4\u30a2\u30b9\u306e\u5c11\u306a\u3044\u52b9\u679c\u3092\u63a8\u5b9a\u3059\u308b\u305f\u3081\u306b\u69d8\u3005\u306a\u624b\u6cd5\u304c\u7528\u3044\u3089\u308c\u308b\u3002\u305d\u306e\u4e2d\u3067\u3082\u3001Inverse Probability of Treatment Weighting\uff08IPTW\uff09\u306f\u3001\u5171\u5909\u91cf\u306e\u4e0d\u5747\u8861\u3092\u8abf\u6574\u3057\u3001\u6cbb\u7642\u7fa4\u3068\u5bfe\u7167\u7fa4\u3092\u300c\u6bd4\u8f03\u53ef\u80fd\u300d\u306b\u3059\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u3002IPTW\u3092\u9069\u7528\u3057\u305f\u5f8c\u306b\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u306f\u3088\u304f\u884c\u308f\u308c\u308b\u304c\u3001\u3053\u306e\u969b\u306b\u591a\u304f\u306e\u7814\u7a76\u8005\u304c\u898b\u843d\u3068\u3057\u304c\u3061\u306a\u3001\u3057\u304b\u3057\u6975\u3081\u3066\u91cd\u8981\u306a\u5074\u9762\u304c\u3042\u308b\u3002\u305d\u308c\u304c<strong>\u9069\u5207\u306a\u6a19\u6e96\u8aa4\u5dee\u306e\u63a8\u5b9a<\/strong>\u3067\u3042\u308b\u3002\u672c\u8a18\u4e8b\u3067\u306f\u3001IPTW\u3092\u7528\u3044\u305f\u56de\u5e30\u30e2\u30c7\u30eb\u306b\u304a\u3051\u308b\u6a19\u6e96\u8aa4\u5dee\u306e\u91cd\u8981\u6027\u3068\u3001\u305d\u306e\u9069\u5207\u306a\u8a08\u7b97\u65b9\u6cd5\u306b\u3064\u3044\u3066\u6398\u308a\u4e0b\u3052\u308b\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">IPTW\u56de\u5e30\u5206\u6790\u6982\u8981<\/h2>\n\n\n\n<p>IPTW\u306f\u3001\u5404\u500b\u4eba\u306e\u6cbb\u7642\u5272\u308a\u4ed8\u3051\u78ba\u7387\u306e\u9006\u6570\u3092\u7528\u3044\u3066\u91cd\u307f\u4ed8\u3051\u3092\u884c\u3046\u624b\u6cd5\u3067\u3042\u308b\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u89b3\u5bdf\u30c7\u30fc\u30bf\u306b\u304a\u3051\u308b\u5171\u5909\u91cf\u306e\u5206\u5e03\u3092\u5e73\u8861\u3055\u305b\u3001\u3042\u305f\u304b\u3082\u30e9\u30f3\u30c0\u30e0\u5316\u6bd4\u8f03\u8a66\u9a13\uff08RCT\uff09\u306e\u3088\u3046\u306b\u6cbb\u7642\u7fa4\u3068\u5bfe\u7167\u7fa4\u3092\u6bd4\u8f03\u3067\u304d\u308b\u72b6\u614b\u3092\u4f5c\u308a\u51fa\u3059\u3002<\/p>\n\n\n\n<p>IPTW\u3092\u9069\u7528\u3057\u305f\u5f8c\u3001\u901a\u5e38\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u91cd\u307f\u4ed8\u304d\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3059\u308b\u3002<\/p>\n\n\n\n<p>$$Y_i = \\beta_0 + \\beta_1 T_i + \\beta_2 X_i + \\epsilon_i$$<\/p>\n\n\n\n<p>\u3053\u3053\u3067\u3001$Y_i$\u306f\u30a2\u30a6\u30c8\u30ab\u30e0\u3001$T_i$\u306f\u6cbb\u7642\u5272\u308a\u4ed8\u3051\uff080\u307e\u305f\u306f1\uff09\u3001$X_i$\u306f\u5171\u5909\u91cf\u3001$\\epsilon_i$\u306f\u8aa4\u5dee\u9805\u3067\u3042\u308b\u3002\u305d\u3057\u3066\u3001\u3053\u306e\u56de\u5e30\u30e2\u30c7\u30eb\u306fIPTW\u306b\u3088\u3063\u3066\u8a08\u7b97\u3055\u308c\u305f\u91cd\u307f$w_i$\u3092\u7528\u3044\u3066\u63a8\u5b9a\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9069\u5207\u306a\u6a19\u6e96\u8aa4\u5dee\u8a08\u7b97\u306e\u5fc5\u8981\u6027<\/h2>\n\n\n\n<p>IPTW\u3092\u7528\u3044\u305f\u56de\u5e30\u30e2\u30c7\u30eb\u306b\u304a\u3044\u3066\u3001\u5358\u7d14\u306bOLS\uff08\u6700\u5c0f\u4e8c\u4e57\u6cd5\uff09\u306e\u6a19\u6e96\u8aa4\u5dee\u3092\u305d\u306e\u307e\u307e\u7528\u3044\u308b\u3053\u3068\u306f<strong>\u8aa4\u308a\u3067\u3042\u308b<\/strong>\u3002\u305d\u306e\u7406\u7531\u306f\u4ee5\u4e0b\u306e2\u70b9\u306b\u96c6\u7d04\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\u91cd\u307f\u306e\u63a8\u5b9a\u8aa4\u5dee\uff1a<\/strong> IPTW\u3067\u7528\u3044\u3089\u308c\u308b\u91cd\u307f\u306f\u3001\u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\uff08\u6cbb\u7642\u5272\u308a\u4ed8\u3051\u78ba\u7387\uff09\u3092\u63a8\u5b9a\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u5f97\u3089\u308c\u308b\u3002\u3053\u306e\u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\u306e\u63a8\u5b9a\u306b\u306f\u7d71\u8a08\u7684\u306a\u8aa4\u5dee\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u8aa4\u5dee\u306f\u6700\u7d42\u7684\u306a\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u63a8\u5b9a\u5024\u306e\u4e0d\u78ba\u5b9f\u6027\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3002\u3057\u304b\u3057\u3001\u6a19\u6e96\u7684\u306a\u56de\u5e30\u5206\u6790\u306e\u6a19\u6e96\u8aa4\u5dee\u306f\u3001\u3053\u306e\u91cd\u307f\u306e\u63a8\u5b9a\u8aa4\u5dee\u3092\u8003\u616e\u3057\u3066\u3044\u306a\u3044\u3002<\/li>\n\n\n\n<li><strong>\u7570\u306a\u3063\u305f\u5206\u6563\u69cb\u9020\uff1a<\/strong> IPTW\u306b\u3088\u3063\u3066\u91cd\u307f\u4ed8\u3051\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306f\u3001\u5143\u306e\u30c7\u30fc\u30bf\u3068\u306f\u7570\u306a\u308b\u5206\u6563\u69cb\u9020\u3092\u6301\u3064\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002\u7279\u306b\u3001\u6975\u7aef\u306a\u91cd\u307f\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u305d\u308c\u304c\u6a19\u6e96\u8aa4\u5dee\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3053\u3068\u304c\u3042\u308b\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u7406\u7531\u304b\u3089\u3001\u4e00\u822c\u7684\u306a\u7d71\u8a08\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u51fa\u529b\u3059\u308b\u6a19\u6e96\u8aa4\u5dee\u306f\u3001IPTW\u3092\u7528\u3044\u305f\u56de\u5e30\u30e2\u30c7\u30eb\u306b\u304a\u3044\u3066\u306f\u904e\u5c0f\u8a55\u4fa1\u3055\u308c\u308b\u50be\u5411\u304c\u3042\u308a\u3001\u7d50\u679c\u3068\u3057\u3066\u4fe1\u983c\u533a\u9593\u304c\u72ed\u304f\u306a\u308a\u3001\u7d71\u8a08\u7684\u306b\u6709\u610f\u3067\u306f\u306a\u3044\u306f\u305a\u306e\u6cbb\u7642\u52b9\u679c\u304c\u6709\u610f\u3067\u3042\u308b\u3068\u8aa4\u3063\u3066\u5224\u65ad\u3055\u308c\u308b\u30ea\u30b9\u30af\u304c\u3042\u308b\u3002\u3053\u308c\u306f\u3001\u7814\u7a76\u7d50\u679c\u306e\u4fe1\u983c\u6027\u3092\u8457\u3057\u304f\u640d\u306a\u3046\u3053\u3068\u306b\u3064\u306a\u304c\u308b\u3002<\/p>\n\n\n\n<p>\u9069\u5207\u306a\u6a19\u6e96\u8aa4\u5dee\u3092\u63a8\u5b9a\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u4e3b\u306b\u4ee5\u4e0b\u306e\u624b\u6cd5\u304c\u7528\u3044\u3089\u308c\u308b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30ed\u30d0\u30b9\u30c8\u6a19\u6e96\u8aa4\u5dee\uff08Robust Standard Errors \/ Huber-White Standard Errors\uff09\uff1a<\/strong> \u3053\u308c\u306f\u3001\u7570\u306a\u3063\u305f\u5206\u6563\u69cb\u9020\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u6a19\u6e96\u8aa4\u5dee\u306e\u63a8\u5b9a\u65b9\u6cd5\u3067\u3042\u308b\u3002\u91cd\u307f\u4ed8\u3051\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u3082\u9069\u7528\u53ef\u80fd\u3067\u3042\u308a\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u9811\u5065\u6027\u3092\u63d0\u4f9b\u3059\u308b\u3002<\/li>\n\n\n\n<li><strong>\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u6cd5\uff08Bootstrap\uff09\uff1a<\/strong> \u30c7\u30fc\u30bf\u304b\u3089\u53cd\u5fa9\u7684\u306b\u30ea\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u30d1\u30e9\u30e1\u30fc\u30bf\u63a8\u5b9a\u91cf\u306e\u6a19\u672c\u5206\u5e03\u3092\u7d4c\u9a13\u7684\u306b\u63a8\u5b9a\u3057\u3001\u305d\u3053\u304b\u3089\u6a19\u6e96\u8aa4\u5dee\u3092\u8a08\u7b97\u3059\u308b\u65b9\u6cd5\u3067\u3042\u308b\u3002\u91cd\u307f\u306e\u63a8\u5b9a\u904e\u7a0b\u3082\u8003\u616e\u306b\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u3088\u308a\u6b63\u78ba\u306a\u6a19\u6e96\u8aa4\u5dee\u3092\u63d0\u4f9b\u3059\u308b\u3002<\/li>\n\n\n\n<li><strong>\u30b5\u30f3\u30c9\u30a4\u30c3\u30c1\u5206\u6563\u63a8\u5b9a\u5668\uff08Sandwich Variance Estimator\uff09\uff1a<\/strong> \u7279\u306b\u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\u306e\u63a8\u5b9a\u3092\u8003\u616e\u3057\u305f\u3088\u308a\u6d17\u7df4\u3055\u308c\u305f\u65b9\u6cd5\u3067\u3042\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<div id=\"biost-3066639370\" 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\u3068R\u8a08\u7b97\u4f8b<\/h2>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u3001\u67b6\u7a7a\u306e\u30c7\u30fc\u30bf\u3092\u7528\u3044\u3066\u3001R\u3067\u306eIPTW\u56de\u5e30\u3068\u6a19\u6e96\u8aa4\u5dee\u306e\u8a08\u7b97\u4f8b\u3092\u793a\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8aad\u307f\u8fbc\u307f (\u521d\u56de\u306e\u307f)\n# install.packages(\"cobalt\")\n# install.packages(\"WeightIt\")\n# install.packages(\"survey\")\n\nlibrary(cobalt)   # \u30d0\u30e9\u30f3\u30b9\u30c1\u30a7\u30c3\u30af\u7528\nlibrary(WeightIt) # IPTW\u91cd\u307f\u8a08\u7b97\u7528\nlibrary(survey)   # \u8abf\u67fb\u30c7\u30fc\u30bf\u5206\u6790\u7528\uff08\u30ed\u30d0\u30b9\u30c8\u6a19\u6e96\u8aa4\u5dee\u8a08\u7b97\u306b\u4fbf\u5229\uff09\n\n# \u30c7\u30fc\u30bf\u306e\u751f\u6210 (\u4eee\u60f3\u30c7\u30fc\u30bf)\nset.seed(123)\nn &lt;- 1000\n\n# \u307e\u305aX\u3068T\u3092\u751f\u6210\nX &lt;- rnorm(n)\nT &lt;- rbinom(n, 1, plogis(0.5 * X))\n\n# \u6b21\u306bY\u3092\u751f\u6210\uff08T\u3068X\u306b\u4f9d\u5b58\uff09\nY &lt;- 0.5 * T + 0.3 * X + rnorm(n, sd = 2)\n\n# \u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u307e\u3068\u3081\u308b\ndata &lt;- data.frame(X = X, T = T, Y = Y)\n\n# 1. \u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\u306e\u63a8\u5b9a\u3068IPTW\u91cd\u307f\u306e\u8a08\u7b97\n# T\u3092Y\u306b\u3001X\u3092\u5171\u5909\u91cf\u3068\u3057\u3066\u3001\u4e8c\u9805\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u3067\u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\u3092\u63a8\u5b9a\n# WeightIt\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u7528\nw.out &lt;- weightit(T ~ X, data = data, method = \"glm\", estimand = \"ATE\")\n\n# \u91cd\u307f\u306e\u53d6\u5f97\ndata$weights &lt;- w.out$weights\n\n# \u91cd\u307f\u4ed8\u3051\u5f8c\u306e\u5171\u5909\u91cf\u306e\u30d0\u30e9\u30f3\u30b9\u30c1\u30a7\u30c3\u30af (\u30aa\u30d7\u30b7\u30e7\u30f3)\nbal.tab(w.out, stats = c(\"m\", \"v\"))\n\n# 2. IPTW\u91cd\u307f\u3092\u7528\u3044\u305f\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u69cb\u7bc9\n\n# \u901a\u5e38\u306elm\u95a2\u6570\u3092\u7528\u3044\u305f\u56de\u5e30\u30e2\u30c7\u30eb (\u6a19\u6e96\u8aa4\u5dee\u304c\u4e0d\u9069\u5207)\n# \u3053\u306e\u6a19\u6e96\u8aa4\u5dee\u306f\u91cd\u307f\u306e\u63a8\u5b9a\u8aa4\u5dee\u3092\u8003\u616e\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u904e\u5c0f\u8a55\u4fa1\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\nfit_lm &lt;- lm(Y ~ T + X, data = data, weights = weights)\nsummary(fit_lm)\n\n# 3. \u9069\u5207\u306a\u6a19\u6e96\u8aa4\u5dee\u306e\u8a08\u7b97\n\n# \u65b9\u6cd51: survey\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u7528\u3044\u305f\u30ed\u30d0\u30b9\u30c8\u6a19\u6e96\u8aa4\u5dee\n# survey\u30c7\u30b6\u30a4\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\n# id = ~1 \u306f\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u304c\u306a\u3044\u3053\u3068\u3092\u793a\u3059\n# weights = ~weights \u306fIPTW\u91cd\u307f\u3092\u6307\u5b9a\n# data = data \u306f\u4f7f\u7528\u3059\u308b\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\ndesign_obj &lt;- svydesign(id = ~1, weights = ~weights, data = data)\n\n# survey\u30d1\u30c3\u30b1\u30fc\u30b8\u306esvyglm\u95a2\u6570\u3067\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u63a8\u5b9a\n# family = gaussian() \u306f\u9023\u7d9a\u30a2\u30a6\u30c8\u30ab\u30e0\u306e\u5834\u5408\nfit_svyglm &lt;- svyglm(Y ~ T + X, design = design_obj, family = gaussian())\nsummary(fit_svyglm)\n\n# \u65b9\u6cd52: \u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u6cd5 (\u4f8b)\n# \u3088\u308a\u8a08\u7b97\u30b3\u30b9\u30c8\u304c\u304b\u304b\u308b\u304c\u3001\u3088\u308a\u6b63\u78ba\u306a\u6a19\u6e96\u8aa4\u5dee\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u304c\u3042\u308b\n# \u3053\u3053\u3067\u306f\u7c21\u5358\u306a\u4f8b\u3092\u793a\u3059\u304c\u3001\u5b9f\u969b\u306b\u306f\u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\u306e\u63a8\u5b9a\u304b\u3089\u542b\u3081\u3066\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u3092\u884c\u3046\n# boot\u30d1\u30c3\u30b1\u30fc\u30b8\u306a\u3069\u3092\u7528\u3044\u308b\u3068\u3088\u308a\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u308b\n\n# \u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u95a2\u6570\u306e\u5b9a\u7fa9\nbootstrap_fn &lt;- function(data, indices) {\n  d_boot &lt;- data&#91;indices, ]\n  \n  # \u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u30b5\u30f3\u30d7\u30eb\u3067\u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\u3068\u91cd\u307f\u3092\u518d\u8a08\u7b97\n  w.out_boot &lt;- weightit(T ~ X, data = d_boot, method = \"glm\", estimand = \"ATE\")\n  d_boot$weights &lt;- w.out_boot$weights\n  \n  # \u91cd\u307f\u4ed8\u304d\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u63a8\u5b9a\n  fit_boot &lt;- lm(Y ~ T + X, data = d_boot, weights = weights)\n  coef(fit_boot)&#91;\"T\"] # T\u306e\u4fc2\u6570\u3092\u8fd4\u3059\n}\n\n# \u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u306e\u5b9f\u884c\nlibrary(boot)\nboot_results &lt;- boot(data = data, statistic = bootstrap_fn, R = 1000)\n\n# T\u306e\u4fc2\u6570\u306e\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u6a19\u6e96\u8aa4\u5dee\nsd(boot_results$t)\n# 95%\u4fe1\u983c\u533a\u9593\nboot.ci(boot_results, type = \"perc\", index = 1)\n<\/code><\/pre>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> # \u3053\u306e\u6a19\u6e96\u8aa4\u5dee\u306f\u91cd\u307f\u306e\u63a8\u5b9a\u8aa4\u5dee\u3092\u8003\u616e\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u904e\u5c0f\u8a55\u4fa1\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\n> fit_lm &lt;- lm(Y ~ T + X, data = data, weights = weights)\n> summary(fit_lm)\n\nCall:\nlm(formula = Y ~ T + X, data = data, weights = weights)\n\nWeighted Residuals:\n    Min      1Q  Median      3Q     Max \n-8.4323 -1.9183  0.0264  1.8326 10.3289 \n\nCoefficients:\n             Estimate Std. Error t value Pr(>|t|)    \n(Intercept) 0.0008543  0.0897755   0.010  0.99241    \nT           0.3809942  0.1268489   3.004  0.00274 ** \nX           0.3091287  0.0637750   4.847 1.45e-06 ***\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: 2.836 on 997 degrees of freedom\nMultiple R-squared:  0.03166,   Adjusted R-squared:  0.02972 \nF-statistic:  16.3 on 2 and 997 DF,  p-value: 1.085e-07\n\n> \n\n> # \u65b9\u6cd51: survey\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u7528\u3044\u305f\u30ed\u30d0\u30b9\u30c8\u6a19\u6e96\u8aa4\u5dee\n\n> summary(fit_svyglm)\n\nCall:\nsvyglm(formula = Y ~ T + X, design = design_obj, family = gaussian())\n\nSurvey design:\nsvydesign(id = ~1, weights = ~weights, data = data)\n\nCoefficients:\n             Estimate Std. Error t value Pr(>|t|)    \n(Intercept) 0.0008543  0.0855744   0.010  0.99204    \nT           0.3809942  0.1305390   2.919  0.00359 ** \nX           0.3091287  0.0638416   4.842 1.49e-06 ***\n---\nSignif. codes:  0 \u2018***\u2019 0.001 \u2018**\u2019 0.01 \u2018*\u2019 0.05 \u2018.\u2019 0.1 \u2018 \u2019 1\n\n(Dispersion parameter for gaussian family taken to be 4.014566)\n\nNumber of Fisher Scoring iterations: 2\n\n> \n\n> # \u65b9\u6cd52: \u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u6cd5 (\u4f8b)\n> # \u3088\u308a\u8a08\u7b97\u30b3\u30b9\u30c8\u304c\u304b\u304b\u308b\u304c\u3001\u3088\u308a\u6b63\u78ba\u306a\u6a19\u6e96\u8aa4\u5dee\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u304c\u3042\u308b\n\n> # T\u306e\u4fc2\u6570\u306e\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u6a19\u6e96\u8aa4\u5dee\n> sd(boot_results$t)\n&#91;1] 0.1392221\n> # 95%\u4fe1\u983c\u533a\u9593\n> boot.ci(boot_results, type = \"perc\", index = 1)\nBOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS\nBased on 1000 bootstrap replicates\n\nCALL : \nboot.ci(boot.out = boot_results, type = \"perc\", index = 1)\n\nIntervals : \nLevel     Percentile     \n95%   ( 0.1067,  0.6557 )  \nCalculations and Intervals on Original Scale\n> <\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306eR\u30b3\u30fc\u30c9\u4f8b\u3067\u306f\u3001<code>lm<\/code>\u95a2\u6570\u3092\u7528\u3044\u305f\u5834\u5408\u306e\u6a19\u6e96\u8aa4\u5dee\uff080.127\uff09\u3068\u3001<code>survey<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e<code>svyglm<\/code>\u3092\u7528\u3044\u305f\u5834\u5408\u306e\u30ed\u30d0\u30b9\u30c8\u6a19\u6e96\u8aa4\u5dee\uff080.131\uff09\u306e\u9055\u3044\u304c\u78ba\u8a8d\u3067\u304d\u308b\u3002<code>svyglm<\/code>\u3092\u7528\u3044\u305f\u65b9\u304c\u3001\u4e00\u822c\u7684\u306b\u6a19\u6e96\u8aa4\u5dee\u304c\u5927\u304d\u304f\u306a\u308b\u50be\u5411\u304c\u3042\u308b\u3002\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u306f\u3088\u308a\u8a08\u7b97\u91cf\u304c\u591a\u3044\u304c\u3001\u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\u306e\u63a8\u5b9a\u8aa4\u5dee\u307e\u3067\u8003\u616e\u3057\u305f\u6a19\u6e96\u8aa4\u5dee\uff080.139\uff09\u3092\u8a08\u7b97\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u679c\u89e3\u91c8\u4f8b<\/h3>\n\n\n\n<p>IPTW\u3092\u7528\u3044\u305f\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u7d50\u679c\u3092\u89e3\u91c8\u3059\u308b\u969b\u306b\u306f\u3001\u63a8\u5b9a\u3055\u308c\u305f\u6cbb\u7642\u52b9\u679c\u306e\u4fc2\u6570\uff08$\\beta_1$\uff09\u3060\u3051\u3067\u306a\u304f\u3001\u305d\u306e\u6a19\u6e96\u8aa4\u5dee\u3068\u305d\u308c\u306b\u57fa\u3065\u3044\u3066\u8a08\u7b97\u3055\u308c\u305fp\u5024\u3001\u305d\u3057\u3066\u4fe1\u983c\u533a\u9593\u3092\u7dcf\u5408\u7684\u306b\u8003\u616e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u4e0a\u8a18\u306e<code>svyglm<\/code>\u306e\u7d50\u679c\u3067\u3001\u6cbb\u7642\u52b9\u679c\uff08<code>T<\/code>\u306e\u4fc2\u6570\uff09\u304c0.381\u3001\u6a19\u6e96\u8aa4\u5dee\u304c0.131\u3067\u3042\u3063\u305f\u3002\u3053\u306e\u5834\u5408\u300195%\u4fe1\u983c\u533a\u9593\u306f\u304a\u304a\u3088\u305d$[0.381 &#8211; 1.96 \\times 0.131, 0.381 + 1.96 \\times 0.131] = [0.124, 0.638]$ \u3068\u306a\u308b\u3002<\/p>\n\n\n\n<p>\u3082\u3057\u4e0d\u9069\u5207\u306a\u6a19\u6e96\u8aa4\u5dee\uff08\u4f8b\u3048\u30700.127\uff09\u3092\u7528\u3044\u3066\u3044\u305f\u5834\u5408\u3001\u4fe1\u983c\u533a\u9593\u306f$[0.381 &#8211; 1.96 \\times 0.127, 0.381 + 1.96 \\times 0.127] = [0.132, 0.630]$ \u3068\u306a\u308a\u3001\u3088\u308a\u72ed\u3044\u533a\u9593\u304c\u7b97\u51fa\u3055\u308c\u3066\u3057\u307e\u3046\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u672c\u6765\u306f\u7d71\u8a08\u7684\u6709\u610f\u6027\u304c\u306a\u3044\u53ef\u80fd\u6027\u306e\u3042\u308b\u52b9\u679c\u304c\u3001\u904e\u5270\u306b\u6709\u610f\u3067\u3042\u308b\u3068\u89e3\u91c8\u3055\u308c\u308b\u30ea\u30b9\u30af\u304c\u751f\u3058\u308b\u3002<\/p>\n\n\n\n<p>\u9069\u5207\u306a\u6a19\u6e96\u8aa4\u5dee\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u63a8\u5b9a\u3055\u308c\u305f\u6cbb\u7642\u52b9\u679c\u304c\u5076\u7136\u306b\u3088\u308b\u3082\u306e\u3067\u306f\u306a\u3044\u304b\u3001\u3042\u308b\u3044\u306f\u305d\u306e\u52b9\u679c\u306e\u4e0d\u78ba\u5b9f\u6027\u304c\u3069\u306e\u7a0b\u5ea6\u5927\u304d\u3044\u306e\u304b\u3092\u3088\u308a\u6b63\u78ba\u306b\u628a\u63e1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u3053\u308c\u306f\u3001\u7814\u7a76\u7d50\u679c\u306e\u9811\u5065\u6027\u3068\u4fe1\u983c\u6027\u3092\u78ba\u4fdd\u3059\u308b\u305f\u3081\u306b\u4e0d\u53ef\u6b20\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>IPTW\u3092\u7528\u3044\u305f\u56de\u5e30\u30e2\u30c7\u30eb\u306f\u3001\u89b3\u5bdf\u7814\u7a76\u306b\u304a\u3051\u308b\u56e0\u679c\u52b9\u679c\u306e\u63a8\u5b9a\u306b\u975e\u5e38\u306b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u3002\u3057\u304b\u3057\u3001\u305d\u306e\u529b\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3057\u3001\u8aa4\u3063\u305f\u7d50\u8ad6\u3092\u5c0e\u304b\u306a\u3044\u305f\u3081\u306b\u306f\u3001<strong>\u6a19\u6e96\u8aa4\u5dee\u306e\u9069\u5207\u306a\u63a8\u5b9a\u304c\u4e0d\u53ef\u6b20\u3067\u3042\u308b<\/strong>\u3002\u30d7\u30ed\u30da\u30f3\u30b7\u30c6\u30a3\u30b9\u30b3\u30a2\u306e\u63a8\u5b9a\u8aa4\u5dee\u3084\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u5909\u66f4\u3092\u8003\u616e\u3057\u306a\u3044\u6a19\u6e96\u8aa4\u5dee\u306f\u3001\u5206\u6790\u7d50\u679c\u306e\u4fe1\u983c\u6027\u3092\u640d\u306a\u3046\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u30ed\u30d0\u30b9\u30c8\u6a19\u6e96\u8aa4\u5dee\u3084\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u6cd5\u306a\u3069\u306e\u9069\u5207\u306a\u624b\u6cd5\u3092\u7528\u3044\u3066\u6a19\u6e96\u8aa4\u5dee\u3092\u8a08\u7b97\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u6b63\u78ba\u3067\u4fe1\u983c\u6027\u306e\u9ad8\u3044\u56e0\u679c\u52b9\u679c\u306e\u63a8\u5b9a\u304c\u53ef\u80fd\u3068\u306a\u308b\u3002\u7814\u7a76\u8005\u3068\u3057\u3066\u306f\u3001\u3053\u308c\u3089\u306e\u91cd\u8981\u306a\u5074\u9762\u3092\u7406\u89e3\u3057\u3001\u5206\u6790\u306b\u9069\u5207\u306b\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3067\u3001\u3088\u308a\u8cea\u306e\u9ad8\u3044\u7814\u7a76\u6210\u679c\u3092\u751f\u307f\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3060\u308d\u3046\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u679c\u63a8\u8ad6\u306e\u5206\u91ce\u3067\u306f\u3001\u89b3\u5bdf\u7814\u7a76\u304b\u3089\u30d0\u30a4\u30a2\u30b9\u306e\u5c11\u306a\u3044\u52b9\u679c\u3092\u63a8\u5b9a\u3059\u308b\u305f\u3081\u306b\u69d8\u3005\u306a\u624b\u6cd5\u304c\u7528\u3044\u3089\u308c\u308b\u3002\u305d\u306e\u4e2d\u3067\u3082\u3001Inverse Probability of Treatment Weighting\uff08IPTW\uff09\u306f\u3001\u5171\u5909\u91cf\u306e\u4e0d\u5747\u8861\u3092 [&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":[7],"tags":[],"class_list":["post-4394","post","type-post","status-publish","format-standard","hentry","category-iptw-"],"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\/4394","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=4394"}],"version-history":[{"count":5,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4394\/revisions"}],"predecessor-version":[{"id":4401,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4394\/revisions\/4401"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=4394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=4394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=4394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}