열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션을 강조합니다.모집단 단위를 포함하는 분포 집합이 있습니다. 특정 DUT 참조 ID 번호와 일치하는 데이터 세트의 목록 항목을 선택하기 위해 containsitem 호출과 함께 select where를 사용했습니다. 이렇게 하면 관심 단위에 대한 측정값이 포함된 빈을 표시하는 데 도움이 됩니다. 선택의 각 인스턴스에 대한 테스트 날짜를 사용하여 측정값이 포함된 빈을 강조 표시하고 싶습니다. 예를 들어 동일한 단위가 2024년 6월 20일에 테스트되었고 나중에 2024년 6월 25일에 다시 테스트된 다음 2024년 6월 28일에 다시 테스트된 경우 6/20의 빈 결과는 한 가지 색상으로 강조 표시되고 6/25, 6/28의 빈 결과는 다른 두 가지 색상으로 강조 표시됩니다. 다른 목표는 이러한 색상이 보고서의 분포에서 일관되도록 하는 것입니다(테스트 날짜별로 한 가지 색상). 선택되지 않은 모든 단위는 기본 색상으로 유지됩니다. 또한 강조 표시가 해당 빈에 대한 플롯의 위에서 아래로 표시되기를 바랍니다.
귀하의 지원에 감사드립니다.
//dtmain << select where(:SN=="12346777" | :SN=="12346982");
dtmain << select where(ContainsItem(:SN, {"12346777", "12346982"}));
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Average ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
),
Continuous Distribution(
Column( :Min ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
),
Continuous Distribution(
Column( :Max ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
),
By(
:TID, :BLOCKNAME, :MEAS_TYPE
)
);

내가 이루고 싶은 것의 모형:

기본 데이터 분석 및 모델링신뢰성 분석Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조샘플 폴더에서 적합한 파일을 골라서 문제를 보여주는 모형을 만들어 주시겠습니까?
이점:
- 시간 절약 (#1) :
사용자는 모형 데이터 세트를 만들 필요가 없습니다. - 시간 절약 (#2):
문제를 이해하는 데 도움이 됩니다 - 모든 답변은 공통 모형을 기반으로 합니다.
-> 비교하기 쉽다

예를 들어 온도 데이터, 주 선택 및 분기별 색상(원래 데이터, DUT 선택 및 측정 날짜별 색상 대신)이 당신이 관심 있는 것입니까?
dt = Open( "$SAMPLE_DATA/Functional Data/Weekly Weather Data.jmp" );
dt << New Column( "selected Quarter",
"Ordinal",
Formula( If( Selected(), Quarter( :DATE ) ) ),
Set Property(
"Value Colors",
{1 = -13912408, 2 = -4042310, 3 = -4354269, 4 = -13400361}
)
);
dt << Graph Builder(
Transform Column( "temperature", Formula( Round( :TAVG / 2 ) * 2 ) ),
Size( 568, 328 ),
Show Control Panel( 0 ),
Variables( X( :STATION ), X( :temperature ), Overlay( :selected Quarter ) ),
Elements( Position( 1, 1 ), Bar( X, Overlay( 0 ), Legend( 9 ), Bar Style( "Stacked" ) ) ),
Elements( Position( 2, 1 ), Bar( X, Legend( 1 ), Bar Style( "Stacked" ) ) ),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model( 1, Properties( 0, {Fill Color( 32 )}, Item ID( "Missing", 1 ) ) )}
),
Dispatch( {}, "Graph Builder", FrameBox( 2 ), {Fill Selection Mode( "Unselected Faded" )} )
)
);
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조참조선을 사용해서 이 작업을 수행할 수 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dist = dt << Distribution(
Stack(1),
Continuous Distribution(
Column(:height),
Horizontal Layout(1),
Vertical(0),
Set Bin Width(2),
Process Capability(0)
)
);
ab = Report(dist)[AxisBox(1)];
ab << Add Ref Line({60, 62}, "Solid", "Red", "", 1, 0.25);
ab << Add Ref Line({62, 64}, "Solid", "Green", "", 1, 0.25);
ab << Add Ref Line({64, 66}, "Solid", "Blue", "", 1, 0.25);

또는 그래픽 스크립트를 사용
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dist = dt << Distribution(
Stack(1),
Continuous Distribution(
Column(:height),
Horizontal Layout(1),
Vertical(0),
Set Bin Width(2),
Process Capability(0)
)
);
fb = Report(dist)[FrameBox(2)];
fb << Add Graphics Script(
1,
Transparency(0.2);
Fill Color("Red");
Rect(68, Y Range() + 10, 70, Y Origin(), 1);
Transparency(0.2);
Fill Color("Light Green");
Rect(70, Y Range() + 10, 72, Y Origin(), 1);
);

