Skip to content

candisc plotting

4 messages · Pete Shepard, Michael Friendly

#
Dear Pete,

You haven't told us what your data is, and we can only surmise -- not 
very helpful for you and annoying for those who try to help.
Pete Shepard wrote:
From this, it seems that species is numeric variable, not a factor.
If so, canonical discriminant analysis in not appropriate, so
all following bets are off.

That's likely why you end up with only one canonical dimension.
Is data=i the same as data=i.txt?
What was your SAS code? Was the data the same?
If you want to compare plots for canonical analysis in SAS and R,
see my macros, canplot and hecan at
http://www.math.yorku.ca/SCS/sasmac/

But in general, if all you have is 1 canonical dimension, a dotplot or
boxplot of the canonical scores would be more useful than a scatterplot 
plot of can1 * can1.

The plot method for candisc objects in the candisc package has some
code to handle the 1 can-D case.

hope this helps
-Michael

  
    
#
You might try something like

do.can <- candisc(do.mod, data=do)
plot(do.can)

But, in your example there is only one canonical dimension there are 
only two levels of the
factor.

In any case, do.can$scores has the scores, so you can try to plot them 
however you like.

For a 1-D plot in a case where it makes more sense, try

iris.mod <- lm(cbind(Petal.Length, Sepal.Length, Petal.Width, 
Sepal.Width) ~ Species, data=iris)
iris.can <- candisc(iris.mod, data=iris, ndim=1)
 plot(iris.can)


-Michael
Pete Shepard wrote: