4. This problem asks you to create a random distribution that is not normal (cal
ID: 3221778 • Letter: 4
Question
4. This problem asks you to create a random distribution that is not normal (called 'x4'), analyze a random sample from this distribution, and then to illustrate the Central Limit Theorem by creating a distribution ofE values. Oh yeah, you should really make sure that you are using the object names EXACTLY as stated here and that the objects are saved in the workspace file that you submit. (a) Assign to the object 'x4' a random distribution of 5000 values using the following R-command. x4 c(rpois(5000, c(10, 40))) (b) Assign the mean value of the distribution "x4' to the object x4ave (c) Assign the standard deviation of the distribution "x4' to the object "x4sd' (d) Use the hist function to create a histogram of the x4' data distribution. (Just use the system defaults for all parameters.) Print this histogram and attach it to your worksheet to turn in. (As advertised, this distribution should not look like a normal distribution...does it?) e) Use the sample function to generate a random sample of 60 values (without replacement from "x4 Assign this data set to the object samp60 (f) Assign the mean of the sample 'samp60' to the object 'samp60ave'. (g) In order to illustrate the Central Limit Theorem, we must have a sampling distribution consisting of a large number of sample means. Enter the following lines of code to generate 200 samples each of size 60, compute the mean of each sample, and assign that list of 200 sample means to the object Fx4distr #Creates a new empty list named "x4distr x4distr for(i in 1:200) {samp sample(x4, 60, replace F) x4distr c(x4distr, mean(samp))Explanation / Answer
> x4 = c(rpois(5000,c(10,40)))
> mean = mean(x4)
> mean
[1] 24.8736
> sd = sd(x4)
> sd
[1] 15.75901
> hist(x4)
> x4distr = c()
> for (i in 1 : 200)
+ {samp=sample(x4,60,replace=F);
+ x4distr = c(x4distr, mean(samp))}
> x4distr
[1] 26.90000 26.60000 24.71667 25.88333 28.48333 21.61667 22.06667 25.15000
[9] 27.28333 22.55000 22.33333 28.08333 21.03333 26.45000 23.31667 21.36667
[17] 24.16667 22.75000 28.76667 27.18333 20.25000 23.11667 26.06667 23.83333
[25] 25.68333 24.71667 28.28333 23.76667 20.53333 23.90000 28.56667 23.18333
[33] 27.30000 26.51667 22.01667 25.66667 25.46667 24.90000 24.43333 26.06667
[41] 23.48333 20.41667 25.05000 25.38333 24.48333 25.48333 23.66667 26.18333
[49] 26.21667 25.53333 28.26667 25.20000 25.86667 22.16667 21.30000 24.58333
[57] 25.66667 26.00000 26.18333 25.76667 26.11667 26.88333 22.53333 28.96667
[65] 26.85000 25.81667 24.81667 25.23333 28.71667 24.46667 24.21667 20.98333
[73] 25.36667 24.61667 25.81667 24.85000 25.75000 24.98333 25.88333 27.75000
[81] 26.10000 21.56667 21.98333 25.88333 23.35000 25.00000 27.43333 24.01667
[89] 24.18333 26.31667 25.36667 24.83333 25.28333 25.58333 27.58333 27.26667
[97] 23.96667 23.13333 26.61667 25.46667 25.38333 28.21667 23.36667 26.78333
[105] 21.06667 29.35000 23.05000 29.83333 25.38333 26.70000 22.88333 22.01667
[113] 23.51667 28.38333 23.58333 27.70000 20.58333 25.41667 26.83333 25.03333
[121] 27.46667 29.91667 21.85000 26.51667 21.41667 28.01667 27.85000 22.68333
[129] 25.40000 25.63333 24.31667 22.58333 24.28333 24.61667 23.80000 26.73333
[137] 24.61667 23.81667 24.21667 28.00000 27.06667 21.95000 24.40000 26.65000
[145] 25.81667 26.15000 28.86667 25.16667 24.38333 24.43333 24.71667 23.10000
[153] 23.15000 20.50000 21.51667 25.23333 25.68333 24.15000 26.38333 25.08333
[161] 18.95000 27.35000 24.55000 25.16667 28.50000 24.55000 24.85000 26.83333
[169] 22.85000 24.30000 27.18333 25.95000 26.01667 24.35000 26.05000 28.78333
[177] 23.16667 24.40000 21.98333 22.31667 23.58333 30.03333 25.61667 26.45000
[185] 25.76667 24.81667 24.15000 26.38333 21.83333 23.45000 24.21667 27.55000
[193] 24.70000 27.30000 23.23333 24.90000 22.80000 25.45000 24.26667 24.60000
>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.