저는 Y 응답 목록을 반복하고 보고서의 일부를 결합된 데이터 표로 출력하기 전에 각각에 대한 저하(안정성 테스트)를 실행하는 스크립트를 작업하고 있습니다. 다음 단계로 구성됩니다.
- 사용자가 "Y, 응답", "시간", "레이블, 시스템 ID"를 여러 개 선택하는 대화 상자를 엽니다.
- 각 "Y, 응답"에 대해 스크립트는 루프를 돌며 저하 안정성 테스트를 실행하고 "모델 비교" 정보를 보고서에 출력합니다.
- 보고서를 마스터 테이블로 연결합니다.
각 루프의 y-열 이름을 가져와 각 보고서에 새 열로 추가한 다음 각 보고서를 새 마스터 테이블에 연결하는 코드를 포함했습니다. 개별 보고서와 'combinedDataTable'은 모두 새 열("Source Y Column")을 가지고 있지만, 해당 열 이름으로 셀을 채우지 않습니다. 스크립트는 오류 없이 정상적으로 실행됩니다. 아래에 여러 스크린샷을 포함했습니다. 문제가 있는 코드는 스크립트 끝 부분에 있습니다.
// Initialize an empty data table to store combined results
combinedDataTable = New Table( "Combined Degradation Data" );
// Loop through each selected Y column and perform degradation analysis
For( i = 1, i <= N Items( YCols ), i++,
currentYCol = Column( dt, YCols[i] );
// Calculate the min and max values of the current Y column
minValue = Col Minimum( currentYCol );
maxValue = Col Maximum( currentYCol );
// Adjust the min and max values by 2%
adjustedMin = minValue * 0.98;
adjustedMax = maxValue * 1.02;
// Determine the increment value based on the highest value
If( maxValue < 5,
incValue = 0.25,
If( maxValue > 5 & maxValue < 15,
incValue = 0.25,
If( maxValue > 90,
incValue = 0.5,
incValue = (adjustedMax - adjustedMin) / 10
)
)
);
//Determine the X Scale Box Based on Number of Timepoints
maxTimepoint = Col Maximum( Column( dt, XCols[1] ) );
adjustedMaxTimepoint = maxTimepoint + 1;
// Perform Degradation Analysis
degReport = dt << Degradation(
Y( currentYCol ),
Time( Column( dt, XCols[1] ) ), // Assuming only one X column is selected
Label( Column( dt, BCols[1] ) ), // Assuming only one By column is selected
Application( "Stability Test" ),
Connect Data Markers( 0 ),
Show Fitted Lines( 1 ),
Show Spec Limits( 1 ),
Show Median Curves( 0 ),
Show Legend( 1 ),
No Tab List( 0 ),
Use Pooled MSE for Nonpoolable Model( 0 ),
Set Censoring Time( . ),
Show Residual Plot( 1 ),
Show Inverse Prediction Plot( 1 ),
Show Curve Interval( 1 ),
Inverse Prediction Interval( "Confidence Interval" ),
Inverse Prediction Alpha( 0.05 ),
Inverse Prediction Side( "Lower One Sided" ),
SendToReport(
Dispatch( {"Overlay"}, "1", ScaleBox, {Min( -1 ), Max( adjustedMaxTimepoint ), Inc( 6 ), Minor Ticks( 1 )} ),
Dispatch(
{"Overlay"},
"2",
ScaleBox,
{Format( "Fixed Dec", 12, 1 ), Min( adjustedMin ), Max( adjustedMax ), Inc( incValue ), Minor Ticks( 0 )}
)
)
);
// Extract the data from the specified location
extractedData = Report( degReport )["Degradation Data Analysis"]["Overlay"]["Stability Tests"][Table Box( 2 )] << Make Combined Data Table;
// Add a column to indicate the source Y column
currentYColName = Column( dt, YCols[i] ) << Get Name;
extractedData << New Column( "Source Y Column", Character, "Nominal", Set Values( Repeat( currentYColName, N Rows( extractedData ) ) ) );
// Combine the extracted data into the combined data table
combinedDataTable << Concatenate( extractedData, Append to first table( 1 ) );
// Close the individual report window
Close( Window( degReport ) );
);
// Show the combined data table
combinedDataTable << Show Window;
참고사항:
여기 저하 분석 중 하나의 출력 창이 있습니다. 빨간색 윤곽선에 있는 정보를 추출합니다.

다음은 Y 응답이 모두 있지만 '소스 Y 열'이 채워지지 않은 마스터 출력 테이블입니다.

각 행에 동일한 값을 설정하는 경우 각 값을 설정할 수 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
mystr = "ABC";
dt << New Column("X", Character, Set Each Value(mystr));