顯示一個文本框,要求用戶輸入你好,
我想添加文本編輯框,要求用戶輸入 Q 和尾部分位數的值以探索異常值。 這是我嘗試過的,但似乎我錯過了一些東西。 你能建議這可能有助於解決這個問題嗎?
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");
check_list = {"SS", "SE", "PH"};
todo_list = {};
nw = new window("Checkboxes", << modal(),
"Input",
V List Box( Text Box( "Enter Tail Quantile " ), tail = Text Edit Box() ,
Text Box( "Enter Q Value " ), quan = Text Edit Box() ),
my_cb = checkbox(check_list),
panelbox("Actions",
hlistbox(
button box("OK",
ta = tail << get text();
qu = quan << get text();
keep_going = 1;
todo_list = my_cb << get selected;
),
button box("Cancel", keep_going = 0)
),
),
);
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "SS"), Insert Into(filteredCols, colList[i]))
);
obj = dt <<
Explore Outliers(
Y((Eval(filteredCols) )));
obj << Quantile Range Outliers;
obj << Tail Quantile (ta);
obj << Q(qu);
obj << Select Rows(All);
腳本編寫回复:顯示一個文本框,要求用戶輸入尾分位數和 Q 條目都需要是數字,而不是字符串/文本。使用 Num() 函數進行轉換。
回复:顯示一個文本框,要求用戶輸入一些修改 - 您的原始代碼沒有初始化一些東西。我使用 number edit box() 和 lineup box() 以獲得更好的外觀。數字編輯框只允許輸入數字。

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");
check_list = {"SS", "SE", "PH"};
todo_list = {};
nw = new window("Checkboxes", << modal(),
text box("Input"),
Lineup Box( N Col( 2 ),
Text Box( "Enter Tail Quantile: " ), tail = number Edit Box() ,
Text Box( "Enter Q Value: " ), quan = number Edit Box()
),
my_cb = checkbox(check_list),
panelbox("Actions",
hlistbox(
button box("OK",
ta = tail << get();
qu = quan << get();
keep_going = 1;
todo_list = my_cb << get selected;
),
button box("Cancel", keep_going = 0)
),
),
);
collist = dt << get column names(string);
filteredcols = {};
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "SS"), Insert Into(filteredCols, colList[i]))
);
obj = dt << Explore Outliers( Y((Eval(filteredCols) )));
obj << Quantile Range Outliers;
obj << Tail Quantile (ta);
obj << Q(qu);
obj << Select Rows(All);回复:顯示一個文本框,要求用戶輸入謝謝@pmroz ,
該腳本工作正常,但問題是它採用默認值來評估異常值而不是輸入值。 請參閱下面的屏幕截圖
以下分析基於尾分位數為 0.1 和 Q 為 3。 我輸入了 0.4。和 3 在編輯框。 我厭倦了使用重做分析,但它沒有選擇窗口中的所有行。 有什麼建議嗎?
