鎖定的列弄亂了腳本我教授離群值箱形圖,並編寫了一個腳本來添加鬍鬚的整個長度,這樣我就可以直觀地向我的班級展示鬍鬚的計算方式。 除非我的專欄被鎖定,否則該腳本效果很好。 為什麼鎖定列會影響我的腳本? 腳本運行後,我將腳本保存到腳本窗口,它是正確的,但它不會繪製某些組上的鬍鬚。 這是我的腳本,我仍在處理它,我在 MacBook 上使用 JMP Pro 17.0.0:
Names Default To Here( 0 );
Clear Log();
dt = Current Data Table();
If( Not( Is Scriptable( dt ) ),
// Check that there is a data set open;
// ca=Caption("Please Open Design Data Set", Back Color(yellow));
// Stop();
dtsel = Pick File( "Open File", {"JMP|jmp", "All files|*"} );
If( dtsel == "",
Stop(),
Try( dt = Open( dtsel ), Stop() )
);
);
output = Expr(
dt2 = Data Table( dt ) << Summary(
Group( bycol ),
Median( nm ),
Interquartile Range( nm ),
Quantiles( 25, nm ),
Quantiles( 75, nm ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 )
);
columnnamemedian = Column( dt2, 3 ) << Get Name;
columnnamesample = Column( dt2, 2 ) << Get Name;
columnnamegroup = Column( dt2, 1 ) << Get Name;
columnameIQR = Column( dt2, 4 ) << Get Name;
columnname25 = Column( dt2, 5 ) << Get Name;
columnname75 = Column( dt2, 6 ) << Get Name;
Medians = Column( dt2, columnnamemedian ) << Get As Matrix;
Samplesize = Column( dt2, columnnamesample ) << Get As Matrix;
Groups = Column( dt2, columnnamegroup ) << Get As Matrix;
IQR = Column( dt2, columnameIQR ) << Get As Matrix;
Q25 = Column( dt2, columnname25 ) << Get As Matrix;
Q75 = Column( dt2, columnname75 ) << Get As Matrix;
meanno = N Rows( dt2 );
LWhis = {};
UWhis = {};
i = 1;
For( i = 1, i <= meanno, i++,
LWhis[i] = Q25[i] - 1.5 * IQR[i];
UWhis[i] = Q75[i] + 1.5 * IQR[i];
Show( Q25[i] );
Show( Q75[i] );
Show( LWhis[i] );
Show( UWhis[i] );
Show( IQR[i] );
Show( i );
If( LWhis[i] > Q25[i],
LWhis[i] = Q25[i],
LWhis[i] = LWhis[i]
);
If( UWhis[i] < Q75[i],
UWhis[i] = Q75[i],
UWhis[i] = UWhis[i]
);
);
MinLW = LWhis[1];
MaxUW = UWhis[1];
i = 1;
For( i = 1, i <= meanno, i++,
If( LWhis[i] < MinLW,
MinLW = LWhis[i],
MinLW = MinLW
);
If( UWhis[i] > MaxUW,
MaxUW = UWhis[i],
MaxUW = MaxUW
);
);
If( MinLW < 0,
MinLW = MinLW * 1.1,
MinLW = MinLW * 0.9
);
If( MaxUW < 0,
MaxUW = MaxUW * 0.9,
MaxUW = MaxUW * 1.1
);
Current Data Table( dt );
//Close(dt2, NoSave);
gb = Graph Builder(
Variables( X( (Column( bycol )) ), Y( Column( nm ) ) ),
Elements( Points( X, Y ), Box Plot( X, Y ) ),
SendToReport(
Dispatch( {} ),
),
);
gbr = gb << report;
Report( gb )[AxisBox( 2 )] << Max( MaxUW ) << Min( MinLW );
i = 1;
For( i = 1, i <= meanno, i++,
Show( LWhis[i] );
Show( UWhis[i] );
Eval(
Eval Expr(
gbr[Framebox( 1 )] << Add graphics Script(
Pen Color( Red );
Line Style( "Dotted" );
V Line( Expr( i ), Expr( LWhis[i] ), Expr( Q25[i] ) );
V Line( Expr( i ), Expr( Q75[i] ), Expr( UWhis[i] ) );
);
)
)
;
);
//dt2 << Minimize Window;
Close( dt2, Nosave );
);
w = New Window( "Variables",
<<MODAL></MODAL>蘋果系統回覆:鎖定的列弄亂了腳本您能提供一些例子嗎? 發生該情況的圖像或資料集。 不確定為什麼鎖定的列會影響圖形腳本,但您可能必須修改行的「索引」以從 0 而不是 1 開始
(1 和 2)

(0 和 1)

回覆:鎖定的列弄亂了腳本
第一個沒有畫線,但是當我查看這個的腳本時,它表明它應該有它們。 數字 7 是一個間隙,而 3 是錯誤的,這是這個精確繪圖的腳本,請注意紅線與繪製的內容沒有對齊。 我已附上我用於此目的的 JMP 文件:
Graph Builder(
Variables( X( :Process Configuration ), Y( :Y ) ),
Elements( Points( X, Y, Legend( 1 ) ), Box Plot( X, Y, Legend( 2 ) ) ),
SendToReport(
Dispatch(
{},
"Y",
ScaleBox,
{Min( 6.36165 ), Max( 36.07175 ), Inc( 5 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
13,
Description( "" ),
Pen Color( Red );
Line Style( "Dotted" );
V Line( 1, 13.039, 18.502 );
V Line( 1, 22.144, 27.607 );
), Add Graphics Script(
14,
Description( "" ),
Pen Color( Red );
Line Style( "Dotted" );
V Line( 2, 7.0685, 16.061 );
V Line( 2, 22.056, 31.0485 );
), Add Graphics Script(
15,
Description( "" ),
Pen Color( Red );
Line Style( "Dotted" );
V Line( 3, 11.772, 17.973 );
V Line( 3, 22.107, 28.308 );
), Add Graphics Script(
16,
Description( "" ),
Pen Color( Red );
Line Style( "Dotted" );
V Line( 4, 14.0465, 18.737 );
V Line( 4, 21.864, 26.5545 );
), Add Graphics Script(
17,
Description( "" ),
Pen Color( Red );
Line Style( "Dotted" );
V Line( 5, 13.529, 18.002 );
V Line( 5, 20.984, 25.457 );
), Add Graphics Script(
18,
Description( "" ),
Pen Color( Red );
Line Style( "Dotted" );
V Line( 6, 8.0605, 17.335 );
V Line( 6, 23.518, 32.7925 );
), Add Graphics Script(
19,
Description( "" ),
Pen Color( Red );
Line Style( "Dotted" );
V Line( 7, 16.3455, 19.356 );
V Line( 7, 21.363, 24.3735 );
)}
)
)
);回覆:鎖定的列弄亂了腳本如果我將發送給您的表複製到一個沒有鎖定列的新表中,它就可以工作。 如何修改該行的「索引」? 我還有其他帶有鎖定列的文件,它們也不起作用。
回覆:鎖定的列弄亂了腳本這些線移動了一位(我認為標稱/序數資料 X 軸從 0 開始


您可以修改腳本的這一部分
For(i = 1, i <= meanno, i++,
Show(LWhis[i]);
Show(UWhis[i]);
Eval(
Eval Expr(
gbr[Framebox(1)] << Add graphics Script(
Pen Color(Red);
Line Style("Dotted");
V Line(Expr(i), Expr(LWhis[i]), Expr(Q25[i]));
V Line(Expr(i), Expr(Q75[i]), Expr(UWhis[i]));
);
)
);
);
最簡單的方法是在 V 線 (Expr()) 內加入 i-1。
回覆:鎖定的列弄亂了腳本我確實嘗試將名義列更改為數字/連續,看看它是否有效,但沒有。 唯一可行的方法是將其複製到另一個表中,因此我認為它是鎖定的列。 我不確定為什麼它不起作用,但是當我添加一個 if 語句來查找建模類型是名義型還是連續型並添加您的建議時,它確實起作用了。 所以我仍然很困惑,但已經成功了。 謝謝你! 我認為我不會弄清楚這一點,因為我確實嘗試將其轉換為數字/連續,但它不起作用。