{"id":499,"date":"2018-08-28T00:46:07","date_gmt":"2018-08-27T15:46:07","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/how-to-draw-box-and-whisker-plot-in-r\/"},"modified":"2024-10-13T15:12:14","modified_gmt":"2024-10-13T06:12:14","slug":"how-to-draw-box-and-whisker-plot-in-r","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/how-to-draw-box-and-whisker-plot-in-r\/","title":{"rendered":"R \u3067\u7bb1\u3072\u3052\u56f3\u3092\u66f8\u304f\u65b9\u6cd5"},"content":{"rendered":"\n<p>R \u3067\u7bb1\u3072\u3052\u56f3\u3092\u63cf\u304f\u306b\u306f\u3069\u3046\u3057\u305f\u3089\u3044\u3044\u304b\uff1f<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"R-\u3067\u7bb1\u3072\u3052\u56f3\u3092\u66f8\u304f\u95a2\u6570\">R \u3067\u7bb1\u3072\u3052\u56f3\u3092\u66f8\u304f\u95a2\u6570<\/h2>\n\n\n\n<p>R \u3067\u7bb1\u3072\u3052\u56f3\u3092\u66f8\u304f\u95a2\u6570\u306f\u3001boxplot()<\/p>\n\n\n\n<p>\u7b2c 1 \u56db\u5206\u4f4d\u304b\u3089\u7b2c 3 \u56db\u5206\u4f4d\u307e\u3067\u306e\u7bb1\u3092\u63cf\u304d\u3001\u305d\u306e\u4e2d\u306b\u3042\u308b\u4e2d\u592e\u5024\u306b\u7dda\u3092\u5f15\u304f\u3002<\/p>\n\n\n\n<p>\u7b2c 1 \u56db\u5206\u4f4d\u3068\u7b2c 3 \u56db\u5206\u4f4d\u306e\u5dee\uff08\u56db\u5206\u4f4d\u7bc4\u56f2\uff09\u306e 1.5 \u500d\u306e\u7dda\uff08\u3072\u3052\uff09\u3092\u4e0a\u4e0b\u306b\u3064\u3051\u308b\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u3088\u308a\u5927\u304d\u3044\u307e\u305f\u306f\u5c0f\u3055\u3044\u5024\u306f\u30d7\u30ed\u30c3\u30c8\uff08\u70b9\u3067\u3042\u3089\u308f\uff09\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"R-\u3067\u7bb1\u3072\u3052\u56f3\u3092\u66f8\u304f\u4f8b\">R \u3067\u7bb1\u3072\u3052\u56f3\u3092\u66f8\u304f\u4f8b<\/h2>\n\n\n\n<p>\u4f8b\uff1aMASS\u30d1\u30c3\u30b1\u30fc\u30b8\u306e birthwt \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u4f7f\u3063\u3066\u7bb1\u3072\u3052\u56f3\u3092\u66f8\u3044\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<p>bwt \u304c\u4f53\u91cd\u306e\u9023\u7d9a\u30c7\u30fc\u30bf\u3001smoke \u304c\u55ab\u7159\u3057\u3066\u3044\u305f\u304b\u3069\u3046\u304b\u306e 2 \u5024\u306e\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u30c7\u30fc\u30bf\u3002<\/p>\n\n\n\n<p>bwt ~ smoke \u3068\u3044\u3046\u3075\u3046\u306b\u3001\u30c1\u30eb\u30c0\uff08 ~ \uff09\u3067 2 \u3064\u306e\u5909\u6570\u3092\u3064\u306a\u3050\u3002<\/p>\n\n\n\n<p>R \u30b9\u30af\u30ea\u30d7\u30c8\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synPreProc\">library<\/span><span class=\"synSpecial\">(<\/span>MASS<span class=\"synSpecial\">)<\/span>\n<span class=\"synIdentifier\">with<\/span><span class=\"synSpecial\">(<\/span>birthwt<span class=\"synSpecial\">,<\/span> <span class=\"synIdentifier\">boxplot<\/span><span class=\"synSpecial\">(<\/span>bwt<span class=\"synStatement\">~<\/span>smoke<span class=\"synSpecial\">))<\/span>\n<\/code><\/pre>\n\n\n\n<p>\u7bb1\u3072\u3052\u56f3\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u3051\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"553\" height=\"552\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/08\/20180828004214.png\" alt=\"\" class=\"wp-image-2788\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/08\/20180828004214.png 553w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/08\/20180828004214-300x300.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/08\/20180828004214-150x150.png 150w\" sizes=\"(max-width: 553px) 100vw, 553px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<p>\u598a\u5a20\u4e2d\u306b\u55ab\u7159\u3057\u3066\u3044\u308b\u3068(smoke=1)\u3001\u51fa\u751f\u5150\u306e\u4f53\u91cd\u304c\u8efd\u3044\u50be\u5411\u304c\u898b\u3066\u53d6\u308c\u308b\u3002<\/p>\n\n\n\n<p>\u3053\u3093\u306a\u3075\u3046\u306b\u3001\u30c7\u30fc\u30bf\u306e\u50be\u5411\u3092\u3056\u3063\u304f\u308a\u898b\u308b\u306e\u306b\u5f79\u7acb\u3064\u3002<\/p>\n\n\n\n<div id=\"biost-3756421649\" 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=\"\u307e\u3068\u3081\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>R \u3067\u7bb1\u3072\u3052\u56f3\u3092\u66f8\u304f\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u305f\u3002<\/p>\n\n\n\n<p>boxplot() \u3068\u3044\u3046\u95a2\u6570\u3092\u4f7f\u3063\u3066\u3001\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u53c2\u8003\u306b\u306a\u308c\u3070\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>R \u3067\u7bb1\u3072\u3052\u56f3\u3092\u63cf\u304f\u306b\u306f\u3069\u3046\u3057\u305f\u3089\u3044\u3044\u304b\uff1f<\/p>\n","protected":false},"author":2,"featured_media":2788,"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,37],"tags":[],"class_list":["post-499","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-37"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/08\/20180828004214.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/499","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=499"}],"version-history":[{"count":2,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/499\/revisions"}],"predecessor-version":[{"id":2789,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/499\/revisions\/2789"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media\/2788"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}