Problema
Si esegue un'analisi in JMP e si desidera estrarre alcune statistiche dal report della piattaforma. Quindi si desidera inserire tali statistiche in una finestra di report personalizzata, in modo da poterle conservare dopo la chiusura della tabella dei dati e del report della piattaforma.
Soluzione
È possibile ottenere un riferimento al livello di report del report di analisi e utilizzare i messaggi JSL per estrarre le statistiche da
In questo esempio viene generato un report della piattaforma bivariata e si ottiene un riferimento al livello del report ( reportbiv ). Usando quel riferimento, puoi estrarre variabili e stringhe dal rapporto Bivariato. Quindi viene creata una nuova finestra del report personalizzato e popolata con le statistiche e le stringhe estratte dal report. Infine, la tabella dei dati viene chiusa, il che chiude il rapporto bivariato, ma la finestra del rapporto personalizzato rimane aperta.
Names Default To Here(1);
sd = Open( "$SAMPLE_DATA/Lipid Data.JMP" );
biv = sd << Bivariate( // biv is the analysis layer.
Y( :Triglycerides ),
X( :LDL ),
Density Ellipse( 0.95, {Line Color( {213, 72, 87} )} ),
Fit Line( {Line Color( {57, 177, 67} )} )
);
/* Get a reference to the report layer. */
reportbiv = biv << Report;
// Make sure the "Bivariate Normal Ellipse" outline
// in the Bivariate report is open. You can then see which
// content to extract into the Custom report.
reportbiv[Outline Box( "Bivariate Normal Ellipse P=0.950" )] << Close( 0 );
// Extract the correlation coefficient.
corrvalue = reportbiv[Outline Box( "Bivariate Normal Ellipse P=0.950" )][Number Col Box( "Correlation" )] << Get( 1 );
// Extract the numeric values from the Summary of Fit report as a matrix.
sumfit = reportbiv[Outline Box( "Summary of Fit" )][Number Col Box( 1 )] << Get as Matrix;
// Extract the Term column of the Parameter Estimates report as a list of strings.
term = reportbiv[Outline Box( "Parameter Estimates" )][String Col Box( "Term" )] << Get();
// Extract the Parameter Estimates values as a matrix.
parmests = reportbiv[Outline Box( "Parameter Estimates" )][Table Box( 1 )] << Get as Matrix;
dlg = New Window( "Custom Report",
Outline Box( "Selected Values",
/* The Lineup box defines a two-column layout, each of which contains a Text Box. */
Lineup Box( N Col( 2 ), Text Box( "Factor of Interest: " ), Text Box( term[2] ), ),
tb = Table Box(
/* Display an empty string in the first column and the text in the second column. */
String Col Box( " ", {"Sample Size: ", "Adjusted RSquare: ", "RSquare: ", "Correlation:"} ),
/* Insert a 30 pixel x 30 pixel spacer between the columns. */
Spacer Box( Size( 30, 30 ) ),
/* Display an empty string in the first column and the statistics in the second column. */
Number Col Box( " ", sumfit[{5,2,1}] |/ corrvalue )
),
/* Insert a 1 x 30 spacer. */
Spacer Box( Size( 0, 30 ) ),
Table Box(
/* Display the cloned String Col Box and insert the Parameter Estimates and Standard Error values. */
String Col Box( "Term", term ),
Number Col Box( "Estimate", parmests[0,1] ),
Number Col Box( "Standard Error", parmests[0,2] )
)
)
);
tb << Set Shade Headings( 0 ); // Turn off shaded table headings.
tb << Set Heading Column Borders( 0 ); // Turn off table column borders.
Close( sd ); // Close the data table.
Discussione
I report della piattaforma JMP contengono due livelli: il livello della piattaforma e il livello del report. Se si dispone di un oggetto JSL che fa riferimento al livello della piattaforma, è possibile inviare messaggi a quell'oggetto relativi all'analisi. Queste sono generalmente opzioni che si trovano nel menu del triangolo rosso. Se si dispone di un oggetto JSL che fa riferimento al livello del report, è possibile inviare messaggi a quell'oggetto relativi al report stesso. Questi messaggi possono estrarre valori o immagini, modificare selezioni, aprire e chiudere nodi di contorno, tra le altre azioni.
Guarda anche
Questo articolo è basato su un esempio nella documentazione di JMP .
Ho provato a seguire questo codice e usarlo in un rapporto diverso.
la mia intenzione è quella di eseguire diversi modelli e riassumere i risultati importanti in una tabella come mostrato qui.
Ecco un semplice esempio su un set di dati di esempio per mostrare a cosa sto puntando.
Per iniziare ho cercato di estrarre il valore P del modello. Così ho commentato il secondo modello e ho scritto il seguente codice:
Open("$SAMPLE_DATA/Detergent.jmp");
Model1 = Fit Model(
Y( :previous use ),
Effects( :softness ),
Personality( "Nominal Logistic" ),
Run(
Positive Level( "yes" ),
Likelihood Ratio Tests( 1 ),
Wald Tests( 1 ),
Odds Ratios( 1 ),
ROC Curve( 1 )
)
);
reportMod = Model1 << Report;
FMchi = reportMod[Outline Box( "Whole Model Test" )][Number Col Box( "Prob>ChiSq" )] << Get( 1 );
dlg = New Window( "Custom Report11",
Outline Box( "Selected Values",
Table Box(
String Col Box( "Pvalue", FMchi )
)
)
);
/*
Model2=Fit Model(
Y( :previous use ),
Effects( :count ),
Personality( "Nominal Logistic" ),
Run(
Positive Level( "yes" ),
Likelihood Ratio Tests( 1 ),
Wald Tests( 0 ),
Odds Ratios( 1 ),
ROC Curve( 1 ),
Logistic Plot( 1 )
)
);Il tavolo finale che voglio è:
Attributo | Test del modello intero | Rquadrato (U) | N | Stima | Prob>ChiSq | Rapporto di probabilità | AUC |
morbidezza | 1.000 | 0.000 | 24 | 0 | 1.000 | 1.000 | 0,500 |
contare | 0,5268 | 0,012 | 24 | 0,0183 | 0,5301 | 1.01847 | 0,5625 |
ecco uno screen shot del report ottenuto in cui ho evidenziato i dati estratti.
(Nell'attributo morbidezza, per la stima dei parametri e l'odds ratio ho preso solo la prima riga dal diario).




Viene visualizzata la finestra del rapporto originale ma non ho nemmeno aperto la finestra del rapporto aggiuntivo.
Eventuali suggerimenti sarebbero appriciated.
TIA, Eli