Question: 2. Write a simulation in R that shows the distribution of the t-test statistic when the null hypothesis is true. To do this, you should

2. Write a simulation in R that shows the distribution of the t-test statistic when the null hypothesis is true. To do this, you should use a for loop that repeatedly performs t-tests comparing sample means of data that come from distributions with the same population mean and standard deviation. Use mormO to take samples, t.test() to perform the t-tests, and use \"$statistic\" to extract the ttest statistic from the t.test() procedure (e. g. t.test(x,y)$statistic). Make a histogram of the test statistics. If you need help, look back at the notes on for loops
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
