汽車 PAT 異常值篩選(零件平均測試)大家好,
我使用的是 Robust Fit 離群值 - 四分位數,結果適用於高螢幕和低螢幕,平均值 +/- 6 K(Sigma)。
現在我只看洩漏部分。 我只需要平均值 + 6 K (Sigma) 的異常值。
請告訴我如何透過 JSL 實現這一目標。 謝謝。
Explore Outliers(
Y(
:icc_aux10_total_vcc_1.000, :icc_aux10_VCCAUX10_vcc_1.000, :icc_aux18_total_vcc_1.000,
:icc_aux18_VCCAUX18_vcc_1.000, :icc_core_total_vcc_1.050, :icc_core_VCC_vcc_1.050,
:icc_core_lp_total_vcc_1.000, :icc_core_lp_VCC_vcc_1.000, :iccio_b_total_vcc_1.000,
:iccio_b_VCCIOB_vcc_1.000, :iccio_ltr_total_vcc_1.000, :iccio_ltr_VCCIOLTR_vcc_1.000
),
Robust Fit Outliers( K Sigma( 6 ), Huber( 0 ), Quartile( 1 ) ),
SendToReport( Dispatch( {}, "Commands", OutlineBox, {Close( 0 )} ) )
);品質和工藝工程回覆:汽車 PAT 異常值篩選(部分平均測試)上面我很小心地說「採用這種方法」:)。 在不代表其他人發言的情況下,在發布 JSL 片段時,我的目的(通常)是鼓勵某人弄清楚程式碼,然後能夠為自己走得更遠。
如果將 sigma 更改為 2,您將看到表中只有藍色單元格(低端的異常值),且程式碼不夠通用,無法處理此問題並產生您看到的錯誤。
請找到一個更完整的(未經測試的…)腳本,它應該涵蓋所有情況:
NamesDefaultToHere(1);
// Sample data
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Explore outliers
eo = dt << Explore Outliers(Y( :height ));
eo << Robust Fit Outliers( K Sigma( 2 ), Huber( 0 ), Quartile( 1 ) );
eo << obj << Color Cells( :height ); // Blue (red) cells are 'low' ('high')
// Get the column script
colScript = :height << getScript;
// Initialise lists (which may or may not be updated by the subsequent code)
redRowList = {};
blueRowList = {};
// Find the location of the sub-expression 'Color Cells'. if there are no outliers, 'colorCellsExist' will be 0
subExpr = {};
for(i=1, i<=NArg(colScript), i++, InsertInto(subExpr, Head(Arg(colScript, i))));
colorCellsExist = Contains(subExpr, Expr(Color Cells));
// Find the row numbwrs of any high (red) cells or low (blue) cells (red is '35', blue is '37'):
// Need to handle situations in which there are only high outliers, only low outliers, both high and low
// outliers, or no outliers
if(
colorCellsExist,
// Get the 'Color Cells' expression in the column script
cs = Arg(colScript, colorCellsExist);
if(
// If 'cs' is a list of lists, we have both high and low outliers . . .
IsList(Arg(cs, 1)[1]),
for(i=1, i<=NItems(Arg(cs, 1)), i++,
if(
(Arg(cs, 1)[i])[1] == 35, redRowList = (Arg(cs, 1)[i])[2];
(Arg(cs, 1)[i])[1] == 37, blueRowList = (Arg(cs, 1)[i])[2];
);
);
,
// . . . or if 'cs' is not a list of lists, we have either high or low outliers (but not both)
if(
Arg(cs, 1)[1] == 35, redRowList = Arg(cs, 1)[2],
Arg(cs, 1)[1] == 37, blueRowList = Arg(cs, 1)[2]
);
);
);
Print("High: "||Char(redRowList)||" Low: "||Char(blueRowList));
回覆:汽車 PAT 異常值篩選(部分平均測試)嗨伊恩,
抱歉回覆晚了。 現在我有 JMP17 來運行你的腳本。 沒有你提到的錯誤。 分別顯示紅色/藍色。
我嘗試將西格瑪從 1 更改為 2,3,4,5,6,然後發現相同的錯誤。
知道如何解決這個問題嗎?
謝謝。
回覆:汽車 PAT 異常值篩選(部分平均測試)使用紅色和藍色著色只是繞過以下事實的一種間接方式:(據我所知),沒有直接的方法要求 JMP 進行單側篩選(根據需要在高側或低側) 。
對於我(在 Mac 上使用 JMP 17.1)來說,上面發布的程式碼不會產生錯誤。 它列印:
{25, 27, 30, 37, 39, 40}
到日誌,這是包含高端異常值的行號列表(表中的紅色單元格)。
回覆:汽車 PAT 異常值篩選(部分平均測試)嗨伊恩,
感謝您的回覆。
1. 穩健擬合離群值適用於兩個方向,以下的公式是將 +1 sigma 或 -1 sigma 中的行標記為紅色。
我想僅用+1 sigma 標記該行。
eo << Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) );
2. 請您幫忙列印 Collist,這正是我正在尋找的。
我收到的錯誤是物件在存取或評估'Arg (cs,1) [n]/*###*/1]', Arg(cs,1)[n]/*###*/ 時不可下標1]'
能再審核一下嗎?謝謝。
回覆:汽車 PAT 異常值篩選(部分平均測試)我最終操縱了表達式。 如果沒有更好的方法,您應該能夠採用這種方法:
NamesDefaultToHere(1);
// Sample data
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Explore outliers
eo = dt << Explore Outliers(Y( :height ));
eo << Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) );
eo << obj << Color Cells( :height ); // Blue (red) cells are 'low' ('high')
// Get the row numbers of the red cells . . .
// (1) Get the column script
colScript = :height << getScript;
// (2) Find the 'Color Cells' expression in the column script
n = 1;
While(Head(Arg(colScript, n)) != Expr(Color Cells), n++);
cs = Arg(colScript, n);
// (3) Find the row numbwrs of the red cells (red is '35')
n = 1;
While((Arg(cs, 1)[n])[1] != 35, n++);
redRowList = (Arg(cs, 1)[n])[2];
Print(redRowList);回覆:汽車 PAT 異常值篩選(部分平均測試)你好,
按照我的上一篇文章,我正在使用穩健擬合離群值 - 預設功能是篩選高/低離群值,平均值+/-6 西格瑪。
對於某些項目,我們只需要篩選平均值+6西格瑪之外的異常值(例如洩漏項目,低就好)。
誰能告訴我如何只對平均值 + 6 西格瑪使用穩健擬合離群值?
謝謝