모든 분포에서 동일한 색상을 얻으려면 날짜에 대한 값 색상 속성을 설정하여 색상을 설정할 때 활용하거나 색상 목록을 만들어 순서대로 사용하면 됩니다.
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조제가 생각하는 방법은 다음과 같습니다. 선택한 행과 관련된 빈을 찾은 다음 필요에 따라 참조 라인을 추가합니다.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// For illustration, randomly select some rows
For( i = 1, i <= 3, i++,
dt << select rows( Random Integer( 1, N Rows( dt ) ) )
);
dist = dt << Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :height ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
)
);
distRPT = Report( dist )[AxisBox( 1 )];
// Find the Midpoints of the bins the selected rows are in
dist << Save( "Level Midpoints" );
theBins = (Associative Array( Column( dt, N Cols( dt ) )[dt << get selected rows] )) << get keys;
dt << delete columns( N Cols( dt ) );
// Get the Increment of the X axis
theIncr = distRPT[AxisBox( 1 )] << get inc;
// Add the reference lines for each selected bin
For Each( {bin, index}, theBins,
binList = {};
Insert Into( binList, bin - theIncr / 2 );
Insert Into( binList, bin + theIncr / 2 );
Eval( Eval Expr( distRPT << Add Ref Line( Expr( binList ), "Solid", Expr( Index + 2 ), "", 1, 0.25 ) ) );
);
사용자가 다른 행을 선택하거나 선택 취소할 때 그래프가 대화형으로 변경되도록 확장하려면 RowState Handler와 기존 참조 줄을 먼저 제거한 다음 새 참조 줄을 추가하는 논리가 필요합니다.
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조답해야 할 질문:
색상을 어떻게 지정해야 하고, 범위는 어떻게 표시해야 합니까?
예를 들어 선택된 ID에 대한 6/20 데이터가 48, 90(77, 56, ...)인 경우입니다.
또는 그 반대입니다. 특정 날짜에 선택된 모든 장치 ID에 대한 데이터가 동일한 빈에 있는지 확신할 수 있습니까?
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조알겠습니다. 감사합니다. 제안하신 대로 사용 가능한 데이터를 사용하도록 질문을 조정하겠습니다.
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조지원해주셔서 감사합니다.
당신과 @jthi가 제안한 대로 add Ref를 사용할 수 있었습니다. 컬러링을 위해 접근 방식을 사용했고 단일 분포에 효과가 있음을 확인했습니다. By 조건을 추가하면 플롯 주소 지정 기능을 잃어 오류가 발생합니다.
@hogi 의 제안에 따라 이 질문에 사용 가능한 데이터로 전환했습니다. 질문을 용이하게 하기 위해 Jim의 스크립트를 수정한 버전에서 Big Class를 증강했습니다. 내가 따른 단계와 결과는 다음과 같습니다.
1. 큰 클래스 가져오기
2. "State" 열이 테이블에 없는 경우 조건부로 일부 데이터 추가
a. 사람들을 "CA", "WA" 또는 "OR"에 배치하기 위해 순차적 데이터가 있는 State라는 이름의 열을 추가합니다.
b. 16세, "F", 57세, 134세이며 "WA"에 있는 두 번째 "PATTY"를 추가합니다.
3. 이름을 몇 개 선택하세요. 저는 LESLIE와 PATTY를 선택했습니다.
4. 스크립트를 실행하여 관심 있는 빈을 찾아 강조 표시합니다.
좋아요 Case - remove By (:State) from the script below and change the preceding comma to a semicolon to run successfully. The code finds both instances of Patty and uses different colors for each of them. If they had the same height, for this example the reference lines would overlap only showing one of the two colors.
@hogi는 어떤 색상을 표시할지에 대한 중재에 대해 좋은 지적을 했습니다. 요소 주소 지정을 이해하면 동일한 빈에 두 개 이상의 흥미로운 데이터 포인트가 발생하는 경우에 대한 조건을 추가할 계획입니다.

