我正在嘗試編寫一個強大的腳本,該腳本將允許使用者指定 Sigma K 值並從所有連續列的清單中選擇 Y 列,並為每個列建立 LJ 圖表並將限制儲存到高資料表中。
該腳本沒有產生任何錯誤,但也沒有創建圖形輸出。
我看不出我哪裡做錯了,下面是腳本並附上
謝謝
Names Default To Here(1);
dt = Current Data Table();
// Get list of continuous columns
contCols = {};
For(i = 1, i <= N Cols(dt), i++,
col = Column(dt, i);
If(col << Get Modeling Type == "Continuous",
Insert Into(contCols, col << Get Name)
);
);
If(N Items(contCols) == 0,
Show Message(
"No continuous columns found.", "Please ensure your data table has continuous columns."
);
Stop();
);
// Dialog for selecting columns and k
colList = .;
kNum = .;
dialogResult = .;
nw = New Window("Levey-Jennings Chart Setup",
<
<MODAL></MODAL>
<P>編輯(jthi):新增 jsl 格式</P>
腳本裡有很多錯誤,我猜是某個法學碩士寫的。如果你想在 JMP 中編寫非 JMP 腳本,我建議你查看《腳本指南》 。
看更多...
Names Default To Here(1);
dt = Current Data Table();
nw = New Window("Levey-Jennings Chart Setup", << Type("Modal Dialog"),
H List Box(
Lineup Box(N Col(1),
Text Box("Select up to 50 continuous columns:"),
fcs = Filter Col Selector(dt, << Nominal(0), << Ordinal(0), << Continuous(1), Character(0), << Set Max Selected(50)),
Text Box("Enter k (number of SDs for Shewhart control limits):"),
neb = Number Edit Box(3)
),
Lineup Box(N Col(1),
Button Box("OK",
selcols = fcs << get selected;
ksig = neb << get;
),
Button Box("Cancel")
)
)
);
If(nw["Button"] != 1,
Throw("Cancelled");
);
If(N Items(selcols) == 0,
Throw("No columns selected");
);
collist = Transform Each({colname}, selcols, Name Expr(AsColumn(dt, colname)));
Substitute Into(collist, Expr(List), Expr(Y));
ccb = Eval(EvalExpr(dt << Control Chart Builder(
Show Two Shewhart Charts(0),
K Sigma(Expr(ksig)),
Variables(Expr(Name Expr(collist))),
Chart(Points(Statistic("Individual")), Limits(Sigma("Levey Jennings"))),
Show Control Panel(0)
)));