Download Statistical Analysis of Tick Experiment: Hypothesis Testing and Confidence Intervals and more Study notes Statistics in PDF only on Docsity! Example [Carroll, J Med Entomol 38:114–117, 2001] Place tick on clay island surrounded by water, with two capillary tubes: one treated with deer-gland-substance; one untreated. Does the tick go to the treated or the untreated tube? Tick sex Leg Deer sex treated untreated male fore female 24 5 female fore female 18 5 male fore male 23 4 female fore male 20 4 male hind female 17 8 female hind female 25 3 male hind male 21 6 female hind male 25 2 Is the tick more likely to go to the treated tube? 1 Test for a proportion Suppose X ∼ binomial(n, p). Test H0 : p = 12 vs Ha : p 6= 1 2 Reject H0 if X ≥ H or X ≤ L Choose H and L such that Pr(X ≥ H | p = 12) ≤ α/2 and Pr(X ≤ L | p = 1 2) ≤ α/2 Thus Pr(Reject H0 | H0 is true) ≤ α. The difficulty: The binomial distribution is hard to work with. Because of its discrete nature, you can’t get exactly your desired significance level (α). 2 Rejection region Consider X ∼ binomial(n=29, p) Test of H0 : p = 12 vs Ha : p 6= 1 2 at significance level α = 0.05 Lower critical value: qbinom(0.025, 29, 0.5) = 9 Pr(X ≤ 9) = pbinom(9, 29, 0.5) = 0.031→ L = 8 Upper critical value: qbinom(0.975, 29, 0.5) = 20 Pr(X ≥ 20) = 1-pbinom(20,29,0.5) = 0.031→ H = 21 Reject H0 if X ≤ 8 or X ≥ 21. (For testing H0 : p = 12, H = n – L.) 3 0 5 10 15 20 25 Binomial(n=29, p=1/2) 1.2%1.2% 4 Example X ∼ binomial(n=29, p); observe X = 24 Lower bound of 95% confidence interval: Largest p0 such that Pr(X ≥ 24 | p = p0) ≤ 0.025 Upper bound of 95% confidence interval: Smallest p0 such that Pr(X ≤ 24 | p = p0) ≤ 0.025 In R: binom.test(24,29) 95% CI for p: (0.642, 0.942) Note: p̂ = 24/29 = 0.83 is not the midpoint of the CI 9 0 5 10 15 20 25 Binomial(n=29, p=0.64) 2.5% 0 5 10 15 20 25 Binomial(n=29, p=0.94) 2.5% 10 Example 2 X ∼ binomial(n=25, p); observe X = 17 Lower bound of 95% confidence interval: pL such that 17 is the 97.5 percentile of binomial(n=25, pL) Upper bound of 95% confidence interval: pH such that 17 is the 2.5 percentile of binomial(n=25, pH) In R: binom.test(17,25) 95% CI for p: (0.465, 0.851) Again, p̂ = 17/25 = 0.68 is not the midpoint of the CI 11 0 5 10 15 20 25 Binomial(n=25, p=0.46) 2.5% 0 5 10 15 20 25 Binomial(n=25, p=0.85) 2.5% 12 The case X = 0 Suppose X ∼ binomial(n, p) and we observe X = 0. Lower limit of 95% confidence interval for p: 0 Upper limit of 95% confidence interval for p: pH such that Pr(X ≤ 0 | p = pH) = 0.025 =⇒ Pr(X = 0 | p = pH) = 0.025 =⇒ (1− pH)n = 0.025 =⇒ 1− pH = n √ 0.025 =⇒ pH = 1− n √ 0.025 In the case n = 10 and X = 0, the 95% CI for p is (0, 0.31) 13 A mad cow example New York Times, Feb 3, 2004: The department [of Agriculture] has not changed last year’s plans to test 40,000 cows nationwide this year, out of 30 million slaughtered. Janet Riley, a spokeswoman for the American Meat Institute, which represents slaughterhouses, called that “plenty sufficient from a statistical standpoint.” Suppose that the 40,000 cows tested are chosen at random from the population of 30 million cows, and suppose that 0 (or 1, or 2) are found to be infected. How many of the 30 million total cows would we estimate to be infected? What is the 95% confidence interval for the total number of infected cows? No. infected Obs’d Est’d 95% CI 0 0 0 – 2763 1 750 19 – 4173 2 1500 181 – 5411 14