使用 For 循環創建擬合組二元圖我想要一個簡單的 for 循環來創建與沒有 for 循環相同的圖表,而不是使用硬編碼的列名作為輸入。
dt = Open("C:\Program Files\SAS\JMP\15\Samples\Data\semiconductor capability.jmp");
Y_parameters = {"NPN1", "NPN2", "NPN3"};
X_parameters = {"PNP1", "PNP2", "PNP3"};
Fit Group(
//For i:
//For j:
Bivariate( Y( As Column(dt, Y_parameters[i]) ), X( As Column(dt, X_parameters[j])) ),
//end For j:
//end For i
//Want to replace the hard coded Y and X parameters with above for loop
Bivariate( Y( :NPN1 ), X( :PNP1 ) ),
Bivariate( Y( :NPN1 ), X( :PNP2 ) ),
Bivariate( Y( :NPN1 ), X( :PNP3 ) ),
Bivariate( Y( :NPN2 ), X( :PNP1 ) ),
Bivariate( Y( :NPN2 ), X( :PNP2 ) ),
Bivariate( Y( :NPN2 ), X( :PNP3 ) ),
Bivariate( Y( :NPN3 ), X( :PNP1 ) ),
Bivariate( Y( :NPN3 ), X( :PNP2 ) ),
Bivariate( Y( :NPN3 ), X( :PNP3 ) ),
<<{Arrange in Rows( 3 )}
);腳本編寫回复:使用 For 循環創建擬合組二元圖如果你想獲得所有組合,我認為你可以使用
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
Y_parameters = {"NPN1", "NPN2", "NPN3"};
X_parameters = {"PNP1", "PNP2", "PNP3"};
Fit Group(
Bivariate( Y(Eval(Y_parameters)), X(Eval(x_parameters))),
<<{Arrange in Rows( 3 )}
);
回复:使用 For 循環創建擬合組二元圖一如既往地感謝您的建議。
您是否有關於獲取某些貨幣對圖表的建議。 比如NPN1 vs PNP1和NPN2 vs PNP2?回覆:使用 For 迴圈建立擬合組二元圖表我很可能會用兩個列表(或關聯數組)然後循環來完成。我想我什至不會使用 Fit Group,除非我真的必須這樣做,並且只是用展示盒創建它們。
您也可以嘗試使用表達式,但這很快就會變得混亂和複雜(至少這個解決方案不像我想使用的那樣強大,我只是嘗試了不同的東西並讓它工作):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
Y_parameters = {"NPN1", "NPN2", "NPN3"};
X_parameters = {"PNP1", "PNP2", "PNP3"};
fg_expr = Expr(
dt << Fit Group(test, <<{Arrange in Rows(3)})
);
biv_expr = Expr({});
For(i = 1, i <= N Items(Y_parameters),i++,
next_biv = Eval Expr(Bivariate(Y(Column(Expr(Y_parameters[i]))), X(Column(Expr(X_parameters[i])))));
Insert Into(biv_expr, Name Expr(next_biv));
);
Substitute Into(fg_expr, Expr(test), Expr(EvalList(NameExpr(biv_expr))));
Show(Name Expr(fg_expr));
fg_expr;
回覆:使用 For 迴圈建立擬合組雙變量圖表@jthi @Wendy_Murphrey我一直在遵循這個解決方案。不太確定如何使用 eval expr。我正在嘗試循環半導體晶圓的參數列。由於某種原因,關聯數組對我來說不起作用(我使用的是 JMP pro 18),所以我選擇了列表方法。非常感謝你的幫忙!謝謝
startcol = 37;
endCol = N Cols(dt);
For(t = startCol, t <= endCol, t++,
Insert Into(targetList, AllColList[t])
);
Summarize(dt, newlist = by(:waferno));
fg_expr = Expr(
dt << Fit Group(test, <<{Arrange in Rows(1)}, Order by Goodness of Fit)
);
ow_expr = Expr({});
currentlabel = targetList[1];
currentwafer = newlist[1];
For(ilabel = 1, ilabel <= 2, ilabel++,
nextlabel = targetList[ilabel + 1];
Show(nextlabel);
For(iwfr = 1, iwfr <= 2, iwfr++,
nextwafer = newlist[iwfr + 1];
Show(nextwafer);
//nw2=vl<
<APPEND></APPEND>