JSL-- 表上的通用分佈嘿,
我想在桌上運行直方圖。
每個表的輸出是“結果”列,並按“測試名稱”分隔。
我想要一個可以處理不同“測試名稱”的通用程式碼。
我努力了:
dt1 = Open();
:result << Set Data Type( Numeric, "Continuous" );
:range_min << Set Name( "LSL" );
:range_max << Set Name( "USL" );
limits = dt1 << Summary( Group( :test_name ), Mean( Eval( "LSL" ) ), Mean( Eval( "USL" ) ), );
Current Data Table( limits );
rowsTest = limits[0, 1];
iMax = N Rows( limits );
Current Data Table( dt1 );
vl = V List Box( Text Box( "Spec Limits Script" ) );
For( i = 0, i < iMax, i++,
vv = V List Box(
Distribution(
Stack( 1 ),
Continuous Distribution( Column( :result ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Where( :test_name == rowsTest[i] )
)
),
vl << append( vv )
);
newFit = New Window( "Spec Limits Collection", vl );
但它沒有奏效。
這是這樣做的正確方法嗎?
提前致謝。
回覆:JSL-表上的通用分佈謝謝您的幫忙!
我還有3個問題.....
1. 如果我需要使用「Graph Builder」進行覆蓋(假設 machine1 中的 test1 與 machine2 中的 test1)。
我嘗試做同樣的事情但沒有成功:
For( i = 1, i <= N Rows( SummaryDT ), i++,
CurrentTest = Column( SummaryDT, 1 )[i];
CurrentMin = Column( SummaryDT, 2 )[i];
CurrentMax = Column( SummaryDT, 3 )[i];
NewMin = Column( SummaryDT, 4 )[i];
NewMax = Column( SummaryDT, 5 )[i];
CurrentStDev = Column( SummaryDT, 7 )[i];
CurBox = V List Box(
CurDist = StackedResults <<
Graph Builder(
Show Control Panel( 0 ),
Variables( X( :Result ), Page( :Test Name ), Overlay( :Facility ) ),
Elements( Histogram( X, Legend( 13 ) ) )
),
V List Box(
H List Box( Text Box( "Current Low: " ), Text Box( CurrentMin ), Text Box( " New Low: " ), Text Box( NewMin ) ),
(H List Box( Text Box( "Current High: " ), Text Box( CurrentMax ), Text Box( " New High: " ), Text Box( NewMax ) ))
)
);
(CurDist << report)[AxisBox( 1 )] << Min( Min( CurrentMin || NewMin ) - Abs( Min( CurrentMin || NewMin ) ) * 0.005 );
(CurDist << report)[AxisBox( 1 )] << Max( Max( CurrentMax || NewMax ) * 1.005 );
(CurDist << report)[AxisBox( 1 )] << Add Ref Line( CurrentMin, "Solid", blue, "Min", 1 );
(CurDist << report)[AxisBox( 1 )] << Add Ref Line( CurrentMax, "Solid", blue, "Max", 1 );
(CurDist << report)[AxisBox( 1 )] << Inc( CurrentStDev );
//(CurDist << report)[AxisBox( 2 )] << Show Major Grid( 1 );
//(CurDist << report)[AxisBox( 2 )] << Scale( "Log" );
(CurDist << report)[Outline Box( 1 )] << Set Title( "Test: " || CurrentTest );
MainContainer << append( CurBox );
);
2.我試著以對數刻度縮放Y軸,這樣我可以更容易地看到異常值,但這不能正常工作...
3. 為什麼我的「列錶框」被隱藏了,只有當我關閉繪圖時才能看到它。
謝謝!
回覆:JSL-表上的通用分佈這是您的程式碼,請享受:
dt = Current Data Table();
SummaryDT = dt << Summary( Group( :test_name, :range_min, :range_max ), Std Dev( :result ) );
win = New Window( "My Analysis", MainContainer = V List Box() );
For( i = 1, i <= N Rows( SummaryDT ), i++,
CurrentTest = Column( SummaryDT, 1 )[i];
CurrentMin = Column( SummaryDT, 2 )[i];
CurrentMax = Column( SummaryDT, 3 )[i];
CurrentStDev = Column( SummaryDT, 5 )[i];
CurBox = V List Box( CurDist = dt << Distribution( Continuous Distribution( Column( :result ),Horizontal Layout(1) ), Where( :test_name == CurrentTest ) ) );
(CurDist << report)[AxisBox(1)] << Max(Maximum(CurrentMax,(CurDist << report)[AxisBox(1)] << Get Max) + (CurrentMax-CurrentMin)*0.05);
(CurDist << report)[AxisBox(1)] << Min(Minimum(CurrentMin,(CurDist << report)[AxisBox(1)] << Get Min) - (CurrentMax-CurrentMin)*0.05);
(CurDist << report)[AxisBox(1)] << Add Ref Line( CurrentMin, "Solid", blue, "Min", 1 );
(CurDist << report)[AxisBox(1)] << Add Ref Line( CurrentMax, "Solid", blue, "Max", 1 );
(CurDist << report)[AxisBox(1)] << Inc(CurrentStDev);
(CurDist << report)[OutlineBox(1)] << Set Title("Test: " || CurrentTest);
MainContainer << append(CurBox);
);
close(SummaryDT,nosave);
(win << XPath("//TextBox[contains(./text(), 'Where')]")) << delete();
回覆:JSL-表上的通用分佈如果您有興趣,請給我發送一張桌子
湯姆.abramov@ald.co.il
我將把腳本放在這裡回覆:JSL-表上的通用分佈改變 bin 大小的比例,將 LSL、USL 等加到每個結果視窗怎麼樣?
兩個問題:
1. 如何從我剛剛繪製的直方圖中取得西格瑪值到繪圖的刻度箱?
2. 如何在沒有測試名稱計數器的情況下新增參考線?
預先非常感謝您!
“std”- 是統計表中的標準值
“???”- 是“limits”表中的值。
dt1 = Open();
:result << Set Data Type( Numeric, "Continuous" );
limits = dt1 << Summary( Group( :test_name ), Mean( Eval( "range_min" ) ), Mean( Eval( "range_max" ) ), );
Ntests = N Rows( limits );
vl = V List Box( Text Box( "Spec Limits Script" ) );
dt1 << Distribution(
Continuous Distribution( Column( :result ), Horizontal Layout( 1 ), Vertical( 0 ) ),
By( :test_name ),
SendToReport(
Dispatch(
{"result"},
"1",
ScaleBox,
{Min( 97.5173285198556 ), Max( 97.9576714801444 ), Inc( <U><STRONG>std</STRONG></U>), Minor Ticks( 0 ),
Add Ref Line( limits[<U><STRONG>???</STRONG></U>,3], "Solid", "Black", "", 1 ), Add Ref Line( limits[<U><STRONG>???</STRONG></U>,4], "Solid", "Black", "", 1 )}
)
)
);
回覆:JSL-表上的通用分佈同樣,您可以不循環地運行它:
Distribution(
Continuous Distribution(
Column( :result ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
By( :test_name )
);
回覆:JSL-表上的通用分佈你好,
這是經過一些更正後的程式碼:
dt1 = Open();
:result << Set Data Type( Numeric, "Continuous" );
:range_min << Set Name( "LSL" );
:range_max << Set Name( "USL" );
limits = dt1 << Summary( Group( :test_name ), Mean( Eval( "LSL" ) ), Mean( Eval( "USL" ) ), );
Ntests = NRows(limits);
vl = V List Box( Text Box( "Spec Limits Script" ) );
For( i = 1, i <= Ntests, i++,
vv = V List Box(
dt1 << Distribution(
Stack( 1 ),
Continuous Distribution( Column( :result ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Where( :test_name == Column(limits,"test_name")[i] )
)
);
vl << append( vv )
);
newFit = New Window( "Spec Limits Collection", vl );