# R-program for Supplementary Exercise 4.10 of IPS7e set.seed(21092015) agree20 <- rbinom(100, 20, 0.3) agree20pct <- agree20/20*100 summary(agree20pct) mean(agree20pct) sd(agree20pct) # repeat for 320 trials agree320 <- rbinom(100, 320, 0.3) agree320pct <- agree320/320*100 summary(agree320pct) mean(agree320pct) sd(agree320pct)