//
//Principal decomposition analysis command
//
//This command transforms data to principal coordinate data.
//

//Syntax no options.
prin [variables];

//Syntax used options
prin [variables]/
[options]
;

//Options
input:corr   //calculate principal from correlation data.
input:cov    //calculate principal from covariance data.
input:direct //calculate principal from original data(default).

//
//Example 1
//
//Read data that are 16 distances from each points inner circle to the A`E point on half outsize circle.
get princomp1.csv@;

//principal analysis prin a b c d e;

output are paired by eigen value and aigen vector.

//Inspection of pricipal analysis using 3D graph. //Get principal data from output; get freq@ana; //select two vector by meaningful eigen values. select vector_0 vector_1 vector_2; put prin;

//Read original data again. get princomp1@; //Calcurate score by matrix multiplication with original data and principal data. mxmult by prin;

//Plot principal score in 3D graph plot scat vector_0 vector_1 vector_3;