HW 6, Part 2, Question 2

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

HW 6, Part 2, Question 2

Chelsi Whitely
If we are not attaching the plots, what proportions do we need to record after repeating the process ten times? Attaching the plot is the only thing I can think of right now.
Reply | Threaded
Open this post in threaded view
|

Re: HW 6, Part 2, Question 2

Taeho Kim
Administrator
Hi Chelsi,

We are interested in the the confidence intervals (CIs) which contains the true mean value out of total 50 CIs.
Each picture shows you the CIs which DOES NOT contain the true mean by coloring those.
So, based on your visual observation of each trial, calculate the following proportion:

 # of CIs which contains the true value / Total # of CIs (50)

Repeat this 10 times. for question 2.

Reply | Threaded
Open this post in threaded view
|

Re: HW 6, Part 2, Question 2

Chelsi Whitely
population <- ames$Gr.Liv.Area
samp_mean <- rep(NA, 10)
n <- 60
pop_sd<-sd(population) # save population sd
for(i in 1:50){
    samp <- sample(population, n) # obtain a sample of size n = 60 from the population
    samp_mean[i] <- mean(samp)    # save sample mean in ith element of samp_mean
}
lower_vector <- samp_mean - 1.96 * pop_sd / sqrt(n)
upper_vector <- samp_mean + 1.96 * pop_sd / sqrt(n)

plot_ci(lower_vector, upper_vector, mean(population))

I put this in R-Studio and it gave me a plot. So, the do I just do:

>p <-1-(2/10)
>p
[1] 0.8
Reply | Threaded
Open this post in threaded view
|

Re: HW 6, Part 2, Question 2

Taeho Kim
Administrator
Okay, Chelsi.

It can be your first trial.
Now you should see some red bars in the plot.
What is the meaning of the red bars?
Also, how many red bars can you observe this time?