This problem requires using R studio. This question is from Verzani (Problem 6.25) Can some write the code for the answer to the question below:
A q-q plot is an excellent way to investigate whether a distribution is approximately normal. For the symmetric distributions Uniform (0,1), Normal (0,1), and t with 3 degrees of freedom, take a random sample of size 100 and plot a quantile-normal plot using qnorm. Compare the three and comment on the curve of the plot as it relates to the tail length. (The uniform is short-tailed; the t-distribution with 3 degrees of freedom is long-tailed.)
###R studio code
x=rnorm(100)
y=runif(100)
z=rt(100,3)
qqnorm(x)
qqnorm(y)
qqnorm(z)
Here are the obtained qq plots
1. Uniform
2. Normal
3. T
The qqplot of normal is very similar to straight line which is expected.niform is also similar to straight line but with increasing slope.
As there are few outliers in the plot of t distribution, it shows t is long tailed. Also the slope is less than 1.
Get Answers For Free
Most questions answered within 1 hours.