Question: In this question, you will explore a new distribution called the uniform distri- bution and use R to conduction a simulation that demonstrates how the
In this question, you will explore a new distribution called the uniform distri- bution and use R to conduction a simulation that demonstrates how the CLT works.
A uniform random variable is a continuous random variable which PDF looks like a rectangle. It has two parameters: 1)awhich specifies the minimum value of the random variable, and 2)bwhich specifics the maximum value of the random variable. We usually denote a uniform random variableXasXUniformpa, bq. In R, therunif()function can be used to generate data from the uniform distribution. Inrunif(), the default values for parametersaandbare 0 and 1. Read the help page forrunif()and perform the following:
(a) Generate 1000 data points from Uniformp0,1q. Attach your code.
(b) Usehist()function to draw a histogram of the 1000 data points you generated in part (a). Describe the shape of the histogram in words. Attach the code and the histogram.
(c) Now we will use demonstrate how the CLT works. Generate 30 data points from Uniformp0,1q. Attach the code.
(d) Draw a histogram of the 30 data points. Describe the shape of the histogram in words. Attach the code and the histogram.
(e) Compute the sample mean of the 30 data points. What is the value of the sample mean? Attach code.
(f) Usereplicate()function to repeat parts (c) and (e) 999 times. Now you should have999 sample means. Attach your code.
(g) Draw a histogram of the 999 sample means. Attach the code and the histogram.
(h) Does the histogram in part (g) look normal? Why?
4 marks In this question, you will explore the shape of standardized scores of a uniform distribution versus a normal distribution.
(a) First, you will explore with the uniform distribution. Generate 1000 data points from Uniformp0,1q, and assign these 1000 data points to an R object calledsimulateUniform. Attach your code.
(b) Standardized all data insimulateUniformby subtracting the sample mean from each data point and then dividing it by the sample standard deviation. Assign the standardized data to an R object calledstandardizedUniform. Attach code.
(c) Compute the mean and standard deviation of the standardized data in
standardizedUniform. What are the mean and standard deviation? Attach code. (Note: If you get a number like-6.267743e-17, it is written in scientific nota- tion and it means6.2677431017, which is an extremely small number and is essentially equal to 0.)
(d) Draw a histogram of the standardized data instandardizedUniform. Describe the shape of the histogram. Does it look normal? Why? Attach the code and the histogram.
(e) Now, you will explore with the normal distribution. Generate 1000 data points fromNp10,5q, and assign these 1000 data points to an R object calledsimulateNormal. Attach your code.
(f) Standardized all data insimulateNormalby subtracting the sample mean from each data point and then dividing it by the sample standard deviation. Assign the standardized data to an R object calledstandardizedNormal. Attach code.
(g) Compute the mean and standard deviation of the standardized data in standardizedNormal. What are the mean and standard deviation? Attach code.
(h) Draw a histogram of the standardized data instandardizedNormal. Describe the shape of the histogram. Does it look normal? Why? Attach the code and the histogram.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
