You can find useful R codes for CLT on this website. Attend the discussion on Ja
ID: 3202873 • Letter: Y
Question
You can find useful R codes for CLT on this website. Attend the discussion on Jan, 27, and answer the following questions. Generate samples from Beta (2, 4). Plot the histogram/density functions and the QQ plot for different sample sizes such as n = 2, 10, 50. Summarize your findings. Describe the meaning of each plot, and explain how they change with the sample size. Generate samples from Gamma (3, 1). How large do you think n has to be such that CLT has a reasonable performance? Generate samples from the standard Cauchy distribution. Summarize your findings.Explanation / Answer
(a) The R code is rbeta( n=samplesize,Beta Parameter1,Beta Parameter2,ncp=0)
rbeta(2, 2, 4, 0)
rbeta(10,2,4,0)
rbeta(50,2,4.0) where ncp non-centrality parameter.
Histogram Plot
hist(column,breaks=any number you can specify)
qqnorm(X)
qqline(X)
qq plot is used to check for the normality of the data. With higher the sample size the plot approximates the normal distribution. Histogram is used for looking at the frequency distribution and how the data is spreaded across different frequency intervals. THe breaks in R code can be changed to look at the frequency distribution of the data
(b)rgamma(n=50, shape=3, rate=1)
(C) Cauchy Distribution Generation : rcauchy(n=50, location=0, scale=1) as the location and scale values are not specified then we can use default values as 0 and 1 respectively
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.