How to plot a line on a biplot made from PCA coeff and score data?
I'm creating biplots of PCA data using the coeff and score outputs. I am looking to draw a line between the furthest points on the biplot. I'm not sure how add a line to the plot without adding it myself (which would be tedious).
I know which 2 points are the furthest away from each other. My coeff is a 7x7, but I am using the first 3 columns for the biplot as well as columns 1:3 in my score matrix.
How would I go about plotting a line with either l开发者_StackOverflowine or plot3 between these 2 points. It seems like it can be done but I am unsure of what data to specify for the line.
plot3
accepts 3 inputs as the X,Y, and Z coordinates.
since you need a line between two points you need to input the two 3D observations
plot3(X1,Y1,Z1,...)
say that your 2 observations with the greatest distance between them are the 3rd and the 5th
then
plot3(scores([3 5],1),scores([3 5],2),scores([3 5],3))
would give you what you need
happy plotting!
精彩评论