如何显示包含拟合模型对象的拟合组?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);