candisc and cancor objects have coefficients for the X and Y and weighted scores for these,
whose signs are arbitrary, in the sense that a given column can be reflected (multiplied by -1) without changing the fit.
But, often you will want to reverse the direction of one or more dimensions for ease of interpretation.
This function allows you to reflect any columns of the variable coefficients (and corresponding observation scores). This is often useful for interpreting a biplot, for example when a component (often the first) has all negative signs.
reflect(object, columns = 1:2, ...)# S3 method for data.frame
reflect(object, columns = 1:2, ...)
# S3 method for cancor
reflect(object, columns = 1:2, ...)
# S3 method for candisc
reflect(object, columns = 1:2, ...)
The object with specified columns of the variable coefficients and observation scores multiplied by -1.
An object whose columns are to be reflected
a vector of indices of the columns to reflect
Unused
reflect(data.frame): "data.frame" method.
reflect(cancor): "cancor" method.
reflect(candisc): "candisc" method.
Michael Friendly
reflect methods are available for:
data.frames
"cancor" objects
"candisc" objects
Note that plot.candisc() and plot.candisc() can handle this internally using the argument rev.axes.
ggbiplot::reflect has similar methods for PCA-like objects