# Examples Test of Binomial proportion # Edps 587 # C.J.Anderson # # Exact tests and confidence intervals for # US presidents # GSS regarding abortion # 2000 election: Bush vs Gore # # US presidents: Taller candidate won (as in the lecture notes) N<- 15 y<- 13 (binom.test(y,N,alternative=c("less"),conf.level=.95)) # GSS: ok for pregnant woman to have aborition if can't afford it ? yes <- 974 no <- 954 N <- yes+no (binom.test(yes,N,alternative=c("two.sided"),conf.level=.95)) # 2000 election: Bush vs Gore in Florida bush <- 2912790 gore <- 2912253 n <- bush + gore (binom.test(bush,n,alternative=c("greater"),conf.level=.99)) (binom.test(bush,n,alternative=c("two.sided"),conf.level=.99))