{"id":4697,"date":"2026-08-09T08:27:14","date_gmt":"2026-08-08T23:27:14","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/?p=4697"},"modified":"2026-08-09T08:27:14","modified_gmt":"2026-08-08T23:27:14","slug":"time-dependent-covariates-in-cox-regression-with-r-a-complete-guide-to-handling-repeated-measures-treatment-changes-and-the-tmerge-function","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/time-dependent-covariates-in-cox-regression-with-r-a-complete-guide-to-handling-repeated-measures-treatment-changes-and-the-tmerge-function\/","title":{"rendered":"\u3010R\u8a00\u8a9e\u3011\u30ab\u30eb\u30c6\u306e\u300c\u7e70\u308a\u8fd4\u3057\u6e2c\u5b9a\u30c7\u30fc\u30bf\u300d\u3084\u300c\u9014\u4e2d\u306e\u6cbb\u7642\u5909\u66f4\u300d\u3092\u305d\u306e\u307e\u307eCox\u56de\u5e30\u306b\u5165\u308c\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\u3068tmerge\u95a2\u6570\u306e\u5b8c\u5168\u30ac\u30a4\u30c9"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u7814\u7a76\u8005<\/strong>: \u89b3\u5bdf\u671f\u9593\u4e2d\u306b\u6bce\u6708\u6e2c\u5b9a\u3057\u305f\u8840\u5727\u306e\u5909\u5316\u3084\u3001\u8ffd\u8de1\u9014\u4e2d\u3067\u8ffd\u52a0\u3057\u305f\u6297\u304c\u3093\u5264\u306e\u5f71\u97ff\u3092\u305d\u306e\u307e\u307eCox\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u5171\u5909\u91cf\uff081\/0\uff09\u3068\u3057\u3066\u6295\u5165\u3057\u3066\u3082\u5927\u4e08\u592b\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u7d71\u8a08ER<\/strong>: \u3061\u3087\u3063\u3068\u5f85\u3063\u3066\u304f\u3060\u3055\u3044\uff01\u4f55\u306e\u6c17\u306a\u3057\u306b\u6271\u304a\u3046\u3068\u3057\u3066\u3044\u308b\u305d\u306e\u30c7\u30fc\u30bf\u306f\u3001\u7d71\u8a08\u5b66\u3067<strong>\u300e\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\uff08Time-dependent covariate\uff09\u300f<\/strong>\u3068\u547c\u3070\u308c\u308b\u8d85\u9ad8\u5ea6\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u3067\u3059\u3002\u601d\u3044\u8fbc\u307f\u3084\u76f4\u611f\u3067\u666e\u901a\u306eCox\u56de\u5e30\u306b\u5165\u308c\u3066\u3057\u307e\u3046\u3068\u300c\u4e0d\u6b7b\u6642\u9593\u30d0\u30a4\u30a2\u30b9\u300d\u304c\u751f\u3058\u3001\u8ad6\u6587\u304c\u4e00\u767a\u3067\u5373\u5374\u4e0b\uff08Reject\uff09\u3055\u308c\u307e\u3059\uff01\u6b63\u3057\u304f\u52c9\u5f37\u3057\u3066\u9069\u5207\u306a\u30c7\u30fc\u30bf\u5909\u63db\uff08<code>tmerge<\/code>\uff09\u3092\u884c\u3044\u3001\u6b63\u3057\u304f\u89e3\u6790\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n<\/blockquote>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">\u81e8\u5e8a\u7814\u7a76\u3084\u30ea\u30a2\u30eb\u30ef\u30fc\u30eb\u30c9\u30c7\u30fc\u30bf\uff08RWD\uff09\u306e\u89e3\u6790\u306b\u304a\u3044\u3066\u3001\u96fb\u5b50\u30ab\u30eb\u30c6\u3084\u30ec\u30b8\u30b9\u30c8\u30ea\u304b\u3089\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u56e0\u5b50\u3092\u751f\u5b58\u6642\u9593\u89e3\u6790\uff08Cox\u6bd4\u4f8b\u30cf\u30b6\u30fc\u30c9\u30e2\u30c7\u30eb\uff09\u306b\u7d44\u307f\u8fbc\u3082\u3046\u3068\u8003\u3048\u305f\u3053\u3068\u306f\u306a\u3044\u3060\u308d\u3046\u304b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u300c\u8ffd\u8de1\u671f\u9593\u4e2d\u306b\u6bce\u6708\u6e2c\u5b9a\u3057\u305f\u8840\u5727\u3084\u8840\u6e05\u30de\u30fc\u30ab\u30fc\uff08CRP\u3084HbA1c\u306a\u3069\uff09\u306e\u52d5\u7684\u306a\u5909\u5316\u3092\u8003\u616e\u3057\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u89b3\u5bdf\u958b\u59cb\u304b\u30896\u30f6\u6708\u76ee\u306b\u3001\u526f\u4f5c\u7528\u306e\u51fa\u73fe\u3084\u75c5\u52e2\u9032\u884c\u306b\u3088\u3063\u3066\u6297\u304c\u3093\u5264\u3092\u8ffd\u52a0\u30fb\u5909\u66f4\u3057\u305f\u5f71\u97ff\u3092\u6b63\u3057\u304f\u8a55\u4fa1\u3057\u305f\u3044\u300d<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u81e8\u5e8a\u7684\u306b\u4fa1\u5024\u306e\u3042\u308b\u30c7\u30fc\u30bf\u3092\u4f59\u3059\u3053\u3068\u306a\u304f\u30e2\u30c7\u30eb\u306b\u5165\u308c\u305f\u3044\u300d\u3068\u3044\u3046\u7740\u773c\u70b9\u81ea\u4f53\u306f\u975e\u5e38\u306b\u7d20\u6674\u3089\u3057\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3057\u304b\u3057\u3001<strong>\u76f4\u611f\u3084\u601d\u3044\u8fbc\u307f\u3060\u3051\u3067\u3001\u3053\u308c\u3089\u306e\u300c\u8ffd\u8de1\u9014\u4e2d\u306b\u6e2c\u5b9a\u30fb\u767a\u751f\u3057\u305f\u30c7\u30fc\u30bf\u300d\u3092\u305d\u306e\u307e\u307e\u901a\u5e38\u306eCox\u56de\u5e30\u306e\u5171\u5909\u91cf\uff08\u4f8b: \u65b0\u85ac\u4f7f\u7528\uff1d1, \u672a\u4f7f\u7528\uff1d0\uff09\u3068\u3057\u3066\u6295\u5165\u3057\u3066\u3057\u307e\u3046\u306e\u306f\u6975\u3081\u3066\u5371\u967a\u3067\u3042\u308b\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6765\u3067\u3042\u308c\u3070\u3001\u3053\u3046\u3057\u305f\u8907\u96d1\u306a\u7e26\u6301\u3061\u30c7\u30fc\u30bf\u3084\u8ffd\u8de1\u9014\u4e2d\u306e\u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u306f\u3001\u5c02\u9580\u306e\u751f\u7269\u7d71\u8a08\u5bb6\uff08\u30d0\u30a4\u30aa\u30b9\u30bf\u30c6\u30a3\u30b9\u30c6\u30a3\u30b7\u30e3\u30f3\uff09\u306b\u76f8\u8ac7\u3057\u3066\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3059\u3079\u304d\u9818\u57df\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3060\u304c\u3001\u65e5\u672c\u306e\u81e8\u5e8a\u7814\u7a76\u306e\u73fe\u72b6\u3067\u306f\u3001\u591a\u5fd9\u306a\u533b\u5e2b\u3084\u533b\u7642\u5f93\u4e8b\u8005\u304c\u81ea\u529b\u3067\u89e3\u6790\u306b\u53d6\u308a\u7d44\u307e\u3056\u308b\u3092\u5f97\u306a\u3044\u30b1\u30fc\u30b9\u304c\u4f9d\u7136\u3068\u3057\u3066\u591a\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3060\u304b\u3089\u3053\u305d\u3001<strong>\u300c\u30ce\u30ea\u3084\u601d\u3044\u8fbc\u307f\u3067\u89e3\u6790\u3092\u9032\u3081\u308b\u300d\u306e\u306f\u7d76\u5bfe\u306b\u3084\u3081\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u81ea\u5206\u304c\u6271\u304a\u3046\u3068\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u304c\u7d71\u8a08\u5b66\u7684\u306b\u3069\u306e\u3088\u3046\u306a\u6027\u8cea\u3092\u6301\u3063\u3066\u3044\u308b\u306e\u304b\u3092\u6b63\u3057\u304f\u52c9\u5f37\u3057\u3001\u9069\u5207\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u3078\u5909\u63db\u3057\u305f\u4e0a\u3067\u89e3\u6790\u306b\u6311\u3080\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u8a18\u4e8b\u3067\u306f\u3001\u521d\u5fc3\u8005\u304c\u6700\u3082\u9665\u308a\u3084\u3059\u3044\u300c\u4e0d\u6b7b\u6642\u9593\u30d0\u30a4\u30a2\u30b9\uff08Immortal Time Bias\uff09\u300d\u306e\u6050\u6016\u3068\u3001\u305d\u308c\u3092\u89e3\u6d88\u3059\u308b\u305f\u3081\u306eR\u306e\u795e\u95a2\u6570 <strong><code>survival::tmerge()<\/code><\/strong> \u3092\u4f7f\u3063\u305f\u6642\u9593\u4f9d\u5b58Cox\u56de\u5e30\u306e\u5b9f\u88c5\u624b\u9806\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3059\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u306a\u305c\u300c\u901a\u5e38\u306eCox\u56de\u5e30\u300d\u306b\u305d\u306e\u307e\u307e\u5165\u308c\u3066\u306f\u3044\u3051\u306a\u3044\u306e\u304b\uff1f\uff08\u4e0d\u6b7b\u6642\u9593\u30d0\u30a4\u30a2\u30b9\u306e\u6050\u6016\uff09<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ffd\u8de1\u9014\u4e2d\u306b\u767a\u751f\u3059\u308b\u30c7\u30fc\u30bf\u3092\u666e\u901a\u306e\u5171\u5909\u91cf\u3068\u3057\u3066\u30e2\u30c7\u30eb\u306b\u5165\u308c\u3066\u306f\u3044\u3051\u306a\u3044\u6700\u5927\u306e\u7406\u7531\u306f\u3001\u7d71\u8a08\u5b66\u306b\u304a\u3051\u308b\u300c\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\u300d\u306e\u30eb\u30fc\u30eb\u3092\u7121\u8996\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u81f4\u547d\u7684\u306a\u30d0\u30a4\u30a2\u30b9\u304c\u767a\u751f\u3059\u308b\u305f\u3081\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u6642\u9593\u56fa\u5b9a\u5171\u5909\u91cf\uff08Time-fixed\uff09\u3068\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\uff08Time-dependent\uff09\u306e\u9055\u3044<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u306f\u5909\u6570\u306e\u5b9a\u7fa9\u3092\u6574\u7406\u3057\u3088\u3046\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6642\u9593\u56fa\u5b9a\u5171\u5909\u91cf\uff08Time-fixed covariate\uff09<\/strong>:\u89b3\u5bdf\u958b\u59cb\u6642\u70b9\uff08\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3: $t = 0$\uff09\u3067\u4e00\u6c7a\u6c7a\u5b9a\u3055\u308c\u3001\u8ffd\u8de1\u671f\u9593\u4e2d\u306b\u5909\u5316\u3057\u306a\u3044\u5909\u6570\uff08\u4f8b: \u6027\u5225\u3001\u767b\u9332\u6642\u306e\u5e74\u9f62\u3001\u907a\u4f1d\u5b50\u5909\u7570\u306e\u6709\u7121\u306a\u3069\uff09\u3002<\/li>\n\n\n\n<li><strong>\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\uff08Time-dependent covariate\uff09<\/strong>:\u89b3\u5bdf\u958b\u59cb\u5f8c\u306e\u6642\u9593\u7d4c\u904e\u306b\u4f34\u3063\u3066\u3001\u5024\u3084\u30b9\u30c6\u30fc\u30bf\u30b9\u304c\u52d5\u7684\u306b\u5909\u5316\u3059\u308b\u5909\u6570\uff08\u4f8b: \u8ffd\u8de1\u4e2d\u306e\u8840\u5727\u5024\u3001\u8ffd\u8de1\u9014\u4e2d\u3067\u306e\u4f75\u7528\u7642\u6cd5\u306e\u958b\u59cb\u3001\u6709\u5bb3\u4e8b\u8c61\u306e\u767a\u75c7\u306a\u3069\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u5e38\u306eCox\u56de\u5e30\uff08<code>coxph(Surv(time, status) ~ x)<\/code>\uff09\u306f\u3001\u3059\u3079\u3066\u306e\u5171\u5909\u91cf\u304c\u300c\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u6642\u70b9\uff08$t = 0$\uff09\u3067\u56fa\u5b9a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\uff08\u6642\u9593\u56fa\u5b9a\uff09\u300d\u3092\u5927\u524d\u63d0\u3068\u3057\u3066\u69cb\u7bc9\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u8ad6\u6587\u304c\u5373\u5374\u4e0b\u3055\u308c\u308b\u300c\u4e0d\u6b7b\u6642\u9593\u30d0\u30a4\u30a2\u30b9\uff08Immortal Time Bias\uff09\u300d\u3068\u306f\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u3048\u3070\u3001\u300c\u304c\u3093\u60a3\u8005\u306e\u751f\u5b58\u7387\u306b\u5bfe\u3059\u308b\u65b0\u85acA\u306e\u52b9\u679c\u300d\u3092\u691c\u8a3c\u3059\u308b\u7814\u7a76\u3092\u8003\u3048\u3066\u307f\u3088\u3046\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u60a3\u8005\u306b\u3088\u3063\u3066\u306f\u3001\u8a3a\u65ad\u76f4\u5f8c\uff08$t = 0$\uff09\u304b\u3089\u65b0\u85acA\u3092\u98f2\u3080\u4eba\u3082\u3044\u308c\u3070\u3001\u75c5\u72b6\u304c\u60aa\u5316\u3057\u305f\u8ffd\u8de16\u30f6\u6708\u76ee\u306b\u521d\u3081\u3066\u65b0\u85acA\u3092\u958b\u59cb\u3059\u308b\u4eba\u3082\u3044\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067\u3001\u8ffd\u8de16\u30f6\u6708\u76ee\u306b\u65b0\u85ac\u3092\u958b\u59cb\u3057\u305f\u60a3\u8005\u3092\u3001\u4f55\u306e\u6c17\u306a\u3057\u306b\u300c\u6700\u521d\u304b\u3089\u65b0\u85ac\u7fa4\uff08\u65b0\u85ac\u30d5\u30e9\u30b0 = 1\uff09\u300d\u3068\u3057\u3066\u901a\u5e38\u306eCox\u56de\u5e30\u306b\u6295\u5165\u3057\u3066\u3057\u307e\u3063\u305f\u3089\u3069\u3046\u306a\u308b\u3060\u308d\u3046\u304b\uff1f<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u6ce8\u610f\uff01\u4e0d\u6b7b\u6642\u9593\u30d0\u30a4\u30a2\u30b9\uff08Immortal Time Bias\uff09\u306e\u30e1\u30ab\u30cb\u30ba\u30e0<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u306e\u60a3\u8005\u306f\u300c6\u30f6\u6708\u76ee\u306b\u65b0\u85ac\u3092\u958b\u59cb\u3067\u304d\u305f\u300d\u3068\u3044\u3046\u3053\u3068\u306f\u3001<strong>\u5c11\u306a\u304f\u3068\u3082\u6700\u521d\u306e6\u30f6\u6708\u9593\u306f\u300e\u7d76\u5bfe\u306b\u6b7b\u4ea1\u3057\u306a\u304b\u3063\u305f\uff08\u751f\u5b58\u3057\u3066\u3044\u305f\uff09\u300f\u3068\u3044\u3046\u672a\u6765\u306e\u60c5\u5831<\/strong>\u3092\u6301\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6765\u306f\u672a\u6cbb\u7642\u3067\u3042\u3063\u305f\u6700\u521d\u306e6\u30f6\u6708\u9593\u307e\u3067\u3082\u300c\u65b0\u85ac\u7fa4\u306e\u751f\u5b58\u6642\u9593\u300d\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3057\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u65b0\u85ac\u7fa4\u306b<strong>\u300c\u7d76\u5bfe\u306b\u6b7b\u4ea1\u304c\u8d77\u304d\u306a\u3044\u7121\u6575\u306e\u671f\u9593\uff08\u4e0d\u6b7b\u6642\u9593: Immortal Time\uff09\u300d<\/strong>\u304c\u4e0d\u5f53\u306b\u52a0\u7b97\u3055\u308c\u3001\u65b0\u85ac\u306e\u52b9\u679c\u304c\u6050\u308d\u3057\u3044\u307b\u3069\u904e\u5927\u8a55\u4fa1\u3055\u308c\u3066\u3057\u307e\u3046\u306e\u3067\u3042\u308b\u3002<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u67fb\u8aad\u8005\uff08Reviewer\uff09\u306f\u3053\u306e\u300c\u4e0d\u6b7b\u6642\u9593\u30d0\u30a4\u30a2\u30b9\u300d\u306b\u6975\u3081\u3066\u654f\u611f\u3067\u3042\u308b\u3002\u4f55\u306e\u6c17\u306a\u3057\u306b\u624b\u4f5c\u696d\u3067\u30d5\u30e9\u30b0\u3092\u7acb\u3066\u305f\u89e3\u6790\u3092\u63d0\u51fa\u3059\u308b\u3068\u3001\u7d71\u8a08\u5b66\u7684\u306a\u59a5\u5f53\u6027\u306a\u3057\u3068\u5224\u65ad\u3055\u308c\u3001\u8ad6\u6587\u306f\u4e00\u767a\u3067\u5374\u4e0b\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u300c\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\u300d\u3068\u300c\u6642\u9593\u4f9d\u5b58\u4fc2\u6570\uff08\u6bd4\u4f8b\u30cf\u30b6\u30fc\u30c9\u6027\u7834\u7dbb\uff09\u300d\u306e\u533a\u5225<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067\u81e8\u5e8a\u533b\u304c\u6700\u3082\u6df7\u4e71\u3057\u3084\u3059\u30442\u3064\u306e\u7528\u8a9e\u306e\u9055\u3044\u3092\u6574\u7406\u3057\u3066\u304a\u3053\u3046\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf (Time-dependent covariate)<\/strong>:<strong>\u5909\u6570 <\/strong>$X(t)$<strong> \u81ea\u4f53<\/strong>\u304c\u6642\u9593\u3068\u3068\u3082\u306b\u5909\u5316\u3059\u308b\uff08\u4f8b: \u691c\u67fb\u5024\u306e\u5909\u5316\u3001\u9014\u4e2d\u306e\u6cbb\u7642\u958b\u59cb\uff09\u3002\u2794 <strong>\u672c\u8a18\u4e8b\u3067\u89e3\u8aac\u3059\u308b <code>tmerge()<\/code> \u3067\u5bfe\u51e6<\/strong><\/li>\n\n\n\n<li><strong>\u6642\u9593\u4f9d\u5b58\u4fc2\u6570 (Time-varying coefficient)<\/strong>:\u52b9\u679c\u306e\u5927\u304d\u3055\uff08\u30cf\u30b6\u30fc\u30c9\u6bd4 $\\beta(t)$\uff09\u304c\u6642\u9593\u3068\u3068\u3082\u306b\u5909\u5316\u3059\u308b\uff08\u4f8b: \u6cbb\u7642\u521d\u671f\u306f\u30cf\u30b6\u30fc\u30c9\u6bd4\u304c\u826f\u3044\u304c\u3001\u5f8c\u671f\u306b\u306a\u308b\u3068\u52b9\u679c\u304c\u8584\u308c\u3066\u751f\u5b58\u66f2\u7dda\u304c\u4ea4\u5dee\u3059\u308b\uff1d\u6bd4\u4f8b\u30cf\u30b6\u30fc\u30c9\u6027\u306e\u7834\u7dbb\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u30cf\u30b6\u30fc\u30c9\u6bd4\u81ea\u4f53\u304c\u6642\u9593\u306b\u3088\u3063\u3066\u5909\u5316\u3057\u3066\u3057\u307e\u3046\u300c\u6642\u9593\u4f9d\u5b58\u4fc2\u6570\u300d\u3084\u6bd4\u4f8b\u30cf\u30b6\u30fc\u30c9\u6027\u306e\u7834\u7dbb\uff08\u4ea4\u5dee\u3059\u308b\u751f\u5b58\u66f2\u7dda\uff09\u3078\u306e\u5bfe\u51e6\u6cd5\uff08RMST\u3084\u5c64\u5225\u5316\u3001\u671f\u9593\u5206\u5272\u30e2\u30c7\u30eb\u306a\u3069\uff09\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u305c\u3072\u4f75\u305b\u3066\u53c2\u7167\u3057\u3066\u307b\u3057\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2794 <a href=\"https:\/\/best-biostatistics.com\/toukei-er\/entry\/handling-non-proportional-hazards-in-cox-regression-with-r-a-guide-to-rmst-stratification-and-time-varying-models\/\">Cox\u56de\u5e30\u3067\u6bd4\u4f8b\u30cf\u30b6\u30fc\u30c9\u6027\u304c\u602a\u3057\u3044\u6642\u306e\u5bfe\u51e6\u6cd5\uff01RMST\uff08\u5236\u9650\u4ed8\u304d\u5e73\u5747\u751f\u5b58\u6642\u9593\uff09\u306e\u4f7f\u3044\u65b9\u3068\u5c64\u5225\u5316\u30fb\u671f\u9593\u5206\u5272\u306e\u4f7f\u3044\u5206\u3051<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">R\u3067\u306e\u89e3\u6c7a\u7b56\uff1aCounting Process \u5f62\u5f0f <code>(start, stop, event)<\/code> \u3078\u306e\u30c7\u30fc\u30bf\u5909\u63db<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u6b7b\u6642\u9593\u30d0\u30a4\u30a2\u30b9\u3092\u56de\u907f\u3057\u3001\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\u3092Cox\u56de\u5e30\u3067\u6b63\u3057\u304f\u6271\u3046\u305f\u3081\u306e\u6570\u5b66\u7684\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u300cCounting Process \u5f62\u5f0f\uff08\u30ab\u30a6\u30f3\u30c8\u904e\u7a0b\u5f62\u5f0f\uff09\u300d\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u306f\u30011\u4eba\u306e\u60a3\u8005\uff081\u884c\u30c7\u30fc\u30bf\uff09\u3092\u300c\u30b9\u30c6\u30fc\u30bf\u30b9\u304c\u4e00\u5b9a\u3067\u3042\u3063\u305f\u6642\u9593\u533a\u9593\uff08Interval\uff09\u300d\u3054\u3068\u306b\u8907\u6570\u884c\u306b\u5207\u308a\u5206\u3051\u308b\u624b\u6cd5\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u3048\u3070\u3001\u300c6\u30f6\u6708\u76ee\u306b\u65b0\u85ac\u3092\u958b\u59cb\u3057\u300118\u30f6\u6708\u76ee\u306b\u6b7b\u4ea1\u3057\u305f\u60a3\u8005\u300d\u306e\u5834\u5408\u3001\u30c7\u30fc\u30bf\u884c\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b2\u884c\u306b\u5206\u5272\u3059\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>\u60a3\u8005ID<\/strong><\/td><td><strong>\u958b\u59cb\u6642\u9593 (tstart)<\/strong><\/td><td><strong>\u7d42\u4e86\u6642\u9593 (tstop)<\/strong><\/td><td><strong>\u65b0\u85ac\u30b9\u30c6\u30fc\u30bf\u30b9<\/strong><\/td><td><strong>\u30a4\u30d9\u30f3\u30c8 (status)<\/strong><\/td><td><strong>\u89e3\u91c8<\/strong><\/td><\/tr><tr><td>ID: 1<\/td><td>0 \u30f6\u6708<\/td><td>6 \u30f6\u6708<\/td><td>0 (\u672a\u670d\u7528)<\/td><td>0 (\u751f\u5b58)<\/td><td>\u65b0\u85ac\u3092\u98f2\u3093\u3067\u3044\u306a\u3044\u671f\u9593\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8<\/td><\/tr><tr><td>ID: 1<\/td><td>6 \u30f6\u6708<\/td><td>18 \u30f6\u6708<\/td><td>1 (\u670d\u7528\u4e2d)<\/td><td>1 (\u6b7b\u4ea1)<\/td><td>\u65b0\u85ac\u3092\u98f2\u3093\u3067\u3044\u308b\u671f\u9593\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u533a\u9593\u5206\u5272\u3059\u308c\u3070\u30010\u301c6\u30f6\u6708\u76ee\u306f\u300c\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u7fa4\u306e\u30ea\u30b9\u30af\u300d\u30016\u301c18\u30f6\u6708\u76ee\u306f\u300c\u65b0\u85ac\u7fa4\u306e\u30ea\u30b9\u30af\u300d\u3068\u3057\u3066\u6b63\u3057\u304f\u30cf\u30b6\u30fc\u30c9\u8a08\u7b97\u306b\u7d44\u307f\u8fbc\u307e\u308c\u3001\u4e0d\u6b7b\u6642\u9593\u304c\u5b8c\u5168\u306b\u89e3\u6d88\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<div id=\"biost-3248246461\" 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\">\u3010\u5b9f\u8df5\u3011\u795e\u95a2\u6570 <code>survival::tmerge()<\/code> \u3067\u30c7\u30fc\u30bf\u3092\u4e00\u77ac\u3067\u6574\u5f62\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30c7\u30fc\u30bf\u884c\u3092\u81ea\u5206\u3067\u624b\u52d5\u8a08\u7b97\u3057\u3066\u8907\u6570\u884c\u306b\u5207\u308a\u5206\u3051\u308b\u306e\u306f\u3001\u8a08\u7b97\u30df\u30b9\u3084\u30d0\u30b0\u306e\u6e29\u5e8a\u3068\u306a\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">R\u306e\u6a19\u6e96\u30d1\u30c3\u30b1\u30fc\u30b8 <code>survival<\/code> \u306b\u542b\u307e\u308c\u308b <strong><code>tmerge()<\/code> \u95a2\u6570\u306e\u4ed5\u7d44\u307f<\/strong>\u3092\u4f7f\u3048\u3070\u3001\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30c7\u30fc\u30bf\u306b\u6642\u9593\u4f9d\u5b58\u306e\u30a4\u30d9\u30f3\u30c8\u3084\u7e70\u308a\u8fd4\u3057\u6e2c\u5b9a\u30c7\u30fc\u30bf\u3092\u5b89\u5168\u304b\u3064\u81ea\u52d5\u3067\u7d71\u5408\u30fb\u533a\u9593\u5206\u5272\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u624b\u5143\u306eR\u74b0\u5883\u30671\u30b9\u30c6\u30c3\u30d7\u305a\u3064\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u306a\u304c\u3089\u3001\u30c7\u30fc\u30bf\u306e\u69cb\u9020\u5909\u5316\u3092\u78ba\u8a8d\u3057\u3066\u3044\u3053\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u8aad\u307f\u8fbc\u307f\u3068\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30c7\u30fc\u30bf\u306e\u4f5c\u6210<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u306f\u3001\u60a3\u80051\u4eba\u306b\u3064\u304d1\u884c\u306e\u57fa\u672c\u60c5\u5831\uff08ID\u3001\u5e74\u9f62\u3001\u8ffd\u8de1\u671f\u9593\u3001\u8ee2\u5e30\uff09\u3092\u6301\u3064\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>library(tidyverse)\nlibrary(survival)\n\n# 1. \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30c7\u30fc\u30bf\u306e\u4f5c\u6210\uff081\u4eba1\u884c\uff09\nset.seed(123)\nn &lt;- 200\nbase_df &lt;- tibble(\n  id      = 1:n,\n  age     = rnorm(n, mean = 60, sd = 10),\n  futime  = runif(n, min = 1, max = 36), # \u8ffd\u8de1\u671f\u9593\uff08\u30f6\u6708\uff09\n  death   = sample(c(0, 1), n, replace = TRUE, prob = c(0.7, 0.3)) # \u8ee2\u5e30\n)\n\n# \u4f5c\u6210\u3057\u305f\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30c7\u30fc\u30bf\u306e\u78ba\u8a8d\uff081\u4eba1\u884c\u306b\u306a\u3063\u3066\u3044\u308b\uff09\nhead(base_df)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: \u8ffd\u8de1\u9014\u4e2d\u306e\u300c\u6642\u9593\u4f9d\u5b58\u30a4\u30d9\u30f3\u30c8\u30c7\u30fc\u30bf\u300d\u306e\u6e96\u5099<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306b\u3001\u8ffd\u8de1\u9014\u4e2d\u3067\u767a\u751f\u3057\u305f\u30a4\u30d9\u30f3\u30c8\uff08\u4f8b: \u65b0\u85ac\u306e\u670d\u7528\u958b\u59cb\uff09\u3068\u305d\u306e\u767a\u751f\u30bf\u30a4\u30df\u30f3\u30b0\u3092\u6301\u3064\u5225\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3092\u7528\u610f\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 2. \u8ffd\u8de1\u9014\u4e2d\u306e\u300c\u6cbb\u7642\u958b\u59cb\u30a4\u30d9\u30f3\u30c8\u300d\u30c7\u30fc\u30bf\u306e\u4f5c\u6210\n# \u4e00\u90e8\u306e\u60a3\u8005\u306e\u307f\u3001\u8ffd\u8de1\u9014\u4e2d\u3067\u65b0\u85ac\u3092\u958b\u59cb\u3057\u305f\u3068\u3059\u308b\nset.seed(456)\ndrug_df &lt;- tibble(\n  id        = sample(1:n, 80),\n  drug_time = runif(80, min = 0.5, max = 20) # \u65b0\u85ac\u3092\u958b\u59cb\u3057\u305f\u30bf\u30a4\u30df\u30f3\u30b0\uff08\u30f6\u6708\uff09\n) %&gt;% \n  # \u8ffd\u8de1\u671f\u9593\u3088\u308a\u5f8c\u306b\u65b0\u85ac\u958b\u59cb\u3068\u306a\u3063\u3066\u3044\u308b\u4e0d\u6574\u5408\u30c7\u30fc\u30bf\u3092\u9632\u3050\u30d5\u30a3\u30eb\u30bf\u30fc\n  inner_join(base_df, by = \"id\") %&gt;% \n  filter(drug_time &lt; futime) %&gt;% \n  select(id, drug_time)\n\n# \u30a4\u30d9\u30f3\u30c8\u30c7\u30fc\u30bf\u306e\u78ba\u8a8d\uff08\u8ab0\u304c\u4f55\u30f6\u6708\u76ee\u306b\u65b0\u85ac\u3092\u958b\u59cb\u3057\u305f\u304b\uff09\nhead(drug_df)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: <code>tmerge()<\/code> \u306e1\u56de\u76ee\uff1a\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30c7\u30fc\u30bf\u3068\u6700\u7d42\u8ee2\u5e30\u306e\u767b\u9332<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>tmerge()<\/code> \u95a2\u6570\u306e\u7b2c1\u6bb5\u968e\u3068\u3057\u3066\u3001\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30c7\u30fc\u30bf\u306b\u5168\u8ffd\u8de1\u671f\u9593\uff08<code>futime<\/code>\uff09\u3068\u6700\u7d42\u30a4\u30d9\u30f3\u30c8\uff08<code>death<\/code>\uff09\u3092\u5272\u308a\u5f53\u3066\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1\u56de\u76ee\uff1a\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30c7\u30fc\u30bf\u3068\u8ffd\u8de1\u671f\u9593\u30fb\u6700\u7d42\u30a4\u30d9\u30f3\u30c8\u3092\u8a2d\u5b9a\ndf_split &lt;- tmerge(\n  data1 = base_df,\n  data2 = base_df,\n  id    = id,\n  event = event(futime, death) # \u8ffd\u8de1\u6642\u9593\u3068\u6700\u7d42\u30a4\u30d9\u30f3\u30c8\n)\n\n# 1\u56de\u76ee\u5b9f\u884c\u5f8c\u306e\u30c7\u30fc\u30bf\u69cb\u9020\u78ba\u8a8d\uff08tstart, tstop \u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\uff09\nhead(df_split)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: <code>tmerge()<\/code> \u306e2\u56de\u76ee\uff1a<code>tdc()<\/code> \u306b\u3088\u308b\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\u306e\u7d50\u5408\u3068\u533a\u9593\u5206\u5272<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u304c\u6700\u3082\u91cd\u8981\u306a\u30b9\u30c6\u30c3\u30d7\u3067\u3042\u308b\u30022\u56de\u76ee\u306e <code>tmerge()<\/code> \u3067 <code>drug_df<\/code> \u3092\u6e21\u3057\u3001<code>tdc(drug_time)<\/code> \u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>tdc()<\/code> \u306f <strong>Time-Dependent Covariate<\/strong> \u306e\u7565\u3067\u3042\u308a\u3001\u300c\u6307\u5b9a\u3057\u305f\u6642\u9593\uff08<code>drug_time<\/code>\uff09\u306b\u5230\u9054\u3059\u308b\u3068\u30d5\u30e9\u30b0\u304c 0 \u304b\u3089 1 \u3078\u5909\u5316\u3059\u308b\u300d\u3068\u3044\u3046\u6307\u793a\u3092\u610f\u5473\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 2\u56de\u76ee\uff1a\u6642\u9593\u4f9d\u5b58\u30a4\u30d9\u30f3\u30c8\uff08\u65b0\u85ac\u958b\u59cb\uff09\u3092\u7d71\u5408\u3057\u3066\u533a\u9593\u5206\u5272\ndf_split &lt;- tmerge(\n  data1 = df_split,\n  data2 = drug_df,\n  id    = id,\n  drug  = tdc(drug_time) # tdc() \u306b\u3088\u308a\u65b0\u85ac\u958b\u59cb\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u533a\u9593\u5206\u5272\uff01\n)\n\n# \u8907\u6570\u884c\u306b\u5206\u5272\u3055\u308c\u305f Counting Process \u5f62\u5f0f\u30c7\u30fc\u30bf\u306e\u78ba\u8a8d\nhead(df_split %&gt;% select(id, tstart, tstop, event, drug, age), 10)\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>tdc(drug_time)<\/code> \u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001<code>drug_time<\/code> \u3088\u308a\u524d\u306e\u533a\u9593\u3067\u306f <code>drug = 0<\/code>\u3001<code>drug_time<\/code> \u4ee5\u964d\u306e\u533a\u9593\u3067\u306f <code>drug = 1<\/code> \u306b\u81ea\u52d5\u3067\u5207\u308a\u66ff\u308f\u308b\u30d5\u30e9\u30b0\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3001\u30c7\u30fc\u30bf\u304c\u8907\u6570\u884c\u306b\u5b8c\u74a7\u306b\u5206\u5272\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6642\u9593\u4f9d\u5b58Cox\u56de\u5e30\u306e\u5b9f\u884c\uff08<code>coxph<\/code>\uff09\u3068\u30cf\u30b6\u30fc\u30c9\u6bd4\u306e\u6b63\u3057\u3044\u8aad\u307f\u89e3\u304d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30c7\u30fc\u30bf\u304c Counting Process \u5f62\u5f0f\uff08<code>tstart<\/code>, <code>tstop<\/code>, <code>event<\/code>\uff09\u306b\u6574\u5f62\u3055\u308c\u305f\u3089\u3001Cox\u6bd4\u4f8b\u30cf\u30b6\u30fc\u30c9\u56de\u5e30\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <code>coxph(Surv(tstart, tstop, event) ~ ..., cluster(id))<\/code> \u306e\u66f8\u304d\u65b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Surv()<\/code> \u95a2\u6570\u306e\u7b2c\u4e00\u5f15\u6570\u30fb\u7b2c\u4e8c\u5f15\u6570\u306b <code>tstart<\/code> \u3068 <code>tstop<\/code> \u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305f\u30011\u4eba\u306e\u60a3\u8005\u304c\u8907\u6570\u884c\u306b\u307e\u305f\u304c\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u6a19\u6e96\u8aa4\u5dee\u306e\u904e\u5c0f\u8a55\u4fa1\u3092\u9632\u3050\u76ee\u7684\u3067 <code>cluster(id)<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\uff08\u5805\u7262\u306a\u6a19\u6e96\u8aa4\u5dee: Robust Standard Error\uff09\u3092\u5fc5\u305a\u6307\u5b9a\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6642\u9593\u4f9d\u5b58Cox\u6bd4\u4f8b\u30cf\u30b6\u30fc\u30c9\u30e2\u30c7\u30eb\u306e\u5b9f\u884c\nfit_tdc &lt;- coxph(\n  Surv(tstart, tstop, event) ~ drug + age + cluster(id),\n  data = df_split\n)\n\n# \u89e3\u6790\u7d50\u679c\u306e\u51fa\u529b\nsummary(fit_tdc)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u7b97\u51fa\u3055\u308c\u305f\u30cf\u30b6\u30fc\u30c9\u6bd4\uff08HR\uff09\u306e\u81e8\u5e8a\u7684\u89e3\u91c8<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f97\u3089\u308c\u305f <code>drug<\/code>\uff08\u65b0\u85ac\uff09\u306e\u30cf\u30b6\u30fc\u30c9\u6bd4\uff08<code>exp(coef)<\/code>\uff09\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6b63\u3057\u304f\u81e8\u5e8a\u89e3\u91c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u30cf\u30b6\u30fc\u30c9\u6bd4\u306e\u81e8\u5e8a\u7684\u89e3\u91c8<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u5168\u89b3\u5bdf\u671f\u9593\u3092\u901a\u3058\u305f\u56fa\u5b9a\u7684\u306a\u30ea\u30b9\u30af\u6bd4\u300d\u3067\u306f\u306a\u304f\u3001<strong>\u300e\u5404\u6642\u70b9\u306b\u304a\u3044\u3066\u3001\u305d\u306e\u77ac\u9593\u306b\u65b0\u85ac\u3092\u670d\u7528\u3057\u3066\u3044\u308b\u60a3\u8005\u7fa4\u306f\u3001\u670d\u7528\u3057\u3066\u3044\u306a\u3044\u60a3\u8005\u7fa4\u3068\u6bd4\u8f03\u3057\u3066\u3001\u30a4\u30d9\u30f3\u30c8\u767a\u751f\u30ea\u30b9\u30af\u304c\u3069\u308c\u307b\u3069\u5909\u5316\u3059\u308b\u304b\u300f<\/strong>\u3092\u8868\u3059\u77ac\u6642\u30ea\u30b9\u30af\u6bd4\u3067\u3042\u308b\u3002<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\u67fb\u8aad\u8005\uff08Reviewer\uff09\u3092\u7d0d\u5f97\u3055\u305b\u308b\u8ad6\u6587\u8a18\u8ff0\u6cd5\uff08Methods \uff06 Results\uff09<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\u3092\u7528\u3044\u305f\u89e3\u6790\u3092\u8ad6\u6587\u3078\u5831\u544a\u3059\u308b\u969b\u306e\u6a19\u6e96\u7684\u306a\u82f1\u6587\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4ee5\u4e0b\u306b\u793a\u3059\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u89e3\u6790\u65b9\u6cd5\uff08Methods\uff09\u306e\u82f1\u6587\u4f8b<\/strong>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>&#8220;To evaluate the association between in-study treatment changes [\u307e\u305f\u306f repeating biomarker measurements] and overall survival without immortal time bias, a extended Cox proportional hazards model with time-dependent covariates was utilized. The dataset was converted into counting process format (start, stop, event) using the tmerge function in R. Robust standard errors were calculated using cluster-robust variance estimators to account for multiple observations per patient.&#8221;<\/em><\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u7d50\u679c\u6b04\uff08Results \/ Table \u811a\u6ce8\uff09\u306e\u82f1\u6587\u4f8b<\/strong>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>&#8220;After adjusting for baseline age and time-dependent treatment status, the initiation of [\u65b0\u85ac\u540d] was significantly associated with a reduced risk of mortality (time-dependent hazard ratio, 0.62; 95% CI, 0.45 to 0.86; p = 0.004).&#8221;<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\u3010\u307e\u3068\u3081\u3011\u30b3\u30d4\u30da\u3067\u52d5\u304f\uff01\u6642\u9593\u4f9d\u5b58Cox\u56de\u5e30\u306e\u4e00\u62ecR\u30b3\u30fc\u30c9\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u305f\u300c\u30c7\u30fc\u30bf\u4f5c\u6210 \u2794 <code>tmerge()<\/code> \u306b\u3088\u308b\u30c7\u30fc\u30bf\u69cb\u9020\u5316 \u2794 \u6642\u9593\u4f9d\u5b58Cox\u56de\u5e30\u306e\u5b9f\u884c\u300d\u3092\u4e00\u8cab\u3057\u3066\u8a66\u305b\u308b\u4e00\u62ec\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u305f\u3002\u81ea\u8eab\u306e\u624b\u5143\u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u540d\u30fb\u5909\u6570\u540d\u306b\u7f6e\u304d\u63db\u3048\u3066\u6d3b\u7528\u3057\u3066\u307b\u3057\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># === \u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cf\uff08Time-Dependent Covariate\uff09Cox\u56de\u5e30 \u4e00\u62ec\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 ===\nlibrary(tidyverse)\nlibrary(survival)\n\n# Step 1: \u30c7\u30fc\u30bf\u306e\u6e96\u5099\uff08base_data: \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3, time_dep_data: \u6642\u9593\u4f9d\u5b58\u30a4\u30d9\u30f3\u30c8\uff09\n# \u203b \u3054\u81ea\u8eab\u306e\u5b9f\u30c7\u30fc\u30bf\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\n\n# Step 2: tmerge() \u306b\u3088\u308b\u30c7\u30fc\u30bf\u5206\u5272\u3068\u30ab\u30a6\u30f3\u30c8\u904e\u7a0b\u5f62\u5f0f\u5316\ndf_tdc &lt;- tmerge(\n  data1 = base_data,\n  data2 = base_data,\n  id    = id,\n  event = event(futime, status) # \u8ffd\u8de1\u671f\u9593\u3068\u30a4\u30d9\u30f3\u30c8\n)\n\ndf_tdc &lt;- tmerge(\n  data1 = df_tdc,\n  data2 = time_dep_data,\n  id    = id,\n  treat_tdc = tdc(event_time) # \u6642\u9593\u4f9d\u5b58\u5909\u6570\u306e\u958b\u59cb\u30bf\u30a4\u30df\u30f3\u30b0\n)\n\n# Step 3: \u6642\u9593\u4f9d\u5b58Cox\u6bd4\u4f8b\u30cf\u30b6\u30fc\u30c9\u30e2\u30c7\u30eb\u306e\u5b9f\u884c\nfit_tdc &lt;- coxph(\n  Surv(tstart, tstop, event) ~ treat_tdc + age + sex + cluster(id),\n  data = df_tdc\n)\n\n# Step 4: \u89e3\u6790\u7d50\u679c\u8868\u793a\uff08\u6642\u9593\u4f9d\u5b58\u30cf\u30b6\u30fc\u30c9\u6bd4\u306e\u78ba\u8a8d\uff09\nsummary(fit_tdc)\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u81e8\u5e8a\u73fe\u5834\u306e\u30ab\u30eb\u30c6\u30c7\u30fc\u30bf\u306b\u6ea2\u308c\u3066\u3044\u308b\u300c\u7e70\u308a\u8fd4\u3057\u6e2c\u5b9a\u5024\u300d\u3084\u300c\u9014\u4e2d\u306e\u6cbb\u7642\u5909\u66f4\u300d\u3092\u3001\u4f55\u306e\u6c17\u306a\u3057\u306b\u305d\u306e\u307e\u307e\u56de\u5e30\u30e2\u30c7\u30eb\u306b\u6295\u5165\u3057\u3066\u306f\u3044\u3051\u306a\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7d71\u8a08\u7684\u306a\u4ed5\u7d44\u307f\u3092\u6b63\u3057\u304f\u52c9\u5f37\u3057\u3001<code>tmerge()<\/code> \u3092\u7528\u3044\u3066\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u9069\u5207\u306b\u6574\u3048\u308b\u3053\u3068\u3067\u3001\u4e0d\u6b7b\u6642\u9593\u30d0\u30a4\u30a2\u30b9\u3092\u6392\u3057\u305f\u771f\u306b\u4fe1\u983c\u6027\u306e\u9ad8\u3044\u7814\u7a76\u6210\u679c\u3092\u8ad6\u6587\u3068\u3057\u3066\u767a\u4fe1\u3057\u3066\u3044\u3053\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u304a\u3059\u3059\u3081\u66f8\u7c4d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/amzn.to\/4qp9x4J\">\u8ab0\u3082\u6559\u3048\u3066\u304f\u308c\u306a\u304b\u3063\u305f\u3000\u533b\u7642\u7d71\u8a08\u306e\u4f7f\u3044\u5206\u3051\u301c\u8ff7\u3044\u3084\u3059\u3044\u89e3\u6790\u624b\u6cd5\u306e\u9078\u3073\u65b9\u304c\uff0cR\u3067\u5b9f\u611f\u3057\u306a\u304c\u3089\u308f\u304b\u308b\uff01<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7814\u7a76\u8005: \u89b3\u5bdf\u671f\u9593\u4e2d\u306b\u6bce\u6708\u6e2c\u5b9a\u3057\u305f\u8840\u5727\u306e\u5909\u5316\u3084\u3001\u8ffd\u8de1\u9014\u4e2d\u3067\u8ffd\u52a0\u3057\u305f\u6297\u304c\u3093\u5264\u306e\u5f71\u97ff\u3092\u305d\u306e\u307e\u307eCox\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u5171\u5909\u91cf\uff081\/0\uff09\u3068\u3057\u3066\u6295\u5165\u3057\u3066\u3082\u5927\u4e08\u592b\u3067\u3057\u3087\u3046\u304b\uff1f \u7d71\u8a08ER: \u3061\u3087\u3063\u3068\u5f85\u3063\u3066\u304f\u3060\u3055\u3044\uff01\u4f55\u306e\u6c17\u306a\u3057\u306b\u6271\u304a\u3046\u3068\u3057\u3066 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4698,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_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},"jetpack_post_was_ever_published":false},"categories":[21],"tags":[],"class_list":["post-4697","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-21"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/08\/\u6642\u9593\u4f9d\u5b58\u5171\u5909\u91cfCox-scaled.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4697","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=4697"}],"version-history":[{"count":1,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4697\/revisions"}],"predecessor-version":[{"id":4699,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4697\/revisions\/4699"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media\/4698"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=4697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=4697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=4697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}