stats with R programming

stats with R programming

1. The gamma distribution is given by the R commands rgamma (), dgamma (), pgamma (), qgamma (). These correspond to rnorm (), dnorm (), and so on.
Read the hints below, and then estimate the mean, median, and mode of the exponential distribution with shape=3.
Write down your estimates and show your reasoning (note: include any figures you use)
• Hint 1a: You can sample from the gamma distribution with shape=3 using R command rgamma (10,shape=3), which will give a sample of size 10.
• Hint 1b: You can change 10 to say 20 and type rgamma (20,shape=3) and this will give you 20 observations.
• Hint 1c: Think about what mean (rgamma (10,shape=3)) means, and how to improve the accuracy.
• Hint 2a: R command qgamma (0.35,shape=3) gives a value of 2.0986. This means that, if X is a random observation drawn from an gamma distribution, then Prob (X<2.0986)=0.35 (so function qgamma () does for the exponential distribution what qnorm () does for the normal distribution).
• Hint 2b: Think carefully about what R function qgamma () means, and what the median is.
• Hint 3a: try hist (rgamma (10,shape=3)), think about what mode means, and see if you can improve its accuracy.
• Hint 3b: try hist (rgamma (10,shape=3), nclass=100)

Is this the question you were looking for? If so, place your order here to get started!