Question: Use R programming please In the prelab, you learned how to build the (empirical) sampling distribution of the sample mean (and sample median). But as
Use R programming please
In the prelab, you learned how to build the (empirical) sampling distribution of the sample mean (and sample median). But as woe have discussed in class, one can build the sampling distribution for any sample statistic, e.g., sample proportion and sample stan devnation. In the first two parts of this qz, we will do that. In the last/third part, we test the coverage of a confidence interval (CI) Part I: Sampling distribution of the sample proportion To build the (empirical) sampling distribution of the sample proportion, consider an infinitely large population of Os and 1s, with the proportion of Is given by a parameter pi 2) reach in and take a sample of size n, 3) compute the proportion of 1s in the sample (i.e., the number of 1s divided by n) 4) repeat steps 2 and 3 ntrial times, and finally 5) make a histogram of the ntrial sample proportions. a) Write code to build that sampling distribution for samples of size 1000. Set ntrial to 10000, and pi 0.1. Hints rbinom(n, 1,0.1) takes a sample of size n from an infinite population of Os and 1s, with the proportion of 1s given by pi 0.1 -To count the number of 1s in an array of Os and 1s, use sumO b) Use a Normal qgplot to confirm that that sampling distribution is reasonably Normal, and then use the qqplot to estimate AND REPORT the mu and sigma parameters of that distribution (this last step may involve some trial-and-error) c) In lecture (and in hw) we have seen two equations that have the mean and standard deviation you found in part b (for the sampling distribution) on their left-hand side, and some population parameters on their right-hand side. What are the two equations I'm asking about? Write them down to the best of your abilities (without any equation editors). d) The left-hand side of those two equations are the mean and the standard deviation you found in part b. Find/report the numerical value of the right-hand sides; they should be close to the left-hand sides. In the prelab, you learned how to build the (empirical) sampling distribution of the sample mean (and sample median). But as woe have discussed in class, one can build the sampling distribution for any sample statistic, e.g., sample proportion and sample stan devnation. In the first two parts of this qz, we will do that. In the last/third part, we test the coverage of a confidence interval (CI) Part I: Sampling distribution of the sample proportion To build the (empirical) sampling distribution of the sample proportion, consider an infinitely large population of Os and 1s, with the proportion of Is given by a parameter pi 2) reach in and take a sample of size n, 3) compute the proportion of 1s in the sample (i.e., the number of 1s divided by n) 4) repeat steps 2 and 3 ntrial times, and finally 5) make a histogram of the ntrial sample proportions. a) Write code to build that sampling distribution for samples of size 1000. Set ntrial to 10000, and pi 0.1. Hints rbinom(n, 1,0.1) takes a sample of size n from an infinite population of Os and 1s, with the proportion of 1s given by pi 0.1 -To count the number of 1s in an array of Os and 1s, use sumO b) Use a Normal qgplot to confirm that that sampling distribution is reasonably Normal, and then use the qqplot to estimate AND REPORT the mu and sigma parameters of that distribution (this last step may involve some trial-and-error) c) In lecture (and in hw) we have seen two equations that have the mean and standard deviation you found in part b (for the sampling distribution) on their left-hand side, and some population parameters on their right-hand side. What are the two equations I'm asking about? Write them down to the best of your abilities (without any equation editors). d) The left-hand side of those two equations are the mean and the standard deviation you found in part b. Find/report the numerical value of the right-hand sides; they should be close to the left-hand sides
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
