你好,
我不確定我的腳本有什麼問題。 它應該採用 PQA 的用戶輸入值(分類變量)並生成包含每個 PQA 的自定義單向結果的輸出腳本,使用子集數據集獲取讀取到保存到腳本中所需的信息原始數據表。 例如,當我使用腳本的用戶輸入窗口在玩具數據表上運行以下 JMP 代碼時,我收到一條錯誤消息(見下圖)。
JMP代碼:
/*
Objective:
Get a JMP report with customized comparability model output,
given a data table with column names:
- batch name/lot number
- Mfg Group
- PQA
- result
- measurment units
- LSL
- USL
The comparability output will give the process charts and the
TOST results.
*/
/////////////////////////////////////////////////////////////
//User Selection Menu(s)
/////////////////////////////////////////////////////////////
//select the data in the original data table
Names Default To Here( 1 );
dt = Current Data Table();
//get the unique PQAs
col9 = Column(dt, "PQA");
unique_pqa = Associative Array( col9 ) << get keys;
//Part 2: Select PQA(s) and invisibility option.
invisible_window_options = {"invisible", "visible"};
nw2 = New Window("Select PQAs",
<<MODAL></MODAL> variablebox1_pqa << Set All(this << Get, run script(1))))),
Text Box("Select All PQAs", <<SET width=""></SET> Is String(units), " (" || units || ") ");
//get the spec limits
lslval = :LSL[1];
uslval = :USL[1];
lpcrval = :Name("Lower_PCR")[1];
upcrval = :Name("Upper_PCR")[1];
//TO DO: write in the max_val and min_val from stability script to
//set the significance level based on the number of spec limits present
alpha_level_a = If(!Is Missing(lslval) & !Is Missing(uslval), 0.1, 0.2);
dt << New Script (
"JMP report results for " || pqa_val,
//TO DO: Wrap process chart and TOST results into an initalized window
//Process Chart
Oneway(
//SendToByGroup( {:PQA == Expr(pqa_val)},
//Y( :Result ) ),
Y( :Result N ),
X( :Name("Batch Name") ),
Connect Means( 1 ),
Grand Mean( 0 ),
//),
// SendToByGroup(
// {:PQA == pqa_val},
Where( :PQA == Expr(pqa_val) ),
SendToReport(
Dispatch(
{},
"Oneway Analysis of Result N By Batch Name",
OutlineBox,
{Set Title( "Oneway Analysis of " || Expr(pqa_val) || Expr(units_formatted) || " Result N By Batch Name")}
),
Dispatch(
{},
"Result N",
TextEditBox,
{Set Text( Expr(pqa_val) || Expr(units_formatted) )}
),
Dispatch(
{},
"2",
ScaleBox,
{Label Row( Set Font Size( 5 ) )}
),
Dispatch(
{},
"1",
ScaleBox,
{Min( Expr(lslval)*0.9 ), Max( Expr(uslval)*1.1 ), Inc( 1 ), Minor Ticks( 1 ),
Add Ref Line(
Expr(lslval),
"Solid",
"Dark Red",
"LSL (" || char(Expr(lslval)) || ")",
2
),
Add Ref Line(
Expr(uslval),
"Solid",
"Dark Red",
"USL (" || char(Expr(uslval)) || ")",
2
),
Add Ref Line(
Expr(lpcrval),
"Dashed",
"Dark Blue",
"Lower PCR Limit (" || char(Expr(lpcrval)) || ")",
2
),
Add Ref Line(
Expr(upcrval),
"Dashed",
"Dark Blue",
"Upper PCR Limit (" || char(Expr(upcrval)) || ")",
2
)
}
),
Dispatch(
{},
"Oneway Plot",
FrameBox,
{Frame Size( 1000, 300 ), DispatchSeg(
CustomStreamSeg( 6 ),
{Line Color( "Gray" )}
), Row Legend(
Group,
Color( 0 ),
Color Theme( "" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
//) //send to by group
); //Process chart Oneway
//TOST results
Oneway(
Y( :Result N ),
X( :Group ),
t Test( 1 ),
Set α Level( Expr(alpha_level_a) ),
Where( :PQA == Expr(pqa_val) ),
SendToReport(
Dispatch(
{},
"Oneway Analysis of Result N By Group",
OutlineBox,
{Set Title( "Oneway Analysis of " || Expr(pqa_val) || Expr(units_formatted) || " Result N By Group" )}
),
Dispatch(
{},
"Result N",
TextEditBox,
{Set Text( Expr(pqa_val) || Expr(units_formatted) )}
))
); //TOST oneway
); //dt new script
) //eval expression
); //eval
//); //content V List box
//append each output into the initialized nw window above.
//container << Append(content);
); //for loop玩具 JMP 數據集:

JMP 用戶輸入模式窗口

JMP 錯誤消息:“名稱未解析:units_formatted 訪問或評估‘units_fortmatted’,...”

例如,為什麼 JMP 不讀取由 for 循環的每次迭代產生的每個 PQA 子集數據集 listDT 的測量單位列,以便 PQA = A 的測量單位為“%”並放置在 y 軸標籤上腳本中的圖表?
對不起,謝謝你讓我知道! 我忘記在我原來的帖子中作為附件把它拿出來。