我正在尝试编写一个强大的脚本,该脚本将允许用户指定 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)
)));