我快速查看了一下,請注意我使用的是 JMP16 和 For Each() 而不是 For()。
問題一:
我認為您需要獲得對大綱框的單獨引用,一種選擇是也使用 XPath,然後遍歷列表列表。 還
//creates a report and maximizes desirability
//doesn't work if there is anything in the by() field
pf_obs = fit << XPath("//OutlineBox[text()='Prediction Profiler']"); // list of lists so easiest to loop over them
For Each({pf_ob}, pf_obs,
pf = pf_ob << Get Scriptable Object;
pf << Maximize and Remember;
);
//create a data table with the parameters from the prediction profile
//in my other version (with the for loop a Where( :x = y[i]) in the model, I than had some code to concatenate tables together and change some formatting
dtout[1] = Report(fit[1])["Prediction Profiler"]["Remembered Settings"][Table Box(1)] << Make Combined Data Table

問題2:
我會對這部分代碼做更大的重構以使其更乾淨,但您也可以為此進行“快速修復”。 使用 Insert Into 將 Response Limits 添加到 Profiler 表達式
jslExprProfiler = expr(
Profiler( 1,
Confidence Intervals( 1 ),
Desirability Functions( 1 ),
//sets desirability target of the crit response
_Y2_ << Response Limits(
{Lower( ytarg-1, 0.0183 ), Middle( ytarg, 1 ), Upper( ytarg+1, 0.0183 ),
Goal( "Match Target" ), Importance( 1 )}
)
);
);
For Each({mod}, ModList,
Insert Into(
jslExprProfiler, EvalExpr(
Expr(mod) << Response Limits({Lower(1, 1), Middle(2, 1), Upper(3, 1), Goal("None"), Importance(1)})
)
)
);
jslExprProfiler = Substitute(
Expr(fit << _prof_),
Expr(_prof_), Name Expr(jslExprProfiler)
);
jslExprProfiler = Substitute(
Name Expr(jslExprProfiler),
expr(_Y2_), nameexpr(yList[1])
);
完整代碼:
查看更多... 你好,
我正在編寫一個腳本,允許用戶
- 選擇適合模型的列
- 確定主要變量並指定目標值
- 確定要按哪一列拆分模型
- 允許 JMP 創建模型,優化合意性以達到預期目標,然後輸出模型結果
- 從方便的輸出表中復制結果
我有一些功能性腳本,可以在不允許用戶輸入或選擇的情況下執行我想要的操作,但是使腳本具有交互性一直是一項挑戰。 我想我大部分時間都在那裡,但我有一些我正在努力解決的具體問題
- 問題 1:在此腳本的先前版本中,我使用帶有 While( x == "y[i]") 行的 for 循環為每個模型使用不同的窗口。 我寧願使用 By( :x ),因為它更靈活並且提供一個輸出窗口。 但是,使用 By( :x ) 會中斷後面的腳本以從報告中獲取可編寫腳本的對象。 是否可以為模型窗口中的每個子框創建不同的報告? 或者更好的方法來編碼第 173-181 行? 我根據另外兩個線程構建這些行:線程 1 ,線程 2 .
- 問題 2:我需要能夠在沒有合意性函數的情況下建模的可變數量效果的選項(稍後完整腳本也將具有最小化的效果,但這個簡化的演示腳本變得太複雜了。 在第 122-126 行,我能夠在 ModExpr 中創建所需的表達式,但是因為它是一個列表,所以當我試圖將它直接替換到配置文件中時它不起作用。 我的解決方法是讓佔位符的數量大於我期望建模的變量數量,如果我的建模效果少於 6 個,代碼似乎只會忽略無意義的部分……但這看起來非常糟糕。 有沒有辦法修復第 130-134 行中的註釋代碼,以便將列表組合成一個可以工作的單個表達式? 我也無法讓 Concatenation 發揮出色,但我敢打賭我錯過了一些簡單的東西。
這是使用示例數據的示例腳本。 該模型非常適合,但這對於演示來說並不重要。 運行時,如果清除“by”的選擇,一切都會正常運行並輸出結果。 如果“by”部分中還有任何內容,那麼第 174 行將會中斷。
感謝您的任何幫助!
Names Default To Here( 1 );
//sample data for demo
dt = Open( "$SAMPLE_DATA/Football.jmp" );
xvar = {};
yvar = {};
byvar = {};
ytarg = 60;
dtout = {};
//let users select the columns to model
win = New Window( "Model Variable Selection",
<<MODAL></MODAL>