Next: compf() Up: Multivariate Macros Help File Previous: backstep()   Contents

chiqqplot()

Usage:
chiqqplot(y [,sqrt:T] [,graphics keywords phrases]), REAL matrix y
chiqqplot(dsq, df [,sqrt:T] [, graphic keyword phrases]), REAL vector
  or matrix dsq of squared distances, REAL scalar df > 0



Keywords: plotting, diagnostics
You use chiqqplot() to make a chisquare or sqrt(chisquare) quantile-
quantile (Q-Q) plot of ordered generalized distances against chisquare
or sqrt(chisquare) quantiles.

chiqqplot(y [, graphics keyword phrases]), where y is a REAL matrix
with no MISSING elements, plots the ordered values of generalized
distances against x[i] = invchi((i - 1/2)/n, df), where df = p =
ncols(y).  Common graphics keywords are 'xlab', 'ylab', 'title' and
'symbols'.  'symbols' may be used as with chplot(), except that
'symbols:0' labels the points by row number.

The generalized distance of y[i,] from ybar, the sample mean row vector,
= sum(y)/nrows(y) is
      dsq[i] = (y[i,] - ybar) %*% solve(s) %*% (y[i,] - ybar)'
with s the sample variance-covariance matrix with divisor n-1.

When the rows of y are a random sample from a multivariate normal
distribution, d[i] is distributed approximately as chi-squared on p
degrees of freedom and the plot should approximate a straight line with
slope 1.

Very commonly, the "data" matrix is RESIDUALS, the matrix of residuals
computed by manova().  The Q-Q plot is a way to assess the multivariate
normality of the errors.

chiqqplot(y, sqrt:T ...) does the same, except the ordered values of
sqrt(dsq[i]) are plotted against sqrt(invchi((i - 1/2)/n, df)).
Again the plot should be linear when y is multivariate normal.

chiqqplot(dsq, df, [,sqrt:T] ...) does the same except the ordered
columns of REAL vector or matrix dsq or sqrt(dsq) are plotted against
quantiles of chisquare or sqrt(chisquare) with df degrees of freedom.
When dsq is computed by distcomp(y) and df = ncols(y), this usage is
equivalent to chiqqplot(y, [,sqrt:T] ...)

When dsq is a matrix, the columns are separately ordered and plotted
with different symbols.  With symbol:0, the symbols are the row numbers
when ncols(dsq) = 1 and are the column numbers otherwise.

chiqqplot() uses macros covar() and distcomp().


Gary Oehlert 2003-01-15