使用 JSL 進行設置,以便控製圖不顯示給定參數缺少資料的批次。如題。
通常,在 JSL 中,我們指示批次(由給定列表示),並在控製圖上顯示點,如下所示:
Local Data Filter(
Close Outline( 1 ),
Add Filter(
columns( :Batch ),
Where(
:Batch == {"01/10/2022", "01/11/2022", "01/12/2022", "01/13/2022"}
),
Display( :Batch, N Items( 15 ), Find( Set Text( "" ) ) )
)
), 但是,我們如何請求考慮所有批次,除了給定參數的 N/A(資料表中的空白欄位)的批次之外?
JMP 版本:16。
自動化和腳本編寫回覆:使用 JSL 進行設置,以便控製圖不顯示給定參數缺少資料的批次。一種方法是使用關聯數組來取得所有唯一值,然後僅保留非缺失值。 然後,您可以將其作為清單傳遞給本機資料篩選器。 下面的例子:
Names Default To Here (1);
//open file and delete a few data points
dt = open ("$SAMPLE_DATA/Abrasion.jmp");
for each ({i}, 6::9,
:Date[i] = .
);
//get non-missing
lstdates = matrix (Associative Array (:Date) << Get Keys);
lstdates = as list(lstdates[loc(!Is Missing(lstdates))]);
//launch cc
cc = Control Chart Builder( Variables( Y( :Abrasion ) ), Show Control Panel( 0 ), );
//launch data filter
ldf = cc << Local Data Filter(
Add Filter(
columns( :Date ),
Where( :Date == lstdates ),
Display( :Date, N Items( 5 ) )
)
);
/*JMP STATISTICAL DISCOVERY LLC (“JMP”) PERMITS THE USE OF THIS COMPUTER SOFTWARE CODE (“CODE”) ON AN AS-IS BASIS AND AUTHORIZES YOU TO USE THE CODE SUBJECT TO THE TERMS LISTED HEREIN. BY USING THE CODE, YOU AGREE TO THESE TERMS. YOUR USE OF THE CODE IS AT YOUR OWN RISK. JMP MAKES NO REPRESENTATION OR WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRIGEMENT, AND TITLE, WITH RESPECT TO THE CODE.
You may use the Code solely as part of a software product you currently have licensed from JMP, JMP’s parent company SAS Institute Inc. (“SAS”), or one of JMP’s or SAS’s subsidiaries or authorized agents (the “Software”), and not for any other purpose. The Code is designed to add functionality to the Software but has not necessarily been tested. Accordingly, JMP makes no representation or warranty that the Code will operate error-free. JMP is under no obligation to maintain, support, or continue to distribute the Code.
Neither JMP nor its licensors shall be liable to you or any third-party for any general, special, direct, indirect, consequential, incidental, or other damages whatsoever arising out of or related to your use or inability to use the Code, even if JMP has been advised of the possibility of such damages. Except as otherwise provided above, the Code is governed by the same agreement that governs the Software. If you do not have an existing agreement with JMP or SAS governing the Software, you may not use the Code.
JMP and all other JMP Statistical Discovery LLC product or service names are registered trademarks or trademarks of JMP Statistical Discovery LLC in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies.
*/回覆:使用 JSL 進行設置,以便控製圖不顯示給定參數缺少資料的批次。我非常喜歡在平台內使用轉換列。以下是我建立以下腳本的控製圖部分的方法:
- 使用所有資料建立控製圖
- 在控制面板中,右鍵單擊“日期”並選擇“公式”
- 新增 Is Missing 和 Not 函數,以便當日期列不缺失時公式為 true 並關閉對話框
- 右鍵單擊新列並將其重新命名為“HasDate”
- 右鍵單擊新列旁邊的藍色三角形,並將其變更為名義資料類型
- 新增本機資料過濾器,轉換後的列將自動顯示在可用列的清單中
這是您應該得到的:

