5 Random Numbers Histograms Applied Let I1 120 Sum 20 Independent Uniform 0 1 Random Vari Q43902243
R Studio Coding GGPlots
![5 Random Numbers and Histograms (Applied] Let I = I1 + ... + 120, the sum of 20 independent Uniform(0,1) random variables. In](https://media.cheggcdn.com/media/a15/a157927b-37a8-4459-b320-de6ae15fe936/phpf6qd0k.png)
5 Random Numbers and Histograms (Applied] Let I = I1 + … + 120, the sum of 20 independent Uniform(0,1) random variables. In R, create 1,000 simulations of x and plot their histogram. On the histogram, overlay a graph of the normal density function with the same mean as .z. Comment on any differences between the histogram and the curve. Hint 1: To plot a histogram in R you can build on the following code: library(ggplot2) df <- data.frame(x = rnorm(1000) ) ggplot(df, aes (x)) + geom_histogram(aes (y=..density..)) Hint 2: In ggplot you cannot plot the normal density as a function. But you can easily simulate lots of values drawn from a normal distribution (say 1,000) and plot these data as a geom_density(). The main challenge for you to figure out is how to use two ggplot layers, each with its own data.frame: The first layer uses the data from x the second uses data from the normal distribution. Show transcribed image text 5 Random Numbers and Histograms (Applied] Let I = I1 + … + 120, the sum of 20 independent Uniform(0,1) random variables. In R, create 1,000 simulations of x and plot their histogram. On the histogram, overlay a graph of the normal density function with the same mean as .z. Comment on any differences between the histogram and the curve. Hint 1: To plot a histogram in R you can build on the following code: library(ggplot2) df
Expert Answer
Answer to 5 Random Numbers and Histograms (Applied] Let I = I1 + … + 120, the sum of 20 independent Uniform(0,1) random variable…
OR