problem-6.10

problem-6.10  We should compare the q-q plot with the quantile-normal plot provided by qqnorm() to see the difference for small values of n. First, we define a function, T(), to compute the statistic from a sample:
> T = function(x) mean(x)/(sd(x)/sqrt(length(x)))
    
Then the simulations can be performed as follows (making it easier to modify the lines using the arrow keys):
> n=3; m=1000; res=c()
> for(i in 1:m) res[i]=T(rnorm(n))
> qqplot(res, rt(m,df=n-1))
> qqnorm(res)
    
For n=3 the long tail may produce outliers that skew the expected straight line for the q-q plot. This isn't so apparent by n=10, yet the difference between the plot produced with qqplot() and that with qqnorm() should still be apparent.