Doc3

.docx
This is a preview
Want to read all 3 pages? Go Premium today.
View Full Document
Already Premium? Sign in here
# On your own # So far, we have only focused on estimating the mean living area in homes in Ames. # Now you'll try to estimate the mean home price. # .Take a random sample of size 50 from price . Using this sample, what is your # best point estimate of the population mean? > set.seed(520) > sampprice1 = sample(price, 50) > summary(sampprice1) Min. 1st Qu. Median Mean 3rd Qu. Max. 82000 130250 157000 177205 216250 421250 #Answer: point estimate of the population mean was 177205. # .Since you have access to the population, simulate the sampling distribution # for $\bar{x}_{price}$ price (sampling mean of price ) by taking 5000 samples from # the population of size 50 and computing 5000 sample means. # Store these means in a vector called sample_means50 . Plot the data, # then describe the shape of this sampling distribution. # Based on this sampling distribution, what would you guess the mean home price of # the population to be? Finally, calculate and report the population mean. > set.seed(520) > sample_means50 <- rep(NA, 5000) > for(i in 1:5000){ + samp <- sample(price, 50) + sample_means50[i] <- mean(samp) + } > hist(sample_means50, breaks = 25) > summary(sample_means50) Min. 1st Qu. Median Mean 3rd Qu. Max. 144726 172613 180309 180823 188420 229463 > summary(price) Min. 1st Qu. Median Mean 3rd Qu. Max. 12789 129500 160000 180796 213500 755000 >
#Answer: #The sampling distribution is close to a normal distribution. #I would guess the mean home price of the population to be 180823. #The population mean was 180796. # .Change your sample size from 50 to 150, then compute the sampling distribution # using the same method as above, and store these means in a new vector called # sample_means150 . Describe the shape of this sampling distribution, and compare # it to the sampling distribution for a sample size of 50. # Based on this sampling distribution, what would you guess to be the mean sale # price of homes in Ames? > set.seed(520) > sample_means150 <- rep(NA, 5000) > for(i in 1:5000){ + samp <- sample(price, 150) + sample_means150[i] <- mean(samp) + } > hist(sample_means150, breaks = 25) > summary(sample_means150)
Min. 1st Qu. Median Mean 3rd Qu. Max. 160189 176417 180707 180865 185204 203445 #Answer: #The sampling distribution is close to a normal distribution. #Compared to the previous distribution, this distribution has a smaller spread. #I would guess the mean home price of the population to be 180865. # .Of the sampling distributions from 2 and 3, which has a smaller spread? # If we're concerned with making estimates that are more often close to the # true value, would we prefer a distribution with a large or small spread? #Answer: #Sampling distribution from 3 has a smaller spread. #I would prefer a distribution with a small spread.
Why is this page out of focus?
Because this is a Premium document. Subscribe to unlock this document and more.
Page1of 3
Uploaded by hmanny520 on coursehero.com