這是重新創建它的腳本:
Names Default To Here (1);
dt = open ("$SAMPLE_DATA/Abrasion.jmp");
dt << Control Chart Builder(
Transform Column( "HasDate", Nominal, Formula( !Is Missing( :Date ) ) ),
Variables( Y( :Abrasion ) ),
Show Control Panel( 0 ),
Local Data Filter( Add Filter( columns( :HasDate ), Where( :HasDate == 1 ) ) )
);
如果您確定該列對建立視覺效果或進行分析很有幫助,您可以右鍵單擊它並將其新增至資料表。
回覆:使用 JSL 進行設置,以便控製圖不顯示給定參數缺少資料的批次。很不錯, @ih !
回覆:使用 JSL 進行設置,以便控製圖不顯示給定參數缺少資料的批次。謝謝。 我認為你的答案很接近我想要的,只需對程式碼稍加修改就能讓我達到預期的結果。 不幸的是,我正處於 JMP SL 之旅的開始,如果您能幫助我獲得能夠完全實現我想要實現的目標的程式碼,我將不勝感激。因此,我將盡力更好地解釋我的問題。
我需要說的是,我使用循環來希望針對資料表中的不同參數執行控製圖。我無法使用您先前的提示來更改程式碼以將第 i 列作為要過濾的列。 我嘗試過:Column(i),但我不認為是這樣的...
我正在分享一段嘗試解釋我的意思的程式碼。
For( i = 2, i <= 5, i++,
dt << Control Chart Builder(
lstdates = Matrix( Associative Array( :Column( i ) ) << Get Keys );
lstdates = As List( lstdates[Loc( !Is Missing( lstdates ) )] );
Show Two Shewhart Charts( 0 );,
Sort by Row Order( 1 ),
Include Missing Categories( 0 ),
Show Excluded Region( 0 ), //sprawdź które to które
Show Limit Summaries( 0 ),
Variables( Subgroup( :Batch ), Y( :Column( i ) ) ),
Chart(
Points( Statistic( "Individual" ) ),
Limits( Sigma( "Levey Jennings" ) ),
Warnings( Test 1( 1 ), Test 2( 1 ), Test 3( 1 ), Test 4( 1 ) )
),
ldf = cc << Local Data Filter(
Add Filter( columns( :Column( i ) ), Where( :Column( i ) == lstdates ), Display( :Column( i ), N Items( 5 ) ) )
),
SendToReport(
Dispatch( {}, "graph display 1 title", TextEditBox, {Set Text( "Levey Jennings chart of " || Nazwy[i] )} ),
Dispatch( {}, "Subgroup display 1 title", TextEditBox, {Set Text( "Batch numer" )} )
)
);
)
);
回覆:使用 JSL 進行設置,以便控製圖不顯示給定參數缺少資料的批次。難道你不知道我該寫什麼嗎:日期,如果我要對資料表中的每個連續參數使用循環「for」?
回覆:使用 JSL 進行設置,以便控製圖不顯示給定參數缺少資料的批次。此範例應向您展示如何將所有連續列放入清單中,然後循環遍歷這些列。 順便說一句,如果您正在查看多個列,您是否考慮過模型驅動多元控製圖或流程篩選平台? 兩者都擅長簡化多個輸出的控製圖。
Names Default To Here( 1 );
//open sample data table
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
//get all numeric continuous colums, return list as strings
lstcols = dt << Get Column Names( Numeric, Continuous, String );
//run an analysis for each column in the list
For Each( {i}, lstcols,
dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :age ), Y( Column( i ) ) ), //Use each column
Elements( Points( X, Y, Legend( 3 ) ) )
)
);
/*JMP STATISTICAL DISCOVERY LLC (“JMP”) PERMITS THE USE OF THIS COMPUTER SOFTWARE CODE (“CODE”) ON AN AS-IS BASIS AND AUTHORIZES YOU TO USE THE CODE SUBJECT TO THE TERMS LISTED HEREIN. BY USING THE CODE, YOU AGREE TO THESE TERMS. YOUR USE OF THE CODE IS AT YOUR OWN RISK. JMP MAKES NO REPRESENTATION OR WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRIGEMENT, AND TITLE, WITH RESPECT TO THE CODE.
You may use the Code solely as part of a software product you currently have licensed from JMP, JMP’s parent company SAS Institute Inc. (“SAS”), or one of JMP’s or SAS’s subsidiaries or authorized agents (the “Software”), and not for any other purpose. The Code is designed to add functionality to the Software but has not necessarily been tested. Accordingly, JMP makes no representation or warranty that the Code will operate error-free. JMP is under no obligation to maintain, support, or continue to distribute the Code.
Neither JMP nor its licensors shall be liable to you or any third-party for any general, special, direct, indirect, consequential, incidental, or other damages whatsoever arising out of or related to your use or inability to use the Code, even if JMP has been advised of the possibility of such damages. Except as otherwise provided above, the Code is governed by the same agreement that governs the Software. If you do not have an existing agreement with JMP or SAS governing the Software, you may not use the Code.
JMP and all other JMP Statistical Discovery LLC product or service names are registered trademarks or trademarks of JMP Statistical Discovery LLC in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies.
*/回覆:使用 JSL 進行設置,以便控製圖不顯示給定參數缺少資料的批次。我認為我不明白的是為什麼在我的腳本中通過名稱(例如“:name”)引用給定的列可以工作,但通過“column(i)”則不行(我知道在代碼中上面我寫了一個錯誤:column(i),而不是column(i),但更正它並沒有改變任何東西...)