腳本問題:強制保存逆向預測公式到預先存在的列中大家好,
我想強制將稱為“保存逆預測公式”的線性模型的“擬合曲線”輸出保存到已定義且已存在的列中(例如“預測濃度”)。 可以通過編寫腳本來實現嗎? 原因是隨著新數據定期進入,應該啟動一個腳本來計算和保存更新的逆向預測公式並覆蓋數據集中的現有公式,我在腳本庫中找到了這個示例,但我確實這樣做了不知道如何覆蓋數據中現有的逆預測公式。
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));