{"id":125,"date":"2023-02-24T21:49:55","date_gmt":"2023-02-24T12:49:55","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/sample-size-determination-for-chi-squared-test-of-independence\/"},"modified":"2024-09-01T09:40:57","modified_gmt":"2024-09-01T00:40:57","slug":"sample-size-determination-for-chi-squared-test-of-independence","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/sample-size-determination-for-chi-squared-test-of-independence\/","title":{"rendered":"R \u3067\u30ab\u30a4\u4e8c\u4e57\u691c\u5b9a\u306b\u5fc5\u8981\u306a\u30b5\u30f3\u30d7\u30eb\u6570\u3092\u8a08\u7b97\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u30ab\u30a4\u4e8c\u4e57\u691c\u5b9a\u306e\u305f\u3081\u306e\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\u8a08\u7b97\u306e\u65b9\u6cd5<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\">\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>R \u306e pwr \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4f7f\u7528\u3059\u308b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synIdentifier\">install.packages<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">'pwr'<\/span><span class=\"synSpecial\">)<\/span> <span class=\"synComment\"># 1 \u56de\u3060\u3051\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span>\n<span class=\"synPreProc\">library<\/span><span class=\"synSpecial\">(<\/span>pwr<span class=\"synSpecial\">)<\/span>\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\u8a08\u7b97\u3092\u3059\u308b\u5206\u5272\u8868\u306e\u4f8b\">\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\u8a08\u7b97\u3092\u3059\u308b\u5206\u5272\u8868\u306e\u4f8b<\/h2>\n\n\n\n<p>\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\u8a08\u7b97\u3092\u3059\u308b\u5206\u5272\u8868\u306f\u4ee5\u4e0b\u306e\u5272\u5408\u306e 2 x 4 \u306e\u5206\u5272\u8868\u3068\u3059\u308b<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"193\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224212529-1024x193.png\" alt=\"\" class=\"wp-image-1033\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224212529-1024x193.png 1024w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224212529-300x57.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224212529-768x145.png 768w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224212529.png 1046w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u5168\u4f53\u3067 1000 \u4f8b\u3068\u3059\u308c\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u4eba\u6570\u5206\u5e03\u306b\u306a\u308b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"361\" height=\"165\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224212715.png\" alt=\"\" class=\"wp-image-1034\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224212715.png 361w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224212715-300x137.png 300w\" sizes=\"(max-width: 361px) 100vw, 361px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<div id=\"biost-2859947515\" 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=\"R-\u30b9\u30af\u30ea\u30d7\u30c8\">R \u30b9\u30af\u30ea\u30d7\u30c8<\/h2>\n\n\n\n<p>\u4e0a\u8a18\u306e\u5206\u5272\u8868\u3068\u3057\u305f\u5834\u5408\u306e\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u8a08\u7b97\u3067\u304d\u308b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>prob<span class=\"synStatement\">&lt;-<\/span><span class=\"synType\">matrix<\/span><span class=\"synSpecial\">(<\/span><span class=\"synIdentifier\">c<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">0.225<\/span><span class=\"synSpecial\">,<\/span><span class=\"synConstant\">0.125<\/span><span class=\"synSpecial\">,<\/span><span class=\"synConstant\">0.125<\/span><span class=\"synSpecial\">,<\/span><span class=\"synConstant\">0.125<\/span><span class=\"synSpecial\">,<\/span><span class=\"synConstant\">0.16<\/span><span class=\"synSpecial\">,<\/span><span class=\"synConstant\">0.16<\/span><span class=\"synSpecial\">,<\/span><span class=\"synConstant\">0.04<\/span><span class=\"synSpecial\">,<\/span><span class=\"synConstant\">0.04<\/span><span class=\"synSpecial\">),<\/span>nrow<span class=\"synStatement\">=<\/span><span class=\"synConstant\">2<\/span><span class=\"synSpecial\">,<\/span>byrow<span class=\"synStatement\">=<\/span><span class=\"synConstant\">TRUE<\/span><span class=\"synSpecial\">)<\/span>\nprob\n<span class=\"synIdentifier\">ES.w2<\/span><span class=\"synSpecial\">(<\/span>prob<span class=\"synSpecial\">)<\/span>\n<span class=\"synIdentifier\">pwr.chisq.test<\/span><span class=\"synSpecial\">(<\/span>w<span class=\"synStatement\">=<\/span><span class=\"synIdentifier\">ES.w2<\/span><span class=\"synSpecial\">(<\/span>prob<span class=\"synSpecial\">),<\/span>df<span class=\"synStatement\">=<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">2<\/span><span class=\"synStatement\">-<\/span><span class=\"synConstant\">1<\/span><span class=\"synSpecial\">)<\/span><span class=\"synStatement\">*<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">4<\/span><span class=\"synStatement\">-<\/span><span class=\"synConstant\">1<\/span><span class=\"synSpecial\">),<\/span> power<span class=\"synStatement\">=<\/span><span class=\"synConstant\">0.8<\/span><span class=\"synSpecial\">)<\/span>\n<\/code><\/pre>\n\n\n\n<p>\u5206\u5272\u8868\u306e\u5272\u5408\u3092\u4f7f\u3063\u3066\u3001ES.w2() \u95a2\u6570\u3067\u52b9\u679c\u91cf w \u3092\u8a08\u7b97\u3059\u308b<\/p>\n\n\n\n<p>\u81ea\u7531\u5ea6 df \u306f\u3001\u884c\u3068\u5217\u305d\u308c\u305e\u308c\u304b\u3089 1 \u3092\u5f15\u3044\u305f\u6570\u306e\u7a4d\u3068\u306a\u308b<\/p>\n\n\n\n<p>\u691c\u51fa\u529b\u3092 80 % ( 0.8 ) \u3068\u3059\u308b<\/p>\n\n\n\n<p>\u305d\u3046\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u901a\u308a\u3001167 \u4f8b\u5fc5\u8981\u3068\u8a08\u7b97\u3055\u308c\u308b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"684\" height=\"362\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224213124.png\" alt=\"\" class=\"wp-image-1035\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224213124.png 684w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224213124-300x159.png 300w\" sizes=\"(max-width: 684px) 100vw, 684px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<p>\u60f3\u5b9a\u3057\u3066\u3044\u305f\u5272\u5408\u306b\u304b\u3051\u5408\u308f\u305b\u3066\u3001\u60f3\u5b9a\u306e\u4eba\u6570\u3092\u8a08\u7b97\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"362\" height=\"227\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224213333.png\" alt=\"\" class=\"wp-image-1036\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224213333.png 362w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2023\/02\/20230224213333-300x188.png 300w\" sizes=\"(max-width: 362px) 100vw, 362px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<p>\u30bb\u30eb\u3054\u3068\u306b\u4e38\u3081\u3066\u3044\u308b\u306e\u3067\u3001\u5408\u8a08\u3057\u3066\u691c\u7b97\u3059\u308b\u3068 1 \u4f8b\u305a\u308c\u3066\u3044\u308b\u304c\u3001\u3053\u308c\u306f\u3084\u3080\u3092\u5f97\u306a\u3044<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u52b9\u679c\u91cf w \u306f\u3001\u7d04 0.26 \u3067\u3042\u308b<\/p>\n\n\n\n<p>Cohen \u306b\u3088\u308c\u3070\u3001w \u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u53c2\u8003\u306b\u3067\u304d\u308b\u6163\u4f8b\u304c\u3042\u308b<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5c0f\u3055\u3044\u52b9\u679c\u91cf\uff1a0.1<\/li>\n\n\n\n<li>\u4e2d\u7b49\u5ea6\u52b9\u679c\u91cf\uff1a0.3<\/li>\n\n\n\n<li>\u5927\u304d\u3044\u52b9\u679c\u91cf\uff1a0.5<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u307e\u3068\u3081\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u72ec\u7acb\u6027\u306e\u691c\u5b9a\u3092\u30ab\u30a4\u4e8c\u4e57\u691c\u5b9a\u3067\u884c\u3046\u3068\u304d\u306e\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\u8a08\u7b97\u306e\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u305f<\/p>\n\n\n\n<p>\u53c2\u8003\u306b\u306a\u308c\u3070<\/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:\/\/www.utstat.toronto.edu\/~brunner\/oldclass\/378f16\/readings\/CohenPower.pdf\">Jacob Cohen. Statistical Power Analysis for the Behavioral Sciences Second Edition.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ab\u30a4\u4e8c\u4e57\u691c\u5b9a\u306e\u305f\u3081\u306e\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30ba\u8a08\u7b97\u306e\u65b9\u6cd5<\/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,50,16],"tags":[],"class_list":["post-125","post","type-post","status-publish","format-standard","hentry","category-r","category-50","category-16"],"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\/125","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=125"}],"version-history":[{"count":1,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":1037,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/125\/revisions\/1037"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}