Hello,
I've been trying to put together a script to run a PCA analysis and save the resulting eigenvectors.
The PCA include a 'by' which results in several independent PCA analysis. The number of which depends on the number of categories in the column (specimen_material_type) used to populate 'by' option
The script works great with one major exception: Only the eigenvectors table from the first category get saved to a data table despite using the "make combined data table" function.
I would like to tweak the script so that it can accommodate any number of categories provided by the 'by: specimen_material-type' as it will vary from analysis.
dt = Data Table( "split by symbol" );
colList = dt << Get Column Names( numeric );
obj = dt << Principal Components(
Y( Eval( colList ) ),
Estimation Method( "Wide" ),
"on Correlations",
by( :specimen_material_type ),
Summary Plots( Label variables( 0 ) ),
Eigenvectors( 1 ),
Arrow Lines( 0 ),
SendToReport(
Dispatch(
{"Summary Plots"},
"PCA Summary Plots",
FrameBox,
{Row Legend(
test_article,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
obj << Save Principal Components( 3 );
Report( obj[1] )[Outline Box( "Eigenvectors" )][Table Box( 1 )] << Make Combined Data Table;Any suggestions would be greatly appreciated.
Thanks a lot
Sebastien