Question: 2. Plot from scratch [20] . Create a plot that will illustrate how confidence intervals need to be interpreted (from a frequentist approach). For that
![2. Plot from scratch [20] . Create a plot that will](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/6706468b6ba28_5236706468b4ab5d.jpg)
2. Plot from scratch [20] . Create a plot that will illustrate how confidence intervals need to be interpreted (from a frequentist approach). For that end, draw 100 samples of size 10 each from a normal distribution with population mean = 10 and population variance = 4. Then plot each 95% confidence interval for the mean. When constructing the intervals, you can assume the population variance is known and use the given variance (of course you cannot assume that the population mean is known). For plotting you can only use plot, abline, and segments. Your plot should look similar to the example below where in green are the cases that captured the true mean while in red the ones that failed. Each case has the interval and the sample mean (the dot in the middle of the interval). Your code must be in a function to be called as shown below: CI_sigma_known (n = 10, ## sample size conf . cooff = .95, ## confidence level real . mu = 10, ## population mean real . var = 4, ## population variance B = 100 ## number of intervals [successful Cls: 94%] 100 cases 8 O 7 8 9 10 11 12 13 True mean (in blue) and Cls
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
