Sto lavorando a uno script che esegue un loop attraverso un elenco di risposte Y ed esegue un degrado (test di stabilità) su ciascuna prima di inviare parti del report a una tabella di dati combinati. Consiste nei seguenti passaggi:
- Apre una finestra di dialogo in cui l'utente seleziona "Y, risposta", "Ora" e "Etichetta, ID sistema".
- Per ogni "risposta Y", lo script esegue un ciclo e un test di stabilità di degradazione, quindi restituisce le informazioni sui "confronti dei modelli" in un report.
- Concatena i report in una tabella master.
Ho incluso il codice per prendere il nome della colonna y per ogni ciclo e aggiungerlo come una nuova colonna a ogni report e quindi concatenare ogni report a una nuova tabella master. I singoli report e 'combinedDataTable' hanno entrambi la nuova colonna ("Source Y Column"); tuttavia, non popola le celle con il rispettivo nome di colonna. Lo script funziona bene e senza errori. Ho incluso una serie di schermate qui sotto. Il codice problematico è verso la fine dello script.
// 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;
Note:
Ecco la finestra di output di una delle analisi di degradazione. Sto estraendo le informazioni nel contorno rosso.

Ecco la tabella di output principale che contiene entrambe le risposte Y, ma la 'Colonna sorgente Y' non è popolata.

Se si imposta lo stesso valore su ciascuna riga, è possibile utilizzare imposta ogni valore
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
mystr = "ABC";
dt << New Column("X", Character, Set Each Value(mystr));