Andrews plot for multivariate data.
nan_andrewsplot(X) nan_andrewsplot(X,groups) nan_andrewsplot(X,groups,quant) nan_andrewsplot(X,groups,quant,stdize)
Rows of X correspond to observations, columns to variables.
plots the data in different groups with different colors, must be a numeric array or character matrix,
if it is not empty it plots only the median and the quant and (1-quant) quantiles of f(t) at each value of t. This is useful if X contains many observations.
do nothing
normalize each column of X (mean = 0, deviation = 1)
instead of X the principal component scores of X is used, in order of decreasing eigenvalue.
uses the standardized principal component scores.
An Andrews plot is a graphical representation of the observed values of several metric scaled variables X_j (j = 1, ..., p) in a two-dimensional coordinate system in which each multivariate data point is represented by a function.
f(t) is defined for the j-th observation as
f(t) = X(j,1)/sqrt(2) + X(j,2)*sin(2*pi*t) + X(j,3)*cos(2*pi*t) + ...
Elements with similar values will have similar curves. This is possible because the Andrews plot preserves the distances of data points and the mean values of the variables. The Andrews plot is suitable for the detection of outliers and for finding clusters.
nan_andrewsplot treats NaNs in X as missing values, and remove the corresponding rows.
// make a grouped plot of the raw data loadmatfile(nan_getpath()+"/demos/data/iris.mat"); nan_andrewsplot(meas,species); // plot only the median and quartiles of each group nan_andrewsplot(meas,species,.25); | ![]() | ![]() |
Andrews, D. F. (1972), Plots of high-dimensional data, Biometrics 28, S.125-136