NG 사례 - :State를 기반으로 By 조건으로 배포를 실행하고 플롯 객체를 주소 지정하는 데 오류가 발생합니다. 몇 가지 주소 지정 순열을 시도했지만 성공하지 못했습니다. AxisBox에 액세스하는 데 필요한 주요 정보가 없습니다.
둘 다 작동하지 않았습니다:
distRPT = Report( dist )["높이", AxisBox( 1 )];
distRPT = Report( dist )["State=WA","height",AxisBox( 1 )];
distRPT = Report(dist["State=WA"])["height",AxisBox(1)];
샘플 오류 코드: 'Report(dist)[ /*###*/AxisBox(1)]' , Report(dist )[/*###*/AxisBox( 1 )]의 액세스 또는 평가에서 행 41에서 개체를 구독할 수 없습니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col_name_list = dt << get column names(string);
newColName = "State";
// New column: State
if (!contains(col_name_list, newColName),
Local( {dt, tempStrings},
dt = Data Table( "Big Class" );
dt << New Column( "State", Character, "Nominal" ) << Begin Data Update;
tempStrings = {"CA", "WA", "OR"};
For Each Row( dt, :State = tempStrings[Sequence( 1, 3, 1, 1 )] );
dt << End Data Update;
);
//Make it a double Patty :), another person with the same name.
dt << Add Rows( 1, At End );
//Cheat and use a constant of 41 for the last row index
dt[[41],{name,age,sex,height,weight,State}] = {{"PATTY", 16, "F", 57, 134, "WA"}};
);
// For illustration, select some names
dt << select where( ContainsItem(:name, {"LESLIE","PATTY"}));
dist = dt << Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :height ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
),
By (:State)
);
distRPT = Report( dist )[AxisBox( 1 )];
// Find the Midpoints of the bins the selected rows are in
dist << Save( "Level Midpoints" );
theBins = (Associative Array( Column( dt, N Cols( dt ) )[dt << get selected rows] )) << get keys;
dt << delete columns( N Cols( dt ) );
// Get the Increment of the X axis
theIncr = distRPT[AxisBox( 1 )] << get inc;
// Add the reference lines for each selected bin
For Each( {bin, index}, theBins,
binList = {};
Insert Into( binList, bin - theIncr / 2 );
Insert Into( binList, bin + theIncr / 2 );
Eval( Eval Expr( distRPT << Add Ref Line( Expr( binList ), "Solid", Expr( Index + 2 ), "", 1, 0.25 ) ) );
);
귀하의 의견과 지도를 환영합니다.
감사해요!
브라이언
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조멋진 : )
"올바른 축 상자 찾기"와 관련하여 위시리스트에 있는 이 소원:
JSL을 통해 보고서에서 결과를 더 쉽게 얻을 수 있도록 하세요
"대기 중" 상태입니다. "보고서에서 결과를 얻는 것이 더 쉬워질 것" 외에도 올바른 축 상자를 찾는 방법도 쉬워지기를 바랍니다.
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조내 첫 번째 추측은 By를 사용할 때 목록에서 Report() 함수를 사용하려고 한다는 것입니다(Show(dist);를 사용하여 dist에 무엇이 포함되어 있는지 확인하십시오).
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조BY 그룹이 필요한 경우에는 상황이 조금 더 복잡해집니다.
모든 서브플롯은 서로 다른 빈 너비를 가질 수 있습니다. 이것이 for 루프가 필요한 이유입니다.
- 개별 빈 너비를 구합니다.
- 특정 서브플롯에 대해 선택된 행을 가져오려면
- 특정 서브플롯에 참조 라인을 추가합니다.
음, 음영 처리된 영역에 대한 아이디어를 다시 생각해 보는 게 어떨까요? 색상에도 문제가 있거든요.
지금은 선택된 모든 빈에 다른 색상을 적용합니다. 음영 처리된 영역은 보기 좋지만 너비는 매우 임의적입니다. 선택된 ID당 한 줄만 추가하면 될까요? 몇 개의 "ID"를 선택하시겠습니까?
테이프 냄새가 난다면, 이제 질문해야 할 때입니다: 우리는 바퀴를 새로 만들고 있는 걸까요?
일반적으로 Graph Builder는 보고서 계층과 통신할 필요 없이 이러한 작업을 자동으로 수행할 수 있습니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col_name_list = dt << get column names( string );
newColName = "State";
// New column: State
If( !Contains( col_name_list, newColName ),
Local( {dt, tempStrings},
dt = Data Table( "Big Class" );
dt << New Column( "State", Character, "Nominal" ) << Begin Data Update;
tempStrings = {"CA", "WA", "OR"};
For Each Row( dt, :State = tempStrings[Sequence( 1, 3, 1, 1 )] );
dt << End Data Update;
);
//Make it a double Patty :), another person with the same name.
dt << Add Rows( 1, At End );
//Cheat and use a constant of 41 for the last row index
dt[[41], {name, age, sex, height, weight, State}] = {{"PATTY", 16, "F", 57, 134, "WA"}};
);
// For illustration, select some names
dt << select where( Contains Item( :name, {"LESLIE", "PATTY"} ) );
dist = dt << Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :height ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Normal Quantile Plot( 0 ), // disable, if the user enabled it in the preferences :)
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
),
By( :State )
);
// get all reports
// if there is a BY group, get the info - if there is none, put it into a list
If( Is List( dist ),
dists=dist;
myBys = Transform each ({myexpr} , dist << Get Where Expr, Arg(myExpr , 2 ))
, //no By
dists = Eval List( {dist} );
myBys= {};
);
//get the reports
distRPTs = Transform Each( {dist}, dists, Report( dist ) );
// Find the Midpoints of the bins the selected rows are in
dist << Save( "Level Midpoints" );
//loop though the By groups and add the reflines
For Each( {report, idx}, distRPTs,
//report = distRPTs[2]; idx=2;
selected rows = dt << get selected rows;
// there is a BY group -> restrict the selection
if(N Items(myBys),
Eval( Eval Expr( selected rows = dt << get rows where( Contains( Expr( selected rows ), Row() ) & :State == Expr( myBys[idx] ) ) ) );
);
theBins = (Associative Array( Column( dt, N Cols( dt ) )[selected rows] )) << get keys;
// Get the Increment of the X axis
theIncr = report[AxisBox( 1 )] << get inc;
// Add the reference lines for each selected bin
For Each( {bin, index}, theBins,
//bin = 57; index=1
binList = {};
Insert Into( binList, bin - theIncr / 2 );
Insert Into( binList, bin + theIncr / 2 );
Eval( Eval Expr(report[AxisBox( 1 )] << Add Ref Line( Expr( binList ), "Solid", Expr( Index + 2 ), "", 1, 0.25 ) ) );
);
);
dt << delete columns( N Cols( dt ) );Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조Graph Builder를 통해:
New Column( "selected",
Character,
Formula( If( Col Maximum( Selected( Row State() ), :name ), :name, "-" ) )
)
New Window( "try",
H List Box(
Graph Builder( Size( 519, 452 ), Show Control Panel( 0 ), Show Legend( 0 ), Variables( X( :name ) ), Elements( Bar( X ) ) );
gb = Graph Builder(
Size( 487, 500 ),
Show Control Panel( 0 ),
Variables( X( :height ), Wrap( :State ), Color( :selected ) ),
Elements(
Heatmap( X, Legend( 8 ) ),
Histogram( X, Legend( 6 ), Response Scale( "Fill" ) ),
Points( X, Legend( 9 ), Jitter( "None" ) )
),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model( 8, Properties( 0, {Transparency( 0 )}, Item ID( "-", 1 ) ) ), Legend Model(
9,
Properties( 0, {Transparency( 0 )}, Item ID( "-", 1 ) )
)}
)
)
);
)
);
(gb << xpath( "//FrameBox" )) << {Marker Drawing Mode( "Outlined" ), Marker Size( 10 ), Transparency( 0.5 ),
Fill Selection Mode( "Unselected Faded" )};
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조답변 감사합니다. 저는 코드를 조정하여 개별 플롯을 처리할 수 있었습니다. 제 분석에서는 각 조건 세트에 대해 세 개의 서브플롯이 있습니다. 저는 서브플롯 인덱스를 하드코딩하는 데 의지했습니다.
If( Is List( rptDist ),
dists=rptDist;
myBys1 = Transform each ({myexpr} , rptDist << Get Where Expr, Arg(myExpr , 1 ));
myBys2 = Transform each ({myexpr} , rptDist << Get Where Expr, Arg(myExpr , 2 ));
myBys3 = Transform each ({myexpr} , rptDist << Get Where Expr, Arg(myExpr , 3 ));
, //else condition - no By conditions in Distribution call
dists = Eval List( {rptDist} );
myBys= {};
);새로운 도전으로 넘어갑니다. Associative Array 호출을 사용하면 정보가 손실됩니다. 여기서 플로팅 목표가 달성되었으므로 다음 도전에 대한 별도 게시물을 만듭니다.
모두들 고맙습니다!
Re: 열 값을 기준으로 분포의 빈을 강조 표시하여 빈 마이그레이션 강조안녕하세요 Jarmo님,
I've added the nested for loops which achieved the desired result. Without the second loop the added reference would only appear in the first of the three plots. Please note that I assigned numOfPlots a constant value of 3. I was looking for a way to interrogate the report(AxisBox... for dimensions, but I did not find the right object to return the correct count.
전체적으로 분포를 생성하고 참조선으로 주석을 달기 위해 세 개의 중첩된 for 루프가 있습니다.
...
For Each( {report, idx}, distRPTs, //grab each report in the
...
For Each( {bin, index}, theBins, //process bin for each report
...
For( iPlot = 1, iPlot <= numOfPlots, iPlot +=1, << add refer. in each of the subplots.
...
...<BR />For Each( {bin, index}, theBins,
binList = {};
//TBD change bin width to avoid offset when bin width is an odd number
Insert Into( binList, bin - theIncr / 2 );
Insert Into( binList, bin + theIncr / 2 );
For( iPlot = 1, iPlot <= numOfPlots, iPlot +=1,
Eval( Eval Expr(report[AxisBox( iPlot )] << Add Ref Line( Expr( binList ), "Solid", Expr( Index + 2 ), "", 1, 0.25 ) ) );
);
);