#Problem 3.54 z <- c(2.5,0,3.7,-0.6,1.7,0,5.9,4.6,0,-1.4,5.4,4.6,3.1,-2,6.3) z1 <- z[z!=0] B1 <- sum(z1>0) B1 n1 <- length(z1) n1 B2 <- sum(z>0) B2 n2 <- length(z>0) n2 #(i)Test with discarding zeros binom.test(B1, n1, p=0.5, alternative="greater") #(ii)Test with zeros being negative binom.test(B2, n2, p=0.5, alternative="greater") #p-value for (i) is 0.073 and (ii) is 0.3036 #The p-value for the conservative method (ii) is more than #four times larger and therefore harder to reject than (i).