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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!