Doc3

.docx
This is a preview
# 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 >