Here is the example from the Scripting Index that shows how to Save Prediction Formula
And here is an example using a slight modification to your code, and using the Semiconductor Capability sample data table
Names Default To Here( 1 );
dt =
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
P = Partial Least Squares(
Y( :PNP1 ),
X( :Name( "NPN1" ), :Name( "NPN2" ), :Name( "NPN3" ), ),
Validation Method( None, Initial Number of Factors( 15 ) ),
Fit( Method( NIPALS ), Number of Factors( 15 ) ),
);
P << obj << (Fit[1] << Save Prediction Formula);
Jim