Script to save prediction formula of PLSHello,
I'm using a script to run PLS on my data, but I'm having a hard time getting it to save the prediction formula & values into a column in the data sheet. Is this possible? Here's what I'm using so far:
Names Default To Here( 1 );
<
P = Partial Least Squares(
Y( :Viability ),
X( :Name( "976" ), :Name( "778" ), :Name( "973" ), ),
Validation Method( None, Initial Number of Factors( 15 ) ),
Fit( Method( NIPALS ), Number of Factors( 15 ) ),
);
P << prediction formula;
>
Thanks
Advanced Statistical ModelingRe: Script to save prediction formula of PLSIs there a function to get the prediction formula from a fit as JSL code - without saving it to a column or using a Formula Depot?
Something more robust than
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
myFit = dt << Fit Model( Y( :height ), Effects( :age, :sex ), Run() );
FormulaExpr=Arg(Arg(myFit << Get Prediction Formula,3))<BR />
Re: Script to save prediction formula of PLSWorked like a charm, thanks Jim!
Re: Script to save prediction formula of PLSHere 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);