Scripting question: Force the saving inverse prediction formula into a preexisting columnHi all,
I would like to force the saving of a “Fit Curve” output of a linear model called “save inverse prediction formula” into a defined and already existing column (e.g. “predicted concentration”). Is that possible by scripting this? The reason why is as new data is coming regularly in, a script should be launched in order to calculate and save an updated inverse prediction formula and overwrite the existing one in the data set, I have found this example in the scripting library but i do not know how to overwrite an existing inverse prediction formula in the data.
Names Default To Here( 1 );
dt = Open(
"$SAMPLE_DATA/Nonlinear Examples/Bioassay.jmp"
);
obj = dt <<
Fit Curve(
Y( :Toxicity ),
X( :log Conc ),
Group( :formulation )
);
obj <<
Fit Logistic 4P(
Save Inverse Prediction Formula
);<BR /><BR />col1 = column (5);<BR />col1 << Set name ("Prediction Concentration");<BR />
Thank you,
Cheers, Valérie
Re: Scripting question: Force the saving inverse prediction formula into a preexisting columnHere's one way:
Names Default To Here( 1 );
// Suppose "Prediction Concentration" is the column that should hold teh formula
dt = Open( "$SAMPLE_DATA/Nonlinear Examples/Bioassay.jmp" );
dt << NewColumn("Prediction Concentration", Numeric, Continuous, Values(1::NRow(dt)));
Wait(3);
// Do the analysis, the formula column is saved as a new column at the end
obj = dt << Fit Curve( Y( :Toxicity ), X( :log Conc ), Group( :formulation ) );
obj << Fit Logistic 4P( Save Inverse Prediction Formula );
// Copy the formula to the column you want
form = Column(dt, NCol(dt)) << getFormula;
Column(dt, "Prediction Concentration") << Formula(NameExpr(form));
Wait(3);
// Delete the last column generated by 'Fit Curve'
dt << deleteColumn(NCol(dt));