脚本问题:强制保存逆向预测公式到预先存在的列中大家好,
我想强制将称为“保存逆预测公式”的线性模型的“拟合曲线”输出保存到已定义且已存在的列中(例如“预测浓度”)。 可以通过编写脚本来实现吗? 原因是随着新数据定期进入,应该启动一个脚本来计算和保存更新的逆向预测公式并覆盖数据集中的现有公式,我在脚本库中找到了这个示例,但我确实这样做了不知道如何覆盖数据中现有的逆预测公式。
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 />
谢谢,
干杯,瓦莱丽
回复:脚本问题:强制保存逆预测公式到预先存在的列中这是一种方法:
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));