Question

In: Statistics and Probability

Using built in R functions to calculate mean and standard deviation. Simulate the X vector with...

Using built in R functions to calculate mean and standard deviation. Simulate the X vector with a length of 50 from a normal distribution with mean 2 and variance 1. Using a for() loop, create 100 different confidence intervals and also create a variable that keeps a count of how many of these confidence intervals contain the true mean 2. Hint: Use If/else statement to keep track of whether the confidence interval contains the true mean or not within the loop. Use set.seed(i) (i.e., i in 1:100) to make sure that other people can reproduce your results and also you have different results for different replications. Print (count/100) at the end. If your solution is less than 95%, what actions can you do to improve the results? Demonstrate it using R.

Solutions

Expert Solution

R code given below


Related Solutions

Using the table below, calculate the variance of X, variance of Y, standard deviation of X,...
Using the table below, calculate the variance of X, variance of Y, standard deviation of X, standard deviation of Y,   the covariance between X and Y, the correlation coefficient between X and Y, and find the regression line assuming X is the independent variable (find the slope and the intercept). Show your work Fill in the Blanks: X Y X-Xbar Y-Ybar (X-Xbar)^2 (Y-Ybar)^2 (X-Xbar)*(Y-Ybar) 5 3 9 6 12 15 17 20 21 23 Sum Calculate the following and show...
This data is from a sample. Calculate the mean, standard deviation, and variance. x 38.3 35.2...
This data is from a sample. Calculate the mean, standard deviation, and variance. x 38.3 35.2 26.7 49.9 44.6 14.2 16.4 34 14.4 Please show the following answers to 2 decimal places. Sample Mean = Sample Standard Deviation = Sample Variance = Ooops - now you discover that the data was actually from a population! So now you must give the population standard deviation. Population Standard Deviation =
a) Calculate mean duration and standard deviation for all the activities using the beta distribution. [4pts]...
a) Calculate mean duration and standard deviation for all the activities using the beta distribution. [4pts]    b) Construct a network diagram for this problem using the mean durations calculated in part (a), calculate the LS(Foll.), ES(Prec.) and total float for all the activities, and hence identify the critical path . What is the mean completion time for the project? What is the standard deviation of the critical path? [30 pts ]    c) What is the 92% confidence interval...
Using NumPy etc. How to calculate a population mean and population standard deviation of a column...
Using NumPy etc. How to calculate a population mean and population standard deviation of a column with values. Also, how to calculate the range of values around the mean that includes 95% confidence interval of values within the column.
What is the benefit of using mean deviation over standard deviation?
What is the benefit of using mean deviation over standard deviation?
Calculate the mean, ?⎯⎯⎯,x¯, and standard deviation, ?,s, for the data set. Sample Value 1 8.013...
Calculate the mean, ?⎯⎯⎯,x¯, and standard deviation, ?,s, for the data set. Sample Value 1 8.013 2 8.013 3 8.012 4 8.029 5 8.013 6 8.025
Using Minitab, calculate the mean, standard deviation, variance, and median of the following four data sets....
Using Minitab, calculate the mean, standard deviation, variance, and median of the following four data sets. Comment on the results. A B C D 100 50 50 75 100 75 100 75 100 100 100 75 100 125 100 100 100 150 150 175
Movies 3a and 3b: 1. Using either R studio and/or SPSS calculate the mean and standard...
Movies 3a and 3b: 1. Using either R studio and/or SPSS calculate the mean and standard deviation for the question 4 data (first tab in your excel spreadsheet). Be sure to cut and paste your output from SPSS and/or your R code into this document. (1 point) The standard deviation was: The mean was: Age 5 3 5 3 2 3 1 2 4 2 4 2 6 5 5 4 3 5 3 1 4 2 3 5 6...
Use R functions search and objects to find all possible R built-in functions related to exp...
Use R functions search and objects to find all possible R built-in functions related to exp distribution. rexp should be one of them. dexp is another one. Explain what the following two lines of codes do: curve(dexp, from=0, to=4)
Calculate the flux of the vector field F? (r? )=9r? , where r? =?x,y,z?, through a...
Calculate the flux of the vector field F? (r? )=9r? , where r? =?x,y,z?, through a sphere of radius 4 centered at the origin, oriented outward. Flux =
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT