#### Example 1: Exact hypothesis test: # The exact binomial test: binom.test(x=14, n=17, p=0.60, alternative="greater") #### Example 2: Exact hypothesis test: # The exact binomial test: binom.test(x=8, n=19, p=0.35, alternative="two.sided") ########################################################### ### Finding Clopper-Pearson confidence intervals: #### Example 2 again: Exact CI: # The Clopper-Pearson CI for p (note 95% is the default confidence level): binom.test(x=8, n=19, alternative="two.sided")$conf.int # Using a 98% confidence level: binom.test(x=8, n=19, alternative="two.sided", conf.level=0.98)$conf.int #### Example 1 again: Exact CI: # The Clopper-Pearson 90% CI for p: binom.test(x=14, n=17, alternative="two.sided", conf.level=0.90)$conf.int # A 90% lower confidence bound: binom.test(x=14, n=17, alternative="greater", conf.level=0.90)$conf.int #### An alternative CI method: The Wilson score CI: # Example 2: prop.test(x=8, n=19, alternative="two.sided")$conf.int # Using a 98% confidence level: prop.test(x=8, n=19, alternative="two.sided", conf.level=0.98)$conf.int ## Which method produces shorter intervals in this example?