Question: I seriously need help with this code in R I keep getting errors and i dont understand why. Im having issues constructing the nested loops

I seriously need help with this code in R I keep getting errors and i dont understand why. Im having issues constructing the nested loopsI seriously need help with this code in R I keep getting

2. Using the nested for loops(i.e. for loop defined inside a for loop) to demonstrate the law of large numbers with R. (a) Take sample from X Uniform (3,7. (b) Run your outer for loop from 10 to 2010 with step size 100 so that the sample size gets increased: 2010 (c) Run the inner for loop to construct the sampling distribution of the mean with 100000 random numbers. (d) Compute mean of the sampling distribution and standard deviations for each n in the outer loop and print them out one row, (e.g. print(c(mean,std)). (e) Generate the histogram for each sample size n with fixed xlim c(3.5,6.5) n the outer loop. You may use par (mfrow c (3,3) before the loops begin to see the slide

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 Databases Questions!