{"id":28,"date":"2024-06-06T21:55:51","date_gmt":"2024-06-06T12:55:51","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/how-to-analyze-mi-datasets-with-total-socre-after-multiple-imputation-in-r\/"},"modified":"2024-08-25T21:28:53","modified_gmt":"2024-08-25T12:28:53","slug":"how-to-analyze-mi-datasets-with-total-socre-after-multiple-imputation-in-r","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/how-to-analyze-mi-datasets-with-total-socre-after-multiple-imputation-in-r\/","title":{"rendered":"R \u3092\u4f7f\u3063\u305f\u591a\u91cd\u4ee3\u5165\u3067\u6b20\u640d\u5024\u3092\u88dc\u5b8c\u3057\u305f\u5f8c\u3001\u5408\u8a08\u5f97\u70b9\u3092\u8a08\u7b97\u3057\u3066\u89e3\u6790\u3057\u305f\u3044\u5834\u5408"},"content":{"rendered":"\n<p>\u591a\u91cd\u4ee3\u5165\u6cd5\u306e\u969b\u306b\u3001\u4ee3\u5165\u3057\u305f\u5909\u6570\u3092\u4f7f\u3063\u3066\u3001\u5408\u8a08\u5f97\u70b9\u306a\u3069\u3092\u8a08\u7b97\u3057\u3066\u3001\u6700\u7d42\u7684\u306a\u89e3\u6790\u304c\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308b<\/p>\n\n\n\n<p>\u305d\u3093\u306a\u3068\u304d\u306b\u3001\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u304b<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"R-\u3067\u591a\u91cd\u4ee3\u5165\u6cd5\u3092\u5b9f\u65bd\u3059\u308b\u65b9\u6cd5\u306e\u6982\u8981\">R \u3067\u591a\u91cd\u4ee3\u5165\u6cd5\u3092\u5b9f\u65bd\u3059\u308b\u65b9\u6cd5\u306e\u6982\u8981<\/h2>\n\n\n\n<p>R \u3067\u591a\u91cd\u4ee3\u5165\u6cd5\u3092\u884c\u3046\u57fa\u672c\u7684\u306a\u65b9\u6cd5\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u7167<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2024\/08\/1920x1080-video-Excel-300x169.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/best-biostatistics.com\/toukei-er\/entry\/multiple-imputation-in-ezr\/\">EZR \u3067\u591a\u91cd\u4ee3\u5165\u6cd5\u3092\u884c\u3046\u65b9\u6cd5<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">EZR \u3067\u591a\u91cd\u4ee3\u5165\u6cd5\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u3001\u3069\u306e\u3088\u3046\u306b\u3057\u305f\u3089\u3088\u3044\u304b EZR \u306b\u306f\u3001\u591a\u91cd\u4ee3\u5165\u306e\u30e1\u30cb\u30e5\u30fc\u306f\u306a\u3044\u304c\u3001R \u30b9\u30af\u30ea\u30d7\u30c8\u67a0\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u3044\u304f\u65b9\u6cd5\u3067\u5b9f\u884c\u3067\u304d\u308b \u306f\u3058\u3081\u306b &#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u591a\u91cd\u4ee3\u5165\u3057\u305f\u5f8c\u306b\u5909\u6570\u540c\u58eb\u306e\u8a08\u7b97\u3092\u3057\u305f\u3044\u5834\u5408\">\u591a\u91cd\u4ee3\u5165\u3057\u305f\u5f8c\u306b\u5909\u6570\u540c\u58eb\u306e\u8a08\u7b97\u3092\u3057\u305f\u3044\u5834\u5408<\/h2>\n\n\n\n<p>\u591a\u91cd\u4ee3\u5165\u6cd5\u3092\u884c\u3046\u969b\u306b\u3001\u591a\u91cd\u4ee3\u5165\u3057\u305f\u3042\u3068\u306e\u5909\u6570\u3092\u4f7f\u3063\u3066\u3001\u5408\u8a08\u5f97\u70b9\u306a\u3069\u306e\u5909\u6570\u3092\u4f5c\u6210\u3057\u305f\u3044\u3068\u304d\u304c\u3042\u308b<\/p>\n\n\n\n<p>\u5408\u8a08\u5f97\u70b9\u3092\u591a\u91cd\u4ee3\u5165\u3067\u88dc\u5b8c\u3059\u308b\u65b9\u6cd5\u3067\u306f\u306a\u304f\u3001\u3082\u3068\u3082\u3068\u306e\u5909\u6570\u3092\u88dc\u5b8c\u3057\u3066\u3001\u3055\u3089\u306b\u5408\u8a08\u3092\u8a08\u7b97\u3057\u305f\u3044<\/p>\n\n\n\n<p>\u305d\u3093\u306a\u6642\u306f\u3069\u3046\u3057\u305f\u3089\u3088\u3044\u3060\u308d\u3046\u304b<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u624b\u9806\u306b\u5f93\u3063\u3066\u884c\u3046\u3068\u3001\u305d\u306e\u3088\u3046\u306a\u5909\u6570\u4f5c\u6210\u304c\u3067\u304d\u308b<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5f8c\u3067\u8a08\u7b97\u3057\u305f\u3044\u5909\u6570\uff08\u4f8b\uff1a\u5408\u8a08\u5f97\u70b9\uff09\u3092\u542b\u3081\u305a\u3001\u591a\u91cd\u4ee3\u5165 mice \u3092\u884c\u3046<\/li>\n\n\n\n<li>\u591a\u91cd\u4ee3\u5165\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u7e26\u306b\u7a4d\u307f\u91cd\u306d\u305f\u30ed\u30f3\u30b0\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f5c\u6210\u3059\u308b<\/li>\n\n\n\n<li>\u5909\u6570\u306e\u8a08\u7b97\u3092\u3057\u3066\u3001\u6b32\u3057\u3044\u5909\u6570\uff08\u4f8b\uff1a\u5408\u8a08\u5f97\u70b9\uff09\u3092\u4f5c\u6210\u3059\u308b<\/li>\n\n\n\n<li>\u591a\u91cd\u4ee3\u5165\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8 mids \u5f62\u5f0f\u306b\u623b\u3059<\/li>\n\n\n\n<li>\u89e3\u6790\u3057\u3066\u3001\u7d50\u679c\u3092\u7d71\u5408\u3059\u308b<\/li>\n<\/ol>\n\n\n\n<div id=\"biost-2671055678\" 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\" id=\"\u5b9f\u969b\u306e-R-\u30b9\u30af\u30ea\u30d7\u30c8\">\u5b9f\u969b\u306e R \u30b9\u30af\u30ea\u30d7\u30c8<\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u306e R \u30b9\u30af\u30ea\u30d7\u30c8\u306b\u6cbf\u3063\u3066\u5b9f\u65bd\u3059\u308c\u3070\u3001\u591a\u91cd\u4ee3\u5165\u3057\u305f\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u5909\u6570\u8a08\u7b97\u3092\u3057\u3066\u3001\u305d\u306e\u5f8c\u89e3\u6790\u30fb\u7d71\u5408\u304c\u3067\u304d\u308b<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u4f8b\u306f\u3001BMI \u306e 2 \u4e57\u306e\u5909\u6570 bmi2 \u3092\u3001BMI \u306e\u88dc\u5b8c\u306e\u5f8c\u306b\u4f5c\u6210\u3057\u3066\u3001\u6700\u7d42\u30e2\u30c7\u30eb\u306b bmi2 \u3092\u542b\u3081\u305f\u89e3\u6790\u3092\u3057\u3066\u3044\u308b<\/p>\n\n\n\n<p>\u4f7f\u3046\u95a2\u6570\u306f\u3001mice, with, pool, summary \u4ee5\u5916\u306b\u3001complete, as.mids \u3092\u4f7f\u3046<\/p>\n\n\n\n<p>complete \u306f\u3001\u88dc\u5b8c\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u53d6\u308a\u51fa\u3059\u95a2\u6570\u3067\u3001&#8221;long&#8221; \u3068\u4ed8\u3051\u308b\u3053\u3068\u3067\u30ed\u30f3\u30b0\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u3067\u304d\u308b<\/p>\n\n\n\n<p>\u307e\u305f\u3001include=TRUE \u3067\u3001\u5143\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u542b\u3081\u3001mids \u5f62\u5f0f\uff08\u591a\u91cd\u4ee3\u5165\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5f62\u5f0f\uff09\u306b\u623b\u305b\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f<\/p>\n\n\n\n<p>as.mids \u304c mids \u5f62\u5f0f\u306b\u623b\u3059\u95a2\u6570\u3067\u3042\u308b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synComment\"># \u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u8aad\u307f\u3053\u307f<\/span>\n<span class=\"synPreProc\">library(<\/span>mice<span class=\"synSpecial\">)<\/span>\n<span class=\"synComment\"># \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u547c\u3073\u51fa\u3057<\/span>\n<span class=\"synIdentifier\">data(<\/span>nhanes<span class=\"synSpecial\">)<\/span>\n<span class=\"synComment\"># \u591a\u91cd\u4ee3\u5165<\/span>\nnhanes_imputed <span class=\"synStatement\">&lt;-<\/span> <span class=\"synIdentifier\">mice(<\/span>nhanes<span class=\"synSpecial\">,<\/span> m<span class=\"synStatement\">=100,<\/span> seed<span class=\"synStatement\">=1)<\/span>\n<span class=\"synComment\"># \u3044\u3063\u305f\u3093\u30ed\u30f3\u30b0\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\uff08\u7e26\u306b 100 \u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\uff09<\/span>\n<span class=\"synComment\"># include = TRUE \u306f\u6b20\u640d\u5024\u304c\u3042\u308b\u5143\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u542b\u3081\u308b<\/span>\n<span class=\"synComment\"># \u3068\u3044\u3046\u610f\u5473\uff08mids \u5f62\u5f0f\u306b\u623b\u3059\u305f\u3081\uff09<\/span>\nnhanes_imputed_df <span class=\"synStatement\">&lt;-<\/span> <span class=\"synIdentifier\">complete(<\/span>nhanes_imputed<span class=\"synSpecial\">,<\/span> <span class=\"synConstant\">\"long\",<\/span> include<span class=\"synStatement\">=TRUE)<\/span>\n<span class=\"synComment\"># BMI \u306e 2 \u4e57\u3068\u3044\u3046\u5909\u6570 bmi2 \u3092\u4f5c\u6210\u3059\u308b<\/span>\nnhanes_imputed_df<span class=\"synSpecial\">$<\/span>bmi2 <span class=\"synStatement\">&lt;-<\/span> nhanes_imputed_df<span class=\"synSpecial\">$<\/span>bmi<span class=\"synStatement\">^2<\/span>\n<span class=\"synComment\"># \u591a\u91cd\u4ee3\u5165\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u30d5\u30a9\u30fc\u30de\u30c3\u30c8 mids \u5f62\u5f0f\u306b\u623b\u3059<\/span>\nnhanes_imputed2 <span class=\"synStatement\">&lt;-<\/span> <span class=\"synIdentifier\">as.mids(<\/span>nhanes_imputed_df<span class=\"synSpecial\">)<\/span>\n<span class=\"synComment\"># \u89e3\u6790<\/span>\nlm1 <span class=\"synStatement\">&lt;-<\/span> <span class=\"synIdentifier\">with(<\/span>nhanes_imputed2<span class=\"synSpecial\">,<\/span> <span class=\"synIdentifier\">lm(<\/span>chl <span class=\"synStatement\">~<\/span> age <span class=\"synStatement\">+<\/span> bmi <span class=\"synStatement\">+<\/span> bmi2 <span class=\"synStatement\">+<\/span> <span class=\"synIdentifier\">factor(<\/span>hyp<span class=\"synSpecial\">)))<\/span>\n<span class=\"synComment\"># \u7d71\u5408<\/span>\n<span class=\"synSpecial\">(<\/span>summary.lm1 <span class=\"synStatement\">&lt;-<\/span> <span class=\"synIdentifier\">summary(pool(<\/span>lm1<span class=\"synSpecial\">)))<\/span><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><br><\/pre>\n\n\n\n<p>\u7d50\u679c\u306f\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3001\u6b20\u640d\u5024\u3092\u88dc\u5b8c\u3057\u305f\u5f8c\u306b\u4f5c\u6210\u3057\u305f bmi2 \u306e\u5909\u6570\u3068\u3057\u3066\u52a0\u308f\u308a\u8a08\u7b97\u3055\u308c\u3066\u3044\u308b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"735\" height=\"163\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2024\/06\/20240606214704.png\" alt=\"\" class=\"wp-image-771\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2024\/06\/20240606214704.png 735w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2024\/06\/20240606214704-300x67.png 300w\" sizes=\"(max-width: 735px) 100vw, 735px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u307e\u3068\u3081\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>R \u3067\u591a\u91cd\u4ee3\u5165\u6cd5\u3092\u5b9f\u65bd\u3059\u308b\u3068\u304d\u306b\u3001\u591a\u91cd\u4ee3\u5165\u3092\u3057\u305f\u5f8c\u306b\u3001\u5408\u8a08\u5909\u6570\u306a\u3069\u3092\u4f5c\u6210\u3057\u3066\u3001\u89e3\u6790\u3057\u305f\u3044\u5834\u5408\u3001\u3069\u306e\u3088\u3046\u306b\u3059\u308b\u304b\u89e3\u6790\u3057\u305f<\/p>\n\n\n\n<p>\u591a\u91cd\u4ee3\u5165\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u3044\u3063\u305f\u3093\u7e26\u306b\u4e26\u3079\u3066\u304b\u3089\u3001\u5909\u6570\u8a08\u7b97\u3092\u3057\u3066\u3001\u518d\u5ea6\u591a\u91cd\u4ee3\u5165\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8 mids \u5f62\u5f0f\u306b\u623b\u3059\u3068\u3044\u3046\u65b9\u6cd5\u3092\u4f7f\u3046<\/p>\n\n\n\n<p>\u4f55\u3089\u304b\u53c2\u8003\u306b\u306a\u308c\u3070<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u591a\u91cd\u4ee3\u5165\u6cd5\u306e\u969b\u306b\u3001\u4ee3\u5165\u3057\u305f\u5909\u6570\u3092\u4f7f\u3063\u3066\u3001\u5408\u8a08\u5f97\u70b9\u306a\u3069\u3092\u8a08\u7b97\u3057\u3066\u3001\u6700\u7d42\u7684\u306a\u89e3\u6790\u304c\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308b \u305d\u3093\u306a\u3068\u304d\u306b\u3001\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u304b<\/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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,20],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-r","category-20"],"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\/28","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=28"}],"version-history":[{"count":2,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":772,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/28\/revisions\/772"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}