

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


The Central Limit Theorem Problem 1. We begin this project by writing an R function that will input a set of data, plot a histogram for the data, and overlay the histogram by a normal approximation and a nonparametric smoothed version of the data. Moreover, it will plot a normal quantile plot of the data. To get help on how to write a functions in R, refer to Section 6.3 of “R for Beginners” by Pardis. Below are the details of the function that you will write: Input: A vector of data, a parameter for “ breaks ” for the histogram with default " Sturges ", a bandwidth parameter with default bw = “nrd0”. Function name: DataShape.R Output: Mean and standard deviation of the data. Also, two separate graph windows of size 5 inch by 5 inch, that include the graphs described in (a)‐(c) below on one window and the graph described in (d) on the second window. The command windows(5,5) is useful. (a) Plot a density histogram of the data. (b) Overlay the above histogram by a normal density curve with mean and standard deviation matching those of the histogram data. Use green color for this curve. The R commands lines and dnorm are useful. (c) Overlay the plot generated in (a) and (b) with a smooth density curve (use red color for the smooth density curve). Refer to Section 3.5 of “Using R for Data Analysis and Graphics” by Maindonald. The commands density and lines are useful. When (d) Plot the normal quantile plot for the sample. We Use the following five (population) sources to take samples from:
i. Take a sample of size n from the population. ii. Calculate the mean of the sample, and retain it in xbar. } At this point you have the vector of 1000 means.