Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The next exercises will have to run simulations in RStudio. Conveniently, R can generate values from any common probability distribution. Exercise 6. What is the

The next exercises will have to run simulations in RStudio. Conveniently, R can generate values from any common probability distribution.

Exercise 6. What is the probability a random draw from the standard normal distribution is smaller than 1.96? What is the probability a random draw lies between1.96 and 1.96? Use R code to generate your answers. Hint: Use the pnorm() command.

Before the next exercises, run the command set.seed(123).

Exercise 7. Create the matrix, "mat", of all NA (missing values) with 100 rows and 100 columns.

Exercise 8. Replace each row in the matrix with a vector of 100 random draws from a Poisson distribution with mean= 2.5. Hint: Use the rpois() command, together with a for loop, so for(i in 1:100)... and each time the loop iterates, you want to replace the row mat[i,] with a vector of random values from rpois().

Exercise 9. Create the vector, "vec", that contains the mean of each row in "mat".

Exercise 10. Plot a histogram of "vec". Hint: Use the hist() function. Does the histogram look like a normal distribution? Repeat exercises 7-9 with a matrix of 1,000 rows and columns (and vectors of 1,000 random draws from the Poisson distribution). Does the new histogram look more like a normal distribution than the old one?

Note; I need the answers done using RStudio programing language. As is is the main tool used in the Econometrics course.

I have asked a similar question to this earlier however it was moves to "probability and statistical analysis" and have yet to receive an answer.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Finite Math And Applied Calculus

Authors: Stefan Waner, Steven Costenoble

6th Edition

1285415132, 9781285415130

More Books

Students also viewed these Mathematics questions

Question

What is corporate social reporting (CSR)?

Answered: 1 week ago