StatsHomework2 - Stats 3003 Homework Set 2 1. Resampling a...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Stats 3003 Homework Set 2 1. Resampling a Proportion For a binomial experiment, the proportion and its confidence interval can often be estimated easily, using de Moivre’s theorem. This analytical approach is fairly complicated, but we can do something simpler that’s just as effective; we can bootstrap. The idea is to draw a sample, with replacement, from our original sample, and get a “second opinion” estimate. We do this repeatedly (say 1000 times), and see how these resampling estimates vary. The /2 and 1 /2 quantiles of the resampled estimates give us a workable confidence interval. α −α Write an R program that calculates a bootstrap estimate of the success proportion for a sample of size n = 3000 where only x = 10 successes were observed, and calculate a 90% confidence interval (so = α 0.1) You can use this program as a guide: boot.p.hat <- function(s, reps=1000, alpha) { bp <- array(dim=reps) for (i in 1:reps) { } rs <- sample(s, length(s), replace=TRUE) bp[i] <- sum(rs)/length(rs) } hist(bp, main="Bootstrap Estimate of Proportion",freq=FALSE) lines(density(bp),col="blue") quantile(bp, c(alpha/2, 0.5, 1.0-alpha/2), type=9) s <- c(rep(1,45),rep(0,55)) # PUT YOUR DATA IN HERE boot.p.hat(s, 1000,0.05) For your answer, show the histogram, and your estimate and confidence interval in a simple paragraph. The Bootstrap part of the graph displays the ninety percent confidence level that was calculated in the equation. Both graphs are concurrent with each other and the data provided.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2. The Birthday Problem, Revisited How many common birthdays in a large group? For a group of 730 students, use a Poisson approximation to find the estimated number of days where there are k common birth days, with k = 0, 1, . . . , 7. Show your results as a bar graph.   Number of Days during the year this probability would occur
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

StatsHomework2 - Stats 3003 Homework Set 2 1. Resampling a...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online