Question

In: Statistics and Probability

Use R and perform following: Generate 1000 observations from an exponential distribution with mean 10. Generate...

Use R and perform following:


Generate 1000 observations from an exponential distribution with mean 10.
Generate 1000 observations from a central t-distribution with 8 degree of freedom.
Make a qqplot of observations in problem 1 versus quantiles generated from a t-distribution
with 8 degree of freedom. Can the t distribution be used to approximate data in part 1?Submit
the plot.
Repeat above part but submit a qqplot of the observations in 1 versus quantiles from an exponential
with mean 1. What is your conclusion?

Solutions

Expert Solution

Random exponential distribution in R:-

For generating random exponential distribution in R is rexp(n,lamda) where n refers to the sample size and lambda is the rate parameter. The mean of exponential distribution is 1/lambda and the standard deviation is also 1/lambda

rexp(n,lamda)

>x<- rexp(1000, 0.1)

>x[0:20]

[1] 11.8374577  0.6041982  2.6490437  4.5841595 33.2941223 11.1561669
 [7] 12.0257420  2.4585212  0.5783512 22.8702997  2.6110438  8.5349925
[13] 23.9149159  3.8423621  8.8366142 11.0909087  5.4228406  5.6150966
[19]  7.9317064 16.0707504

Random t distribution in R:-

rt(a,b) returns a random draws from a t distribution centered at 0 with b degrees of freedom.

rt(a,b)

>y <- rt(1000,8)

>y[0:20]

[1] -1.855119123  0.802409732 -0.366512326  0.348991110 -0.889810771
 [6]  1.316007092  1.243631552 -3.505593271 -0.181419213  0.654032170
[11]  1.156344566 -0.556387657 -0.669780166  0.236448825  1.071076264
[16]  0.472816531  0.004414854 -0.471919606 -1.579729421  0.529356835

qqplot-

>qqplot(x,y)

qqplot of observations in problem 1 versus quantiles generated from a t-distribution
with 8 degree of freedom

>qqplot(y,x)

qqplot of the observations in 1 versus quantiles from an exponential

It data follows straight line means >> normally distributed


Related Solutions

Program in R: Generate 1000 exponential random deviates with the mean equal to ½. Be careful!...
Program in R: Generate 1000 exponential random deviates with the mean equal to ½. Be careful! The exponential is sometimes parameterized directly with the mean, B, using 1/B*exp(-x/B) and sometimes it is parameterized with the rate lambda = 1/B. Know what your software is doing. After generating the data, compute the mean and variance of the data. The mean and variance is all I need to see.
Write the R code First, generate 1000 observations from a binomial distribution with n=30 and p=0.2...
Write the R code First, generate 1000 observations from a binomial distribution with n=30 and p=0.2 Use the 1000 observations you generated: a) Generate poisson, binomial, negative binomial Diagnostic Distribution Plots using distplot. b) Generate a histogram and overlay a kernel estimator of the density (You can use: binom <- rbinom(n=1000,size=30, prob=0.2))
Draw 1000 samples of size 10, 25, 40 from exponential distribution with mean 10 and threshold...
Draw 1000 samples of size 10, 25, 40 from exponential distribution with mean 10 and threshold 0 and calculate mean for each sample. Now produce histogram for sample mean. a. What do you notice in the shape of the distribution of sample mean as sample size increases? Also, what changes in the standard error of the sample mean? b. As the sample size increases , the sample mean goes to what number?
Coding Language: R Generate 100 observations from the normal distribution with mean 3 and variance 1....
Coding Language: R Generate 100 observations from the normal distribution with mean 3 and variance 1. Compute the sample average, the standard error for the sample average, and the 95% confidence interval. Repeat the above two steps 1000 times. Report (a) the mean of the 1000 sample means, (b) the standard deviation of the 1000 sample means, (c) the mean of the 1000 standard errors, and (d) how many times (out of 1000) the 95% confidence intervals include the population...
Given below are 10 observations which we believe comes from the exponential distribution with λ= 10....
Given below are 10 observations which we believe comes from the exponential distribution with λ= 10. Give the 10 ordered pairs which you would need to construct a probability plot you could use to verify this assumption. 1.08, 4.24, 33.40, 29.26, 2.94, 15.92, 1.96, 10.47, 16.71, 14.27
7) Use Excel to generate a series of 100 random values from the exponential distribution with...
7) Use Excel to generate a series of 100 random values from the exponential distribution with a mean of 25? USING EXCEL SHOW ALL WORK
3. (3 pt) Use R functions to generate 1000 random samples from t-distribution with 15 degrees...
3. (3 pt) Use R functions to generate 1000 random samples from t-distribution with 15 degrees of freedom. Make a histogram with the samples showing the relative frequencies. Then overlay a probability density plot over this histogram.
Generate 100 samples of size n=8 from an exponential distribution with mean 3 . Each row...
Generate 100 samples of size n=8 from an exponential distribution with mean 3 . Each row of your data will denote an observed random sample of size 8, from an exponential distribution with mean 3. Obtain sample mean for each sample, store in another column and make a histogram for sample means. Repeat for n=100. Compare and interpret the histograms you obtained for n=8 and n=100. Submit the histograms along with your one small paragraph comparison. Can you solve it...
2. Use MINITAB to generate 10,000 observations from a binomial distribution with n = 50 trials...
2. Use MINITAB to generate 10,000 observations from a binomial distribution with n = 50 trials and probability of success p = 0.02 . Create a histogram of the 10,000 observations. Comment on the shape of the distribution. Why does it makes sense for the histogram to have this shape? 3. Use MINITAB to generate 10,000 observations from a binomial distribution with n = 1000 trials and probability of success p = 0.02. Create a histogram of the 10,000 observations....
Use R to generate two random numbers n11, n21 from the Binomial distribution: Bin(10, 0.4). Print...
Use R to generate two random numbers n11, n21 from the Binomial distribution: Bin(10, 0.4). Print your results. Please don’t forget to use the command set.seed(101) before the commands gen- erating the random numbers. (b) (2 points) Use the R command ntable < − array(data = c(n11, n21, n1plus-n11, n2plus-n21), dim = c(2,2)) to create a 2 × 2 table using the numbers generated in part (a) above. Print your table. (c) (3 points) Perform the Fisher’s exact test on...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT