Question

In: Statistics and Probability

Demonstrate understanding of the Central Limit Theorem, using R, by showing how the distribution of the...

Demonstrate understanding of the Central Limit Theorem, using R, by showing how the distribution of the sample mean changes according to sample size.

Consider a Poisson distribution with λ = 1.5.

Generate samples of 10,000 means over different numbers of observations (eg give a matrix 1, 2,3...100) rows. For each of these samples of means, compute the mean of the means, the sample standard deviation of the means, and the proportions of means that are more than 1 standard deviation above the overall mean.

Generate plots of each of these quantities vs the number of observations contributing to the means (1, 2, 3, 4 etc.).

Write R code used to produce these data. Form conclusions about what is seen, based on the Central Limit Theorem.

**Note: need help with the R code that produces this. Please supply that in your answer. Thanks!

Solutions

Expert Solution

R code -

samp_mean = c()
proportion = c()
samp_Std_deviation = c()
x = c()
s = c(1:10000)
for(i in s){

x = rpois(n = i , lambda = 1.5)
samp_mean[i] = mean(x)
samp_Std_deviation[i] = sd(x)
sample_mean = mean(samp_mean)
std_dev = sd(samp_mean)
proportion [i] = (length(samp_mean[samp_mean > sample_mean + 1 * std_dev]))/i
}
means_poisson = matrix(samp_mean)
means_poisson
overall_sample_mean = mean(samp_mean)
overall_std_deviation = sd(samp_mean)
plot(s , samp_mean ,type = "l")
#theoritical mean = 1.5
abline(h = 1.5 ,col = "red")
plot(s , samp_Std_deviation ,type = "l")
#theoritical sd = sqrt(1.5)
abline(h = sqrt(1.5 ,col = "red"))

plot(s , proportion ,type = "l")

R output -

From the above plots we can observe that as the sample size inceases the difference betwween the sample mean and theoritcal means decreases.

please like


Related Solutions

Demonstrate the use of the normal distribution, the standard normal distribution, and the central limit theorem...
Demonstrate the use of the normal distribution, the standard normal distribution, and the central limit theorem for calculating areas under the normal curve and exploring these concepts in real life applications. Scenario Frank has only had a brief introduction to statistics when he was in high school 12 years ago, and that did not cover inferential statistics. He is not confident in his ability to answer some of the problems posed in the course. As Frank's tutor, you need to...
This is the code in R for the Central Limit theorem question. This is Exponential distribution...
This is the code in R for the Central Limit theorem question. This is Exponential distribution with mean beta. How can I modify this code to Bernoulli(0.1), Uniform (0,4), and Normal distribution (2,1)    plot.z <- function(n, m=1e5, beta = 1) { mu <- beta sigma <- beta zs <- rep(0,m) for(i in 1:m) { Y.sample <- rexp(n, 1/beta) Ybar <- mean(Y.sample) zs[i] <- (Ybar - mu) / (sigma / sqrt(n)) } p <- hist(zs, xlim=c(-4,4), freq = F, main =...
This problem involves using R to examine the Central Limit Theorem more in detail. For all...
This problem involves using R to examine the Central Limit Theorem more in detail. For all answers in this problem, round to four decimal places. We will first generate 10 Poisson(λ=1) random variables and then calculate the sample mean of these 10 random variables. We will do this process 10,000 times to generate 10,000 simulated sample means. Run the following code and use the output to answer the following questions. set.seed(2020) nsims = 10000 # number of simulations means =...
This week we’ve introduced the central limit theorem. According to the central limit theorem, for all...
This week we’ve introduced the central limit theorem. According to the central limit theorem, for all samples of the same size n with n>30, the sampling distribution of x can be approximated by a normal distribution. In your initial post use your own words to explain what this theorem means. Then provide a quick example to explain how this theorem might apply in real life. At last, please share with us your thoughts about why this theorem is important.
What is the sampling distribution of the sample mean? What is the central limit theorem?
  Question 4 What is the sampling distribution of the sample mean? Provide examples. Question 5 What is the central limit theorem? Provide examples. Question 6 What is the standard error of the mean? Provide examples.
Use the Central Limit Theorem to calculate the following probability. Assume that the distribution of the...
Use the Central Limit Theorem to calculate the following probability. Assume that the distribution of the population data is normally distributed. A person with “normal” blood pressure has a diastolic measurement of 75 mmHg, and a standard deviation of 4.5 mmHg. i) What is the probability that a person with “normal” blood pressure will get a diastolic result of over 80 mmHg, indicating the possibility of pre-hypertension? ii) If a patient takes their blood pressure every day for 10 days,...
describe what the central limit theorem is, and list the requirements necessary for using the Central...
describe what the central limit theorem is, and list the requirements necessary for using the Central Limit Theorem.
Find probability for sampling distribution using Central Limit Theorem The mean room and board expense per...
Find probability for sampling distribution using Central Limit Theorem The mean room and board expense per year at four-year college is $7540. You randomly selected 9 four-year colleges. What is the probability that the mean room and board is less than $7800? Assume that the room and board expenses are normally distributed with a standard deviation of $1245.
For each problem identify the sampling distribution explicitly using the Central Limit Theorem, use probability notation...
For each problem identify the sampling distribution explicitly using the Central Limit Theorem, use probability notation to indicate what you are being asked to find, find your probabilities showing all your work, including diagrams. Interpret your final results. Submit your completed homework to Canvas. A 2012 survey of adults 18 years and older reported that 34% have texted while driving. A random sample of 125 adults was selected.    What is the probability that 36 or more people in this...
Applying the Central Limit Theorem in R Please click on the link above to participate in...
Applying the Central Limit Theorem in R Please click on the link above to participate in this week's discussion. We can design an experiment to see how the Central Limit Theorem applies practically. Execute the following commands in R: Initialize the variables we will use: > mu <- 100 > sigma <- 10 > n <- 5 > numSims <- 500 > xbar <- rep(0,numSims) mu is the mean, sigma is the standard deviation of the normal distribution we will...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT