# apple orchard example prop.test(35,200,p=.2,correct=0) prop.test(26,200,p=.2,correct=0) prop.test(45,200,p=.2,correct=0) prop.test(54,200,p=.2,correct=0) prop.test(52,200,p=.2,correct=0) # tax law change example prop.test(52,100,p=.5,correct=0) prop.test(64,100,p=.5,correct=0) prop.test(64,90,p=.5,correct=0) # shipment of electronic devices example prop.test(16,200,p=.06,correct=0) prop.test(20,200,p=.06,correct=0) # machine parts example prop.test(54,200,p=.35,correct=0) # Mendel's flower color experiment prop.test(705,929,p=.75,correct=0) # all of the above with continuity correction # apple orchard example prop.test(35,200,p=.2,correct=1) prop.test(26,200,p=.2,correct=1) prop.test(45,200,p=.2,correct=1) prop.test(54,200,p=.2,correct=1) prop.test(52,200,p=.2,correct=1) # tax law change example prop.test(52,100,p=.5,correct=1) prop.test(64,100,p=.5,correct=1) prop.test(64,90,p=.5,correct=1) # shipment of electronic devices example prop.test(16,200,p=.06,correct=1) prop.test(20,200,p=.06,correct=1) # machine parts example prop.test(54,200,p=.35,correct=1) # Mendel's flower color experiment prop.test(705,929,p=.75,correct=1) -------------- results -------------------- > # apple orchard example > prop.test(35,200,p=.2,correct=0) 1-sample proportions test without continuity correction data: 35 out of 200, null probability 0.2 X-squared = 0.7812, df = 1, p-value = 0.3768 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.1286052 0.2336443 sample estimates: p 0.175 > prop.test(26,200,p=.2,correct=0) 1-sample proportions test without continuity correction data: 26 out of 200, null probability 0.2 X-squared = 6.125, df = 1, p-value = 0.01333 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.09028202 0.18366352 sample estimates: p 0.13 > prop.test(45,200,p=.2,correct=0) 1-sample proportions test without continuity correction data: 45 out of 200, null probability 0.2 X-squared = 0.7812, df = 1, p-value = 0.3768 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.1726237 0.2877412 sample estimates: p 0.225 > prop.test(54,200,p=.2,correct=0) 1-sample proportions test without continuity correction data: 54 out of 200, null probability 0.2 X-squared = 6.125, df = 1, p-value = 0.01333 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.2132345 0.3354344 sample estimates: p 0.27 > prop.test(52,200,p=.2,correct=0) 1-sample proportions test without continuity correction data: 52 out of 200, null probability 0.2 X-squared = 4.5, df = 1, p-value = 0.03389 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.2041383 0.3249075 sample estimates: p 0.26 > # tax law change example > prop.test(52,100,p=.5,correct=0) 1-sample proportions test without continuity correction data: 52 out of 100, null probability 0.5 X-squared = 0.16, df = 1, p-value = 0.6892 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.4231658 0.6153545 sample estimates: p 0.52 > prop.test(64,100,p=.5,correct=0) 1-sample proportions test without continuity correction data: 64 out of 100, null probability 0.5 X-squared = 7.84, df = 1, p-value = 0.00511 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.5423540 0.7272878 sample estimates: p 0.64 > prop.test(64,90,p=.5,correct=0) 1-sample proportions test without continuity correction data: 64 out of 90, null probability 0.5 X-squared = 16.0444, df = 1, p-value = 6.187e-05 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.6103596 0.7945787 sample estimates: p 0.7111111 > # shipment of electronic devices example > prop.test(16,200,p=.06,correct=0) 1-sample proportions test without continuity correction data: 16 out of 200, null probability 0.06 X-squared = 1.4184, df = 1, p-value = 0.2337 alternative hypothesis: true p is not equal to 0.06 95 percent confidence interval: 0.04984059 0.12598949 sample estimates: p 0.08 > prop.test(20,200,p=.06,correct=0) 1-sample proportions test without continuity correction data: 20 out of 200, null probability 0.06 X-squared = 5.6738, df = 1, p-value = 0.01722 alternative hypothesis: true p is not equal to 0.06 95 percent confidence interval: 0.06567045 0.14940581 sample estimates: p 0.1 > # machine parts example > prop.test(54,200,p=.35,correct=0) 1-sample proportions test without continuity correction data: 54 out of 200, null probability 0.35 X-squared = 5.6264, df = 1, p-value = 0.01769 alternative hypothesis: true p is not equal to 0.35 95 percent confidence interval: 0.2132345 0.3354344 sample estimates: p 0.27 > # Mendel's flower color experiment > prop.test(705,929,p=.75,correct=0) 1-sample proportions test without continuity correction data: 705 out of 929, null probability 0.75 X-squared = 0.3907, df = 1, p-value = 0.5319 alternative hypothesis: true p is not equal to 0.75 95 percent confidence interval: 0.7303435 0.7852854 sample estimates: p 0.7588805 > # all of the above with continuity correction > # apple orchard example > prop.test(35,200,p=.2,correct=1) 1-sample proportions test with continuity correction data: 35 out of 200, null probability 0.2 X-squared = 0.6328, df = 1, p-value = 0.4263 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.1264402 0.2363814 sample estimates: p 0.175 > prop.test(26,200,p=.2,correct=1) 1-sample proportions test with continuity correction data: 26 out of 200, null probability 0.2 X-squared = 5.6953, df = 1, p-value = 0.01701 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.08819814 0.18648006 sample estimates: p 0.13 > prop.test(45,200,p=.2,correct=1) 1-sample proportions test with continuity correction data: 45 out of 200, null probability 0.2 X-squared = 0.6328, df = 1, p-value = 0.4263 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.1703931 0.2904135 sample estimates: p 0.225 > prop.test(54,200,p=.2,correct=1) 1-sample proportions test with continuity correction data: 54 out of 200, null probability 0.2 X-squared = 5.6953, df = 1, p-value = 0.01701 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.2109568 0.3380601 sample estimates: p 0.27 > prop.test(52,200,p=.2,correct=1) 1-sample proportions test with continuity correction data: 52 out of 200, null probability 0.2 X-squared = 4.1328, df = 1, p-value = 0.04206 alternative hypothesis: true p is not equal to 0.2 95 percent confidence interval: 0.2018704 0.3275428 sample estimates: p 0.26 > # tax law change example > prop.test(52,100,p=.5,correct=1) 1-sample proportions test with continuity correction data: 52 out of 100, null probability 0.5 X-squared = 0.09, df = 1, p-value = 0.7642 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.4183183 0.6201278 sample estimates: p 0.52 > prop.test(64,100,p=.5,correct=1) 1-sample proportions test with continuity correction data: 64 out of 100, null probability 0.5 X-squared = 7.29, df = 1, p-value = 0.006934 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.5372745 0.7318279 sample estimates: p 0.64 > prop.test(64,90,p=.5,correct=1) 1-sample proportions test with continuity correction data: 64 out of 90, null probability 0.5 X-squared = 15.2111, df = 1, p-value = 9.614e-05 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.6045394 0.7993990 sample estimates: p 0.7111111 > # shipment of electronic devices example > prop.test(16,200,p=.06,correct=1) 1-sample proportions test with continuity correction data: 16 out of 200, null probability 0.06 X-squared = 1.086, df = 1, p-value = 0.2974 alternative hypothesis: true p is not equal to 0.06 95 percent confidence interval: 0.04790261 0.12894742 sample estimates: p 0.08 > prop.test(20,200,p=.06,correct=1) 1-sample proportions test with continuity correction data: 20 out of 200, null probability 0.06 X-squared = 4.9867, df = 1, p-value = 0.02554 alternative hypothesis: true p is not equal to 0.06 95 percent confidence interval: 0.06366294 0.15229666 sample estimates: p 0.1 > # machine parts example > prop.test(54,200,p=.35,correct=1) 1-sample proportions test with continuity correction data: 54 out of 200, null probability 0.35 X-squared = 5.2802, df = 1, p-value = 0.02157 alternative hypothesis: true p is not equal to 0.35 95 percent confidence interval: 0.2109568 0.3380601 sample estimates: p 0.27 > # Mendel's flower color experiment > prop.test(705,929,p=.75,correct=1) 1-sample proportions test with continuity correction data: 705 out of 929, null probability 0.75 X-squared = 0.3448, df = 1, p-value = 0.5571 alternative hypothesis: true p is not equal to 0.75 95 percent confidence interval: 0.7297867 0.7858006 sample estimates: p 0.7588805 >