In R
Re-do the plots of Figure 3.18, but this time apply the six
graphics functions
to a variable X which is defined by X = Z2, where Z is a
simulated
standard normal random variable as in the example. Comment on
the
changes that you see in the plots. (The variable X is an example of
a
chi-squared random variable on one degree of freedom.)
code for figure 3.18:
par(list = list(mfrow = c(3, 2), mar =
c(2.5,2.1,0.1,0.1)))
Z <- rnorm(1000)
hist(Z, main = "")
hist(Z, breaks = "Freedman-Diaconis", main = "")
plot(density(Z), main = "")
boxplot(Z)
qqnorm(Z, main = ""); qqline(Z)
ts.plot(Z)
par(list = list(mfrow = c(3, 2), mar =
c(2.5,2.1,0.1,0.1)))
Z <- rnorm(1000)
X<-Z*Z
hist(X, main = "")
hist(X, breaks = "Freedman-Diaconis", main = "")
plot(density(X), main = "")
boxplot(X)
qqnorm(X, main = ""); qqline(X)
ts.plot(X)
Get Answers For Free
Most questions answered within 1 hours.