(R Question) Please let me know the code for this question. The task is: 1) choose the sample size - n (n<30). 2) genera
Posted: Mon Apr 11, 2022 6:25 am
Question) Please let me know the code for this question. The task is: 1) choose the sample size - n (n<30). 2) generate a random sample of size n from a normal distribution (with some parameters $\mu$ and $\sigma^2$ off your choice). 3) Write a function that: - takes two input arguments - the generated sample and a confidence level as *1-\alpha* (so the value should be less than 1) - using the sample size and the confidence level, finds the limits for a pivot random variable (*t_alpha/2* for the corresponding degree of freedom) - finds the corresponding limits for the interval for the population mean (you need to find the sample mean and the sample standard deviation) The output of the function should be a vector with two values - the lower limit and the upper limit for the population mean. 4) Test your function using the sample you generated in step 2) for some confidence level (for example 0.90 or 0.95)
(R