{"id":54,"date":"2024-02-26T23:16:27","date_gmt":"2024-02-26T14:16:27","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/?p=54"},"modified":"2025-04-29T22:09:51","modified_gmt":"2025-04-29T13:09:51","slug":"how-to-truncate-extreme-weights-in-iptw-using-trim-in-r","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/how-to-truncate-extreme-weights-in-iptw-using-trim-in-r\/","title":{"rendered":"R \u3067 IPTW \u306e\u6975\u7aef\u306a\u91cd\u307f\u3092 Trim \u306b\u3088\u3063\u3066 Truncate \u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">IPTW\u306b\u304a\u3051\u308b\u6975\u7aef\u306a\u91cd\u307f\u306eTruncation\u51e6\u7406\u306b\u3064\u3044\u3066<\/h2>\n\n\n\n<p>\u9006\u78ba\u7387\u91cd\u307f\uff08IPTW\uff09\u306f\u3001\u89b3\u5bdf\u7814\u7a76\u306b\u304a\u3051\u308b\u4ea4\u7d61\u306e\u8abf\u6574\u624b\u6cd5\u3068\u3057\u3066\u5e83\u304f\u7528\u3044\u3089\u308c\u3066\u3044\u308b\u304c\u3001\u91cd\u307f\u304c\u6975\u7aef\u306a\u5024\u3092\u3068\u308b\u5834\u5408\u3001\u63a8\u5b9a\u91cf\u306e\u5206\u6563\u304c\u8457\u3057\u304f\u5897\u52a0\u3057\u3001\u7d50\u679c\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b<\/p>\n\n\n\n<p>\u305d\u306e\u305f\u3081\u3001\u6975\u7aef\u306a\u91cd\u307f\u306b\u5bfe\u3057\u3066<strong> Truncation\uff08\u5207\u308a\u6368\u3066\uff09<\/strong>\u3092\u884c\u3046\u3053\u3068\u304c\u4e00\u822c\u7684\u306b\u63a8\u5968\u3055\u308c\u3066\u3044\u308b<\/p>\n\n\n\n<p>Truncation \u306e\u95be\u5024\u306b\u3064\u3044\u3066\u306f\u3001Cole &amp; Hern\u00e1n (Am J Epidemiol 2008;168:656\u2013664) \u3067\u3001\u7570\u306a\u308b\u95be\u5024\u3067Truncation\u3092\u6bd4\u8f03\u3057\u30011st \u3068 99th \u304c\u793a\u5506\u3055\u308c\u305f<\/p>\n\n\n\n<p>\u305d\u306e\u7d50\u679c\u3001Bolch et al. (BMC Medical Research Methodology 2017;17:93) \u3001Chesnaye et al. (Clinical Kidney Journal 2022;15(1):14-20) \u306a\u3069\u3067\u3001\u6975\u7aef\u306a\u91cd\u307f\u3092\u6392\u9664\u3059\u308b\u76ee\u7684\u306799\u30d1\u30fc\u30bb\u30f3\u30bf\u30a4\u30eb\u3067\u306eTruncation\u304c\u5b9f\u65bd\u3055\u308c\u3066\u3044\u308b<\/p>\n\n\n\n<p>\u3053\u306e\u300cTruncation\u300d\u306f <strong>Winsorization\uff08\u7aef\u5024\u306e\u7f6e\u304d\u63db\u3048\uff09\u3068\u306f\u7570\u306a\u308a\u3001\u95be\u5024\u3092\u8d85\u3048\u308b\u91cd\u307f\u3092<\/strong>\u524a\u9664\u3059\u308b\uff08\u307e\u305f\u306f\u4e00\u5b9a\u5024\u306b\u5207\u308a\u6368\u3066\u308b\uff09\u70b9\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3042\u308b<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">R \u306b\u3088\u308b Truncation \u306e\u5b9f\u884c<\/h2>\n\n\n\n<p>R \u306b\u3088\u308b\u5b9f\u88c5\u3067\u3082\u3001\u3053\u306e\u64cd\u4f5c\u3092\u660e\u793a\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3042\u308b<\/p>\n\n\n\n<p>\u305f\u3068\u3048\u3070 <code>WeightIt<\/code> \u30d1\u30c3\u30b1\u30fc\u30b8\u7b49\u3067\u4f5c\u6210\u3055\u308c\u305fweighted\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b <code>trim()<\/code> \u95a2\u6570\u3092\u7528\u3044\u306699\u30d1\u30fc\u30bb\u30f3\u30bf\u30a4\u30eb\u3067Truncation\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>trimmed.datasets &lt;- trim(weighted.datasets, at = 0.99)\n<\/code><\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306e <code>at = 0.99<\/code> \u306f\u3001\u91cd\u307f\u306e\u4e0a\u4f4d1%\u3092Truncate\u3059\u308b\u8a2d\u5b9a\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b<\/p>\n\n\n\n<p>\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4e0b\u4f4d1%\u3082\u540c\u6642\u306bTruncate\u3059\u308b\u5834\u5408\u306f\u3001<code>at = c(0.01, 0.99)<\/code> \u306e\u3088\u3046\u306b\u6307\u5b9a\u3059\u308b<\/p>\n\n\n\n<p>\u3069\u306e\u7a0b\u5ea6\u306eTruncation\u304c\u9069\u5207\u3067\u3042\u308b\u304b\u306f\u3001\u91cd\u307f\u306e\u5206\u5e03\u3084\u7814\u7a76\u76ee\u7684\u306b\u5fdc\u3058\u3066\u691c\u8a0e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b<\/p>\n\n\n\n\n\n\n\n<div id=\"biost-764048025\" 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\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>IPTW \u306b\u304a\u3051\u308b\u6975\u7aef\u306a\u91cd\u307f\u306f\u3001\u7d50\u679c\u306e\u5b89\u5b9a\u6027\u306e\u305f\u3081\u306b\u30011st \u53ca\u3073 99th \u30d1\u30fc\u30bb\u30f3\u30bf\u30a4\u30eb\u3067\u3001\u5207\u308a\u6368\u3066\uff08truncate\uff09\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u304c\u3042\u308b<\/p>\n\n\n\n<p>R \u3067\u306f\u3001WeightIt \u30d1\u30c3\u30b1\u30fc\u30b8\u306e trim \u95a2\u6570\u3092\u4f7f\u3063\u3066\u5b9f\u884c\u3067\u304d\u308b<\/p>\n","protected":false},"excerpt":{"rendered":"","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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7,5],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-iptw-","category-r"],"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\/54","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=54"}],"version-history":[{"count":2,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":3590,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/54\/revisions\/3590"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}