{"id":498,"date":"2018-07-16T18:44:28","date_gmt":"2018-07-16T09:44:28","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/how-to-draw-qq-plot-in-r\/"},"modified":"2024-10-13T23:13:30","modified_gmt":"2024-10-13T14:13:30","slug":"how-to-draw-qq-plot-in-r","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/how-to-draw-qq-plot-in-r\/","title":{"rendered":"R \u3067 QQ \u30d7\u30ed\u30c3\u30c8\u3092\u66f8\u304f\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u6b63\u898f\u78ba\u7387\u30d7\u30ed\u30c3\u30c8 QQ\u30d7\u30ed\u30c3\u30c8 \u306f\u3001\u6b63\u898f\u5206\u5e03\u3092\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3001\u76ee\u8996\u3067\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u65b9\u6cd5\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u56f3\u3067\u6b63\u898f\u5206\u5e03\u306e\u30c1\u30a7\u30c3\u30af\">\u56f3\u3067\u6b63\u898f\u5206\u5e03\u306e\u30c1\u30a7\u30c3\u30af<\/h2>\n\n\n\n<p>qqnorm()\u3092\u4f7f\u3046\u3002<\/p>\n\n\n\n<p>\u6b63\u898f\u78ba\u7387\u30d7\u30ed\u30c3\u30c8\u3092\u63cf\u304f\u3002<\/p>\n\n\n\n<p>x\u8ef8\u304c\u6b63\u898f\u5206\u5e03\u306e\u8ad6\u7406\u7684\u306a\u5206\u4f4d\u6570\u3001y\u8ef8\u304c\u5b9f\u6e2c\u5024\u306e\u5206\u4f4d\u6570\u3002<\/p>\n\n\n\n<p>\u5bfe\u89d2\u7dda\u4e0a\u306b\u307e\u3063\u3059\u3050\u306b\u3001\u30d7\u30ed\u30c3\u30c8\u304c\u306a\u3089\u3079\u3070\u3001\u6b63\u898f\u5206\u5e03\u3057\u3066\u3044\u308b\u3068\u5224\u65ad\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synIdentifier\">qqnorm<\/span><span class=\"synSpecial\">(<\/span>sleep<span class=\"synSpecial\">$<\/span>extra<span class=\"synSpecial\">)<\/span>\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"587\" height=\"586\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828005413.png\" alt=\"\" class=\"wp-image-2958\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828005413.png 587w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828005413-300x300.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828005413-150x150.png 150w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/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=\"\u30b0\u30eb\u30fc\u30d7\u3054\u3068\u306b\u56f3\u3067\u6b63\u898f\u5206\u5e03\u306e\u30c1\u30a7\u30c3\u30af\">\u30b0\u30eb\u30fc\u30d7\u3054\u3068\u306b\u56f3\u3067\u6b63\u898f\u5206\u5e03\u306e\u30c1\u30a7\u30c3\u30af<\/h2>\n\n\n\n<p>tapply()\u3092\u4f7f\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2\u30b0\u30eb\u30fc\u30d7\u306e\u5834\u5408\">2 \u30b0\u30eb\u30fc\u30d7\u306e\u5834\u5408<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synIdentifier\">layout<\/span><span class=\"synSpecial\">(<\/span><span class=\"synType\">matrix<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">1<\/span><span class=\"synSpecial\">:<\/span><span class=\"synConstant\">4<\/span><span class=\"synSpecial\">,<\/span>nr<span class=\"synStatement\">=<\/span><span class=\"synConstant\">2<\/span><span class=\"synSpecial\">))<\/span>\n<span class=\"synIdentifier\">with<\/span><span class=\"synSpecial\">(<\/span>sleep<span class=\"synSpecial\">,<\/span> <span class=\"synIdentifier\">tapply<\/span><span class=\"synSpecial\">(<\/span>extra<span class=\"synSpecial\">,<\/span> group<span class=\"synSpecial\">,<\/span> qqnorm<span class=\"synSpecial\">))<\/span>\n<span class=\"synIdentifier\">with<\/span><span class=\"synSpecial\">(<\/span>sleep<span class=\"synSpecial\">,<\/span> <span class=\"synIdentifier\">tapply<\/span><span class=\"synSpecial\">(<\/span>extra<span class=\"synSpecial\">,<\/span> group<span class=\"synSpecial\">,<\/span> hist<span class=\"synSpecial\">))<\/span>\n<\/code><\/pre>\n\n\n\n<p>QQ\u30d7\u30ed\u30c3\u30c8\u3068\u4e00\u7dd2\u306b\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3082\u4e26\u3079\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"587\" height=\"586\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828005938.png\" alt=\"\" class=\"wp-image-2959\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828005938.png 587w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828005938-300x300.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828005938-150x150.png 150w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\uff13\u30b0\u30eb\u30fc\u30d7\u306e\u5834\u5408\">3 \u30b0\u30eb\u30fc\u30d7\u306e\u5834\u5408<\/h3>\n\n\n\n<p>MASS\u30d1\u30c3\u30b1\u30fc\u30b8\u306ebirthwt\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u306frace\u3068\u3044\u3046\u5909\u6570\u304c\u3042\u308a\u3001<\/p>\n\n\n\n<p>\u3053\u308c\u306f\uff13\u30b0\u30eb\u30fc\u30d7\u5206\u3051\u306e\u5909\u6570\u3067\u3042\u308b\uff08\uff11\u304cwhite\u3001\uff12\u304cblack\u3001\uff13\u304cothers\uff09\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synIdentifier\">layout<\/span><span class=\"synSpecial\">(<\/span><span class=\"synType\">matrix<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">1<\/span><span class=\"synSpecial\">:<\/span><span class=\"synConstant\">6<\/span><span class=\"synSpecial\">,<\/span> nr<span class=\"synStatement\">=<\/span><span class=\"synConstant\">3<\/span><span class=\"synSpecial\">))<\/span>\n<span class=\"synIdentifier\">with<\/span><span class=\"synSpecial\">(<\/span>birthwt<span class=\"synSpecial\">,<\/span> <span class=\"synIdentifier\">tapply<\/span><span class=\"synSpecial\">(<\/span>bwt<span class=\"synSpecial\">,<\/span>race<span class=\"synSpecial\">,<\/span>hist<span class=\"synSpecial\">))<\/span>\n<span class=\"synIdentifier\">with<\/span><span class=\"synSpecial\">(<\/span>birthwt<span class=\"synSpecial\">,<\/span> <span class=\"synIdentifier\">tapply<\/span><span class=\"synSpecial\">(<\/span>bwt<span class=\"synSpecial\">,<\/span>race<span class=\"synSpecial\">,<\/span>qqnorm<span class=\"synSpecial\">))<\/span>\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"587\" height=\"586\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828010536.png\" alt=\"\" class=\"wp-image-2960\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828010536.png 587w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828010536-300x300.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828010536-150x150.png 150w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<div id=\"biost-3006608950\" 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 QQ \u30d7\u30ed\u30c3\u30c8\u3092\u66f8\u3044\u3066\u3001\u9023\u7d9a\u30c7\u30fc\u30bf\u306e\u6b63\u898f\u6027\u3092\u5927\u4f53\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u53c2\u8003\u306b\u306a\u308c\u3070\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b63\u898f\u78ba\u7387\u30d7\u30ed\u30c3\u30c8 QQ\u30d7\u30ed\u30c3\u30c8 \u306f\u3001\u6b63\u898f\u5206\u5e03\u3092\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3001\u76ee\u8996\u3067\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u65b9\u6cd5\u3002<\/p>\n","protected":false},"author":2,"featured_media":2960,"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,25],"tags":[],"class_list":["post-498","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-25"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2018\/07\/20180828010536.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/498","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=498"}],"version-history":[{"count":3,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/498\/revisions"}],"predecessor-version":[{"id":2963,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/498\/revisions\/2963"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media\/2960"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}