Answered step by step
Verified Expert Solution
Question
1 Approved Answer
79) Use the appropriate method to summarize the replications of the 500 random samples as a boxplot. You must set the appropriate arguments to display
79) Use the appropriate method to summarize the replications of the 500 random samples as a boxplot. You must set the appropriate arguments to display the MEAN within the boxplot. The MEAN must be displayed as red triangles. 7d) Let's now see what happens if we generate 50 random samples instead of 5. You must continue to use 100 replications. Use NumPy to generate 50 samples of a Normal (Gaussian or bell curve) with mean 100 and standard deviation 25 and replicate that process 100 times. Do NOT calculate summary statistics associated with these samples. Assign the result to the variable X050 . Convert the X050 NumPy array to a Pandas DataFrame and assign the result to the df@5@ object. IMPORTANT: Do NOT forget to set the random seed!!!! In the previous homework assignments, you have calculated the standard error on the mean as a function of the sample size. Rather than repeating that process again, let's use Pandas to help visualize what's happening when we generate the random samples. Pandas has built-in plotting methods that make it quite simple to generate useful statistical graphics to help us understand a data set. We will discuss visualization in more detail later in the course. The matplotlib.pyplot module is imported for you below. import matplotlib.pyplot as plt Over the last few weeks we have talked about the difference between replications associated with simulations and the sample size effect we wish to study. We estimated the standard error on the mean by generating 5000 replications of the sample average. As we saw in Week 02, we used 5000 replications because the distribution on the sample average converges to a Gaussian (a bell curve) in the limit of an infinite number of replications. Replicating thousands of times allows our simulated results to match the theoretical results. This week, you will work with a smaller number of replications. The simulated estimate to the standard error no longer matches the theoretical result with so few replications. However, it will be easier to visualize the random samples and summary statistics with so few replications. You will specifically use 100 replications for this
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started