[R] biplot drawing conc ellipses

Jari Oksanen jarioksa at sun3.oulu.fi
Fri Nov 5 14:00:52 CET 2004


On Thu, 2004-11-04 at 22:44, T. Murlidharan Nair wrote:
> Is there an option to draw concentration ellipses in biplots ? It seems
> really nice to summarize large number of points of each group.

Murli,

If you mean biplot.prcomp function in stats package, and you want to
draw the "concentration ellipses" for row scores, the answer probably is
"not easily". Technically, the problem is that arrows for loadings are
drawn after labels for rowscores, and the scaling used for drawing row
scores is lost in the process. If you try to add points or segments to
the existing plots, you should use the scaling for arrows on sides 3 and
4 (top and right). If you want to add something for row scores, you just
don't have information on co-ordinates. I didn't check biplot.princomp,
but the situation may be similar there. 

Drawing of ellipsoids is possible in some alternative packages. You
already got a hint of ade4. In addition, vegan has pca as a special case
of its rda function, and there you have tools like ordiellipse (using
the ellipse package), ordispider and ordihull to display the variability
within factor levels. However, vegan doesn't have biplots like
biplot.prcomp, i.e. with arrows for loadings, Moreover, scaling of
results is different. 

It seems that the only thing you can do is to write your sweet on biplot
function. 

cheers, jari oksanen
-- 
Jari Oksanen -- Oulu, Finland.
"But, Mousie, thou art no thy lane, In proving foresight may be vain;
The best-laid schemes o' mice an 'men, Gang aft agley,
An'lea'e us nought but grief an' pain, For promis'd joy!" (Robert Burns)




More information about the R-help mailing list