### Bootstrap: p

###

### Consider a poll related the the Presidential Election of 790 voters. The results

### give 411 to Bush and 379 to Gore. Thus 0.52 favor Bush and 0.48 favor Gore.

### Get a 95% CI for the proportion of voters who favor Bush using the traditional

### CLT formula, p.hat +/- z * sqrt(p.hat*(1-p.hat)/n), where z = 1.96.

### Using Minitab, Stat > Basic Statistics > 1 Proportion > Summarized data > Number

### of trials: 790 > Number of successes: 411

### Use the Bootstrap to plot the Bootstrap distibution of p.hat and give a 95% Boostrap

### Empirical Confidence Interval for p.

# create a data vector

n <- 790

b <- 411

g <- n - b

x <- numeric(n)

x[1:b] <- 1

mean(x)

boot.b <- bootstrap(x,mean)

summary(boot.b)

limits.emp(boot.b)

plot(boot.b)