如何顯示包含擬合模型物件的擬合組?JMP社群的各位朋友,大家好!
我正在嘗試針對一系列反應變數產生擬合組模型報告,這些反應變數可能存在於資料中,也可能不存在。當我在圖形使用者介面 (GUI) 中執行此操作時,JMP 會自動刪除任何不存在的回應變數。但是,我需要在腳本中執行此操作,當我對所有可能的擬合模型執行擬合組時,它會為每個缺失的反應變數顯示模型規格。
我嘗試在一個循環中為現有變數擬合模型,將它們添加到列表中,然後在「擬合組」視窗中顯示(請參閱下方腳本)。但是,無論我是否使用“不可見”選項,“擬合模型”物件都不會顯示在“擬合組”視窗中。奇怪的是,我可以在「擬合組」視窗中顯示跨響應的分析器。
我非常感謝您能提供任何建議,告訴我我可能遺漏了什麼!
謝謝! ,
喬夫
responseVars = {"Logit[%TFRC+]", "Logit[融合度]", "Log[單元格計數]"};
fitList = {};
// Loop over the response variables to create individual fits
For( i = 1, i <= N Items( responseVars ), i++,
If( Contains(dt << Get Column Names( "String" ), responseVars[i]),
fit = Fit Model(
Y( Column( responseVars[i] ) ),
Effects( gRNA ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Screening" ),
Run (1),
Invisible // Prevent the window from showing
);
// Add the fit object to the list
Insert Into( fitList, fit );
);
);
// Create the Fit Group using the list of fits
fitGroup = Fit Group( fitList );
自動化和腳本編寫回覆:如何顯示包含擬合模型物件的擬合組?嗨@JoffJones ,
由於我沒有您的資料範例,所以我用 Tablet Production 的範例資料進行了測試。但看起來問題在於您沒有將 'gRNA' 視為一列,而應該是“:gRNA”,包括冒號“:”。請參閱下方我嘗試過的 Tablet 資料範例腳本。
dt=current data table();
responseVars = {"Dissolution", "Logit[Confluency]", "Log[Cell Count]"};
fitList = {};
// Loop over the response variables to create individual fits
For( i = 1, i <= N Items( responseVars ), i++,
If( Contains(dt << Get Column Names( "String" ), responseVars[i]),
fit = Fit Model(
Y( Column( responseVars[i] ) ),
Effects( :Atomizer Pressure ), //<<<<
<THIS bit="" here="" doesnt="" work="" when="" its="" effects=""></THIS>
回覆:如何顯示包含擬合模型物件的擬合組?我認為你可以用 FitGroup() 函數包裹你的循環。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
cols = {"NPN1", "IVP1", "PNP2"};
fg = Fit Group(
For Each({colname}, cols,
fit = dt << Fit Model(
Y(Eval(colname)),
Effects(:SITE),
Personality("Standard Least Squares"),
Emphasis("Effect Screening"),
Run (1)
);
);
);
回覆:如何顯示包含擬合模型物件的擬合組?謝謝@jthi !這真是個不錯的解決方案。請問您知道如何將 Profiler 和 Contour Profiler 加入 Fit Group 嗎?我最初嘗試過但沒有成功。
回覆:如何顯示包含擬合模型物件的擬合組?這算是比較權宜的解決方案,但是向 Fit Group 添加更多模型的方法並沒有文件說明,所以我選擇了這種方法。建立一個模型表達式列表,取代 Fit Group 中的列表並進行評估。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
cols = {"NPN1", "IVP1", "PNP2"};
fits = {};
For Each({colname}, cols,
fit_expr = EvalExpr(
dt << Fit Model(
Y(Expr(NameExpr(AsColumn(dt, colname)))),
Effects(:SITE),
Personality("Standard Least Squares"),
Emphasis("Effect Screening"),
Run(1)
);
);
Insert Into(fits, Name Expr(fit_expr));
);
fg = Eval(Substitute(fits, Expr(List), Expr(Fit Group)));
fg << Profiler(1);
fg << Contour Profiler(1);