{"id":566,"date":"2018-06-24T11:02:39","date_gmt":"2018-06-24T02:02:39","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/interval-estimation-of-population-proportion\/"},"modified":"2024-12-29T18:08:41","modified_gmt":"2024-12-29T09:08:41","slug":"interval-estimation-of-population-proportion","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/interval-estimation-of-population-proportion\/","title":{"rendered":"R \u3067\u30a2\u30b0\u30ec\u30b9\u30c6\u30a3\u30b3\u30a6\u30eb\u306e\u5272\u5408\u306e\u4fe1\u983c\u533a\u9593\u3092\u8a08\u7b97\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>R \u3067\u6bcd\u6bd4\u7387\uff08\u6bcd\u96c6\u56e3\u306b\u304a\u3051\u308b\u5272\u5408\uff09\u306e\u533a\u9593\u63a8\u5b9a\u3092\u884c\u3046\u65b9\u6cd5\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u6bcd\u6bd4\u7387\u306e\u4fe1\u983c\u533a\u9593Agresti--Coull\">\u6bcd\u6bd4\u7387\u306e\u4fe1\u983c\u533a\u9593\uff08Agresti &amp; Coull \u306e\u65b9\u6cd5\uff09<\/h2>\n\n\n\n<p>s\u3092\u3001success \u5206\u5b50\uff08\u8a72\u5f53\u6570\uff09\u3068\u3059\u308b\u3002<\/p>\n\n\n\n<p>n\u3092\u3001number&nbsp; \u5206\u6bcd\uff08\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\uff09\u3068\u3059\u308b\u3002<\/p>\n\n\n\n<p>Function\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3060\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bohiritu.conf &lt;- function(s,n){\n  p &lt;- s\/n\n  p.dash &lt;- (s+2)\/(n+4)\n  l.limt &lt;- p.dash-1.96*sqrt((p.dash*(1-p.dash))\/(n+4))\n  u.limt &lt;- p.dash+1.96*sqrt((p.dash*(1-p.dash))\/(n+4))\n  c(\"prop\"=p, \"prop.Agresti\"=p.dash, \"lower.limit\"=l.limt, \"upper.limit\"=u.limt)\n}\n<\/code><\/pre>\n\n\n\n<p>500\u4f8b\u306e\u3046\u3061175\u4f8b\u304c\u967d\u6027\u3060\u3063\u305f\u3068\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u6642\u306e\u533a\u9593\u63a8\u5b9a\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synStatement\">&gt;<\/span> <span class=\"synIdentifier\">bohiritu.conf<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">175<\/span><span class=\"synSpecial\">,<\/span><span class=\"synConstant\">500<\/span><span class=\"synSpecial\">)<\/span>\n     prop prop.Agresti  lower.limit  upper.limit\n<span class=\"synConstant\">0.3500000<\/span>    <span class=\"synConstant\">0.3511905<\/span>    <span class=\"synConstant\">0.3095159<\/span>    <span class=\"synConstant\">0.3928650<\/span>\n<\/code><\/pre>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u4e8c\u9805\u5206\u5e03\u3067\u63a8\u5b9a\u3059\u308b\u3068\u3053\u3046\u306a\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt; binom.test(175, 500)\n\n\tExact binomial test\n\ndata:  175 and 500\nnumber of successes = 175, number of trials = 500, p-value = 1.903e-11\nalternative hypothesis: true probability of success is not equal to 0.5\n95 percent confidence interval:\n 0.3081869 0.3935989\nsample estimates:\nprobability of success \n                  0.35 \n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u6bcd\u6bd4\u7387\u306e\u533a\u9593\u63a8\u5b9a\u4e8c\u9805\u5206\u5e03\u306b\u57fa\u3065\u304f\u65b9\u6cd5\">\u6bcd\u6bd4\u7387\u306e\u533a\u9593\u63a8\u5b9a\uff08\u4e8c\u9805\u5206\u5e03\u306b\u57fa\u3065\u304f\u65b9\u6cd5\uff09<\/h2>\n\n\n\n<p>binom.test()\u3067\u4e8c\u9805\u5206\u5e03\u306b\u57fa\u3065\u3044\u3066\uff0c\u533a\u9593\u63a8\u5b9a\u306e\u7d50\u679c\u304c\u5f97\u3089\u308c\u308b\u3002<\/p>\n\n\n\n<p>100\u4f8b\u4e2d3\u4f8b\u967d\u6027\u3060\u3063\u305f\u5834\u5408\u306e\u533a\u9593\u63a8\u5b9a\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<p>95 percent confidence interval\u306e\u9805\u304c\u533a\u9593\u63a8\u5b9a\u7bc4\u56f2\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt; binom.test(3, 100)\n\n\tExact binomial test\n\ndata:  3 and 100\nnumber of successes = 3, number of trials = 100, p-value &lt; 2.2e-16\nalternative hypothesis: true probability of success is not equal to 0.5\n95 percent confidence interval:\n 0.006229972 0.085176053\nsample estimates:\nprobability of success \n                  0.03 \n<\/code><\/pre>\n\n\n\n<p>1000\u4f8b\u4e2d30\u4f8b\u967d\u6027\u306e\u5834\u5408\u306f\u3069\u3046\u304b\uff1f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt; binom.test(30, 1000)\n\n\tExact binomial test\n\ndata:  30 and 1000\nnumber of successes = 30, number of trials = 1000, p-value &lt; 2.2e-16\nalternative hypothesis: true probability of success is not equal to 0.5\n95 percent confidence interval:\n 0.02033049 0.04255140\nsample estimates:\nprobability of success \n                  0.03 \n<\/code><\/pre>\n\n\n\n<p>\u5272\u5408\u306f\u540c\u30583%\u3060\u304c\u3001\u63a8\u5b9a\u7bc4\u56f2\u306f\u72ed\u304f\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u5206\u6bcd\u304c\u5927\u304d\u304f\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u63a8\u5b9a\u7cbe\u5ea6\u304c\u4e0a\u304c\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<div id=\"biost-2072027172\" 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=\"\u5272\u5408\u306e\u4fe1\u983c\u533a\u9593\u30a8\u30af\u30bb\u30eb\u8a08\u7b97\u6a5f\">\u5272\u5408\u306e\u4fe1\u983c\u533a\u9593\u30a8\u30af\u30bb\u30eb\u8a08\u7b97\u6a5f<\/h2>\n\n\n\n<p>\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u826f\u3051\u308c\u3070\u3069\u3046\u305e\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/happyhappygk.base.ec\/items\/34122108\">\u5272\u5408\u306e\u4fe1\u983c\u533a\u9593\u8a08\u7b97\u6a5f\u3010\u30a8\u30af\u30bb\u30eb\u8a08\u7b97\u6a5f\u3011 | TKER SHOP<\/a><\/p>\n\n\n\n<p>\u4f7f\u3044\u65b9\u52d5\u753b\u3092\u4f5c\u6210\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u3061\u3089\u3082\u3088\u3051\u308c\u3070\u3002<\/p>\n\n\n\n<p><iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/A_1wiwOKhik?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen=\"allowfullscreen\" title=\"\u5272\u5408\u306e\u4fe1\u983c\u533a\u9593\u30a8\u30af\u30bb\u30eb\u8a08\u7b97\u6a5f\"><\/iframe><cite class=\"hatena-citation\"><a href=\"https:\/\/youtu.be\/A_1wiwOKhik\">youtu.be<\/a><\/cite><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5272\u5408\u306e\u4fe1\u983c\u533a\u9593\u8a08\u7b97\u30a2\u30d7\u30ea<\/h2>\n\n\n\n<p>\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u306f\u3053\u3061\u3089\u2193<\/p>\n\n\n\n<p><a href=\"https:\/\/happyhappygk.base.ec\/items\/96256224\" data-type=\"link\" data-id=\"https:\/\/happyhappygk.base.ec\/items\/96256224\">\u5272\u5408\u306e\u4fe1\u983c\u533a\u9593\u8a08\u7b97\u30a2\u30d7\u30ea\u3010Win \u7248\u3011<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/happyhappygk.base.ec\/items\/96582179\" data-type=\"link\" data-id=\"https:\/\/happyhappygk.base.ec\/items\/96582179\">\u5272\u5408\u306e\u4fe1\u983c\u533a\u9593\u8a08\u7b97\u30a2\u30d7\u30ea\u3010Mac \u7248\u3011<\/a><\/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\u6bcd\u6bd4\u7387\u3092\u533a\u9593\u63a8\u5b9a\u3059\u308b\u65b9\u6cd5\u3068\u3057\u3066\u3001Agresti-Coull \u306e\u65b9\u6cd5\u3068\u4e8c\u9805\u5206\u5e03\u306b\u3088\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u53c2\u8003\u306b\u306a\u308c\u3070\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u53c2\u8003\u6587\u732e\">\u53c2\u8003\u6587\u732e<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.tandfonline.com\/doi\/abs\/10.1080\/00031305.1998.10480550\" data-type=\"link\" data-id=\"https:\/\/www.tandfonline.com\/doi\/abs\/10.1080\/00031305.1998.10480550\">Approximate is Better than \u201cExact\u201d for Interval Estimation of Binomial Proportions<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u53c2\u8003\u66f8\u7c4d\">\u53c2\u8003\u66f8\u7c4d<\/h2>\n\n\n\n<p><a href=\"https:\/\/amzn.to\/49BCCBf\" data-type=\"link\" data-id=\"https:\/\/amzn.to\/49BCCBf\">R\u306b\u3088\u308b\u4fdd\u5065\u533b\u7642\u30c7\u30fc\u30bf\u89e3\u6790\u6f14\u7fd2<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>R \u3067\u6bcd\u6bd4\u7387\uff08\u6bcd\u96c6\u56e3\u306b\u304a\u3051\u308b\u5272\u5408\uff09\u306e\u533a\u9593\u63a8\u5b9a\u3092\u884c\u3046\u65b9\u6cd5\u3002<\/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,30,9],"tags":[],"class_list":["post-566","post","type-post","status-publish","format-standard","hentry","category-r","category-30","category-9"],"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\/566","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=566"}],"version-history":[{"count":7,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/566\/revisions"}],"predecessor-version":[{"id":3368,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/566\/revisions\/3368"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}