In: Statistics and Probability
a. Generate samples of size 25, 50, 100 from a normal distribution. Construct probability plots. Do this several times to get an idea of how probability plots behave when the underlying distribution is really normal.
b. Repeat part (a) for a chi-square distribution with 10 df
I am required to use the R statistical program and I do not understand how to use it to solve this problem. If you could please show me the R Stats needed to solve this in the program I would highly appreciate it. Thank you and stay safe!
The R code is
#For Normal
set.seed(9999)
par(mfrow =c(1, 3))# for multiple plotting
#Sample Size 25
X.25=rnorm(n=25)
qqnorm(X.25)
qqline(X.25)
#Sample Size 50
X.50=rnorm(n=50)
qqnorm(X.50)
qqline(X.50)
#Sample Size 100
X.100=rnorm(n=100)
qqnorm(X.100)
qqline(X.100)
#For Chisquare
set.seed(1000)
par(mfrow =c(1, 3))
#Sample Size 25
Y.25=rchisq(n=25,df=8)
qqnorm(Y.25)
qqline(Y.25)
#Sample Size 50
Y.50=rchisq(n=50,df=8)
qqnorm(Y.50)
qqline(Y.50)
#Sample Size 100
Y.100=rchisq(n=100,df=8)
qqnorm(Y.100)
qqline(Y.100)
The Output of code is
>#For Normal
> set.seed(9999)
> par(mfrow =c(1, 3))# for multiple plotting
> #Sample Size 25
> X.25=rnorm(n=25)
> qqnorm(X.25)
> qqline(X.25)
> #Sample Size 50
> X.50=rnorm(n=50)
> qqnorm(X.50)
> qqline(X.50)
> #Sample Size 100
> X.100=rnorm(n=100)
> qqnorm(X.100)
> qqline(X.100)
> #For Chisquare
> set.seed(1000)
> par(mfrow =c(1, 3))
> #Sample Size 25
> Y.25=rchisq(n=25,df=8)
> qqnorm(Y.25)
> qqline(Y.25)
> #Sample Size 50
> Y.50=rchisq(n=50,df=8)
> qqnorm(Y.50)
> qqline(Y.50)
> #Sample Size 100
> Y.100=rchisq(n=100,df=8)
> qqnorm(Y.100)
> qqline(Y.100)