Question

In: Statistics and Probability

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 = paste("Distribution of Z_n when n=",n, sep=""))
points(seq(-4,4,0.01), dnorm(seq(-4,4,0.01),0,1), type = ’l’)
}
par(mfrow = c(2,2)) # Put four plots in a 2 by 2 grid.
for (n in c(2, 10, 50, 200)) {
plot.z(n)
}

Solutions

Expert Solution


Related Solutions

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...
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 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,...
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...
The Central Limit Theorem A) Create a distribution with 50 observations of 1, 20 observations of...
The Central Limit Theorem A) Create a distribution with 50 observations of 1, 20 observations of 2, 60 observations of 3, 30 observations of 4, 30 observations of 5, and 90 observations of 6 (Hint: use the rep() command). Plot a histogram of this distribution (Hint: adjust the breaks if necessary). B) Take 1,000 samples of size 10 from the distribution (with replacement). Calculate the mean for each sample and plot the distribution of these means. C) Take 1,000 samples...
Use the Central Limit Theorem to explain the difference between the sampling distribution of x and...
Use the Central Limit Theorem to explain the difference between the sampling distribution of x and x-bar.
1. True or False: The central limit theorem justifies the common assumption that the distribution of...
1. True or False: The central limit theorem justifies the common assumption that the distribution of a product’s parameters is normal. 2. True or false: An X bar chart with points falling above the upper control limit is in control. 3.True or False: One or more points that fall outside control limits indicates that a process is NOT capable 4. One-third of the units produced by a particular process step do not meet customer-specific tolerances. Which of the following statements,...
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 =...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT