Segnalazione dei dati da LSMeans Differences Student's tCiao a tutti,
Sto cercando di creare un report con dati specifici dalla tabella delle differenze LSMeans Student's t:

Vorrei una tabella con uno dei formati seguenti:


Purtroppo non riesco a stampare correttamente la media e non può prendere i dati dalla tabella più grande. Ottengo quanto segue

Ho provato il seguente codice, in cui ho modificato '17' con numeri da 1 a 30 e non funziona nulla: 17 è per una casella di contorno diversa:
sd = Open( "test_table.jmp" );<BR /><BR />Fitmod = Fit Model(<BR />Y( :"Test value"n ),<BR />Effects( :Person ),<BR />Random Effects( :Day[:Person] ),<BR />NoBounds( 0 ),<BR />Personality( "Standard Least Squares" ),<BR />Method( "REML" ),<BR />Emphasis( "Effect Leverage" ),<BR />Run(<BR />:"Test value"n << {Summary of Fit( 1 ),<BR />Analysis of Variance( 0 ), Parameter Estimates( 1 ), Scaled Estimates( 0 ),<BR />Plot Actual by Predicted( 1 ), Plot Regression( 0 ),<BR />Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),<BR />Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),<BR />{:Person << {LSMeans Student's t( 0.05 )}}}<BR />),<BR />Where( :ID == "A1" ),<BR />SendToReport(<BR />Dispatch(<BR />{"Test value ID=A1"},<BR />"Whole Model",<BR />OutlineBox,<BR />{Close( 1 )}<BR />),<BR />Dispatch(<BR />{"Test value ID=A1", "Person"},<BR />"Leverage Plot",<BR />OutlineBox,<BR />{Close( 1 )}<BR />)<BR />)<BR />);<BR /><BR />report(Fitmod) [Outline Box( 2 )] << Close( 0 );<BR />reportFitmod = Fitmod << Report;<BR /><BR /><STRONG>sumfit = reportFitmod[Outline Box( 17 )][Number Col Box( 1 )] << Get as Matrix;
meandiff = sumfit[1];
lowerCL = sumfit[3];
upperCL = sumfit[4];</STRONG><BR /><BR />term = reportFitmod[Outline Box( 13 )][String Col Box( 1 )] << Get();<BR /><BR />est = reportFitmod[Outline Box( 13 )][Number Col Box( 1 )] << Get as Matrix;<BR /><BR />dvalues = [];<BR />dvalues = meandiff |/ lowerCL |/ upperCL ;<BR />sfactor = term[2];<BR /><BR />dlg = New Window( "Custom Report",<BR />Outline Box( "Selected Values",<BR />Lineup Box( N Col( 2 ),<BR />Text Box( "Factor of Interest: " ),<BR />Text Box( sfactor ), ),<BR />tb = Table Box(<BR /><BR />String Col Box( " ",<BR />{"Mean difference: ", "Upper limit: ", "Lower limit: "}<BR />),<BR />Spacer Box( Size( 30, 30 ) ),<BR />,<BR />Spacer Box( Size( 0, 30 ) ),<BR />,<BR />Table Box(<BR />CloneTerm,<BR />Spacer Box( Size( 10, 0 ) ),<BR />,<BR />Number Col Box( "Estimate", est ),<BR />Spacer Box( Size( 10, 0 ) ),<BR />,<BR />Number Col Box( "Mean difference", meandiff)<BR />)<BR />)<BR />);<BR /><BR />tb << Set Shade Headings( 0 ); // Turn off shaded table headings.<BR />tb << Set Heading Column Borders( 0 ); // Turn off table column borders.<BR />
Come si riportano i dati della tabella più grande?
Distinti saluti
Automazione e scriptingOggetto: Segnalazione dei dati da LSMeans Differences Student's tBenvenuti nella comunità JMP.
Penso che ci sia un equivoco tra la tabella dati allegata e lo script allegato. I riferimenti nello script alle colonne da analizzare non corrispondono alle colonne nella tabella dati allegata.
Se riesci a fornire gli allegati corretti, sono certo che la Community sarà in grado di aiutarti nei tuoi sforzi.
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCaro Jim,
Mi scuso per l'equivoco. Grazie per avermelo fatto sapere. Ora ho allegato lo script corretto.
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tQuesto potrebbe darti un vantaggio nell'ottenere il tuo prodotto finale. Produce

Names Default To Here( 1 );
sd = //Open( "test_table.jmp" );
Data Table( "test_table" );
Fitmod = Fit Model(
Y( :"Test value"n ),
Effects( :Person ),
Random Effects( :Day[:Person] ),
NoBounds( 0 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
:"Test value"n << {Summary of Fit( 1 ), Analysis of Variance( 0 ), Parameter Estimates( 1 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Regression( 0 ), Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ), {:Person << {LSMeans Student's t( 0.05 )}}}
),
Where( :ID == "A1" ),
SendToReport(
Dispatch( {"Test value ID=A1"}, "Whole Model", OutlineBox, {Close( 1 )} ),
Dispatch( {"Test value ID=A1", "Person"}, "Leverage Plot", OutlineBox, {Close( 1 )} )
)
);
Report( Fitmod )[Outline Box( 2 )] << Close( 0 );
reportFitmod = Fitmod << Report;
sumfit = reportFitmod[Outline Box( "Least Squares Means Table" )][Number Col Box( 1 )] << Get as Matrix;
// Get data from CrossTab table
crossTab = reportFitmod[Outline Box( "LSMeans Differences Student's t" )][CrosstabBox( 1 )] << get as matrix;
// Get Where clause variable
whereCol = Word( 2, ((reportFitmod << parent)[Text Box( 1 )]) << get text, ":=)" );
whereVal = {};
Eval( Parse( "insert into(whereVal," || Word( 2, ((reportFitmod << parent)[Text Box( 1 )]) << get text, "=)" ) || ");" ) );
meandiff = Round( Abs( crossTab[1, 2] ), 4 );
lowerCL = Round( Abs( crossTab[3, 2] ), 3 );
upperCL = Round( Abs( crossTab[4, 2] ), 3 );
term = reportFitmod[Outline Box( "Least Squares Means Table" )][String Col Box( 1 )] << Get();
est = reportFitmod[Outline Box( "Least Squares Means Table" )][Number Col Box( 1 )] << Get as Matrix;
testValue = {};
Insert Into( testValue, (Substr( reportFitmod[Outline Box( 1 )] << get title, 10 )) );
dif = {};
Insert Into( dif, Char( meandiff ) || " [" || Char( lowerCL ) || ";" || Char( upperCL ) || "]" );
dlg = New Window( "Custom Report",
Outline Box( "Selected Values",
Lineup Box( N Col( 2 ), Text Box( "Factor of Interest: " ), Text Box( sfactor ) ),
Spacer Box( size( 0, 10 ) ),
tb = Table Box(
String Col Box( "Test Value", testvalue ),
String Col Box( whereCol, whereVal ),
Number Col Box( "Mean, " || term[1], sumfit[1] ),
Number Col Box( "Mean, " || term[2], sumfit[2] ),
String Col Box( "Difference in mean and CI", dif )
)
)
);
tb << Set Shade Headings( 0 ); // Turn off shaded table headings.
tb << Set Column Borders( 1 ); // Turn off table column borders.
tb << Set row Borders( 1 );
tb << border( 1 );
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCiao Jim,
Come dovrebbe essere modificato lo script se ci sono più ID per generare una tabella con tutti i diversi elementi? È possibile implementare un ciclo per questo?
Distinti saluti,
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tHo modificato il JSL per poter gestire più livelli di ID.

Names Default To Here( 1 );
sd = //Open( "test_table.jmp" );
Data Table( "test_table " );
Fitmod = Fit Model(
Y( :"Test value"n ),
Effects( :Person ),
Random Effects( :Day[:Person] ),
NoBounds( 0 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
:"Test value"n << {Summary of Fit( 1 ), Analysis of Variance( 0 ), Parameter Estimates( 1 ),
Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), {:Person << {LSMeans Student's t( 0.05 )}}}
),
by( :ID ),
SendToReport(
Dispatch( {"Test value ID=A1"}, "Whole Model", OutlineBox, {Close( 1 )} ),
Dispatch( {"Test value ID=A1", "Person"}, "Leverage Plot", OutlineBox, {Close( 1 )} )
)
);
// Set the lists for the storage of the data from the by groups
whereVal = testValue = dif = sumfit1 = sumfit2 = {};
// Loop across each by group and gather the data
For Each( {rpt, group}, Fitmod,
// Point to the current report
reportFitmod = Fitmod[group] << Report;
// Get the means for the 2 levels
sumfit = reportFitmod[Outline Box( "Least Squares Means Table" )][Number Col Box( 1 )] << Get as Matrix;
Insert Into( sumfit1, sumfit[1] );
Insert Into( sumfit2, sumfit[2] );
term = reportFitmod[Outline Box( "Least Squares Means Table" )][String Col Box( 1 )] << Get();
// Get By Group column
whereCol = Word( 1, (reportFitmod[Outline Box( 1 )] << get title), "=)" );
Insert Into( whereVal, Word( 2, (reportFitmod[Outline Box( 1 )] << get title), "=)" ) );
// Get data from CrossTab table
crossTab = reportFitmod[Outline Box( "LSMeans Differences Student's t" )][CrosstabBox( 1 )] <<
get as matrix;
meandiff = Round( Abs( crossTab[1, 2] ), 4 );
lowerCL = Round( Abs( crossTab[3, 2] ), 3 );
upperCL = Round( Abs( crossTab[4, 2] ), 3 );
// Get the Response variable name
Insert Into( testValue, (Substr( (reportFitmod << topparent)[Outline Box( 1 )] << get title, 10 )) );
// Create the Differeence in mean and CL string
Insert Into( dif, Char( meandiff ) || " [" || Char( lowerCL ) || ";" || Char( upperCL ) || "]" );
);
// Create the table
dlg = New Window( "Custom Report",
Outline Box( "Selected Values",
Lineup Box( N Col( 2 ), Text Box( "Factor of Interest: " ), Text Box( term[1] ) ),
Spacer Box( size( 0, 10 ) ),
tb = Table Box(
String Col Box( "Test Value", testvalue ),
String Col Box( whereCol, whereVal ),
Number Col Box( "Mean, " || term[1], sumfit1 ),
Number Col Box( "Mean, " || term[2], sumfit2 ),
String Col Box( "Difference in mean and CI", dif )
)
)
);
tb << Set Shade Headings( 0 ); // Turn off shaded table headings.
tb << Set Column Borders( 1 ); // Turn off table column borders.
tb << Set row Borders( 1 );
tb << border( 1 );
Il tuo compito ora è studiare lo script e imparare cosa fa. Lo script funziona per la tabella dati di esempio e il Fit Model che hai specificato. Tuttavia, tabelle dati diverse con colonne diverse e diverse esecuzioni del Fit Model potrebbero non funzionare con il JSL che genera l'output del report. Dovrai acquisire conoscenze sufficienti per modificare lo script in base alle tue esigenze.
Un valido riferimento a questo proposito è la Scripting Guide e lo Scripting Index, disponibili nel menu a discesa Help in JMP.
Naturalmente, la community di discussione JMP sarà a tua disposizione per aiutarti a imparare lo script.
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tGrazie per il tuo straordinario lavoro!
Ho provato a eseguire lo script, ma ottengo un errore. Ho provato a sfogliare vecchi casi e a cercare su Google sia la funzione For Each che l'errore, oltre a provare a modificare lo script, ma senza successo. Ho la versione 16, questo potrebbe rappresentare un problema per lo script?
Credo che l'errore derivi da {rpt, group}, poiché ho provato a rimuovere tutto in For Each e continuo a ricevere questo errore.

La maggior parte di ciò che posso capire, ma da dove prendiamo questo rpt e come viene utilizzato? È menzionato solo in For Each( {rpt, group} ...) quindi non posso razionalizzare come si adatta.
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tQuale versione di JMP stai utilizzando? For Each() è stato aggiunto a JMP nella versione 16. La funzionalità By() in Fit Mod non è stata aggiunta fino a JMP 18.
Per gestire entrambe queste modifiche sarà necessario modificare lo script.
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tIo uso la versione 16.1.0 di JMP, quindi dev'essere questo il motivo.
La funzione FitMod deve essere sostituita da un'altra funzione oppure FitMod può comunque essere utilizzata in modo diverso?
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tEcco una versione modificata dello script. L'ho testato in JMP 16. Ho rimosso la clausola By e sostituito la funzionalità con un ciclo For Each() che esegue il Fit Model per ogni livello di ID separatamente. Lo script raccoglie quindi l'output da ciascuno degli output separati del Fit Model e genera la visualizzazione dell'output finale

Names Default To Here( 1 );
sd = //Open( "test_table.jmp" );
Data Table( "test_table" );
Fitmod = {};
// Determine the levels in the ID column
summarize( sd, ByGroups = By( :ID ) );
// Loop across each levle of ID
For Each( {BG, group}, ByGroups,
Fm = Fit Model(
Y( :"Test value"n ),
Effects( :Person ),
Random Effects( :Day[:Person] ),
NoBounds( 0 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
:"Test value"n << {Summary of Fit( 1 ), Analysis of Variance( 0 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 1 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), {:Person << {LSMeans Student's t( 0.05 )}}}
),
Where( :ID == ByGroups[group] ),
SendToReport(
Dispatch( {"Test value ID=A1"}, "Whole Model", OutlineBox, {Close( 1 )} ),
Dispatch(
{"Test value ID=A1", "Person"},
"Leverage Plot",
OutlineBox,
{Close( 1 )}
)
)
);
// Save the pointer to the results in the Fitmod list
Insert Into( Fitmod, Fm );
);
// Set the lists for the storage of the data from the by groups
testValue = dif = sumfit1 = sumfit2 = {};
// Loop across each by group and gather the data
For Each( {rpt, group}, Fitmod,
// Point to the current report
reportFitmod = Fitmod[group] << Report;
// Get the means for the 2 levels
sumfit = reportFitmod[Outline Box( "Least Squares Means Table" )][Number Col Box( 1 )] << Get as Matrix;
Insert Into( sumfit1, sumfit[1] );
Insert Into( sumfit2, sumfit[2] );
term = reportFitmod[Outline Box( "Least Squares Means Table" )][String Col Box( 1 )] << Get();
// Get By Group column
whereCol = Word( 2, ((reportFitmod << parent)[Text Box( 1 )]) << get text, ":=)" );
// Get data from CrossTab table
crossTab = reportFitmod[Outline Box( "LSMeans Differences Student's t" )][CrosstabBox( 1 )] <<
get as matrix;
meandiff = Round( Abs( crossTab[1, 2] ), 4 );
lowerCL = Round( Abs( crossTab[3, 2] ), 3 );
upperCL = Round( Abs( crossTab[4, 2] ), 3 );
// Get the Response variable name
Insert Into( testValue, (Substr( (reportFitmod << topparent)[Outline Box( 1 )] << get title, 10 )) );
// Create the Differeence in mean and CL string
Insert Into( dif, Char( meandiff ) || " [" || Char( lowerCL ) || ";" || Char( upperCL ) || "]" );
);
// Create the table
dlg = New Window( "Custom Report",
Outline Box( "Selected Values",
Lineup Box( N Col( 2 ), Text Box( "Factor of Interest: " ), Text Box( term[1] ) ),
Spacer Box( size( 0, 10 ) ),
tb = Table Box(
String Col Box( "Test Value", testvalue ),
String Col Box( whereCol, ByGroups ),
Number Col Box( "Mean, " || term[1], sumfit1 ),
Number Col Box( "Mean, " || term[2], sumfit2 ),
String Col Box( "Difference in mean and CI", dif )
)
)
);
tb << Set Shade Headings( 0 ); // Turn off shaded table headings.
tb << Set Column Borders( 1 ); // Turn off table column borders.
tb << Set row Borders( 1 );
tb << border( 1 );Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCiao Jim,
Grazie mille!
Distinti saluti,
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCiao Jim,
Ho un'ulteriore domanda. Se volessi eseguire l'analisi con molti valori di test, potrei:
1. Creare un ciclo con FitModel e poi continuare come nello script sopra?
2. Eseguire l'analisi separatamente, ovvero ottenere il report in un unico report e quindi eseguire uno script che salva i dati come nello script precedente?
Oppure c'è un altro modo che dovrei provare a prendere in considerazione?
Distinti saluti,
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tGiulia,
Probabilmente entrambi gli approcci funzionerebbero.
Prendere questa decisione mi sembra una decisione tremendamente importante da prendere all'inizio. Per prima cosa, penserei a come vuoi che appaia il prodotto finale, poi prenderei lo script e lo modificherei per darti quel risultato su soli 2 valori di test. Ciò ti darà un po' più di informazioni su quale dovrebbe essere l'approccio e ti mostrerà anche quali aree di JSL devi approfondire, per espandere lo script al tuo prodotto finale.
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCiao Jim,
È bello sapere che entrambi gli approcci sono possibili in JSL.
Sarebbe possibile modificare il codice in modo che Y( :"Valore di prova"n ) attraversi tutte le colonne continue?
// Determine the levels in the ID column
summarize( sd, ByGroups = By( :ID ) );
// Loop across each level of ID
For Each( {BG, group}, ByGroups,
Fm = Fit Model(
Y( :"Test value"n ),
Effects( :Person ),
Random Effects( :Day[:Person] ),
NoBounds( 0 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
:"Test value"n << {Summary of Fit( 1 ), Analysis of Variance( 0 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 1 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), {:Person << {LSMeans Student's t( 0.05 )}}}
),
Where( :ID == ByGroups[group] ),
SendToReport(
Dispatch( {"Test value ID=A1"}, "Whole Model", OutlineBox, {Close( 1 )} ),
Dispatch(
{"Test value ID=A1", "Person"},
"Leverage Plot",
OutlineBox,
{Close( 1 )}
)
)
);
// Save the pointer to the results in the Fitmod list
Insert Into( Fitmod, Fm );
);Ho esaminato molti altri loop e ho provato a modificarlo come segue:
Names Default To Here( 1 );
sd = Open( "test_table_002.jmp" );
Data Table( "test_table_002" );
Fitmod = {};
// Determine the levels in the ID column
summarize( sd, ByGroups = By( :ID ) );
colList = sd << Get Column Names( Continuous, String );
// Loop across each level of ID
For Each( i = 1, i <= Nitems( colList ), i++,
For Each( {BG, group}, ByGroups,
Fm = Fit Model(
Y( colList ),
Effects( :Person ),
Random Effects( :Day[:Person] ),
NoBounds( 0 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
colList << {Summary of Fit( 1 ), Analysis of Variance( 0 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 1 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), {:Person << {LSMeans Student's t( 0.05 )}}}
),
Where( :ID == ByGroups[group] ),
SendToReport(
Dispatch( {"Test value ID=A1"}, "Whole Model", OutlineBox, {Close( 1 )} ),
Dispatch(
{"Test value ID=A1", "Person"},
"Leverage Plot",
OutlineBox,
{Close( 1 )}
)
)
);
// Save the pointer to the results in the Fitmod list
Insert Into( Fitmod, Fm );
);
);Tuttavia, ricevo un codice di errore che non capisco del tutto.
Ho allegato una tabella di prova e ho verificato attentamente di aver allegato quella corretta.
Distinti saluti,
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tQual è il messaggio di errore?
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tEcco il messaggio di errore:

Per ora ho solo 43 righe nella sceneggiatura
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tLa modifica del tuo script è molto vicina a funzionare. Nella riga 11 stai specificando
For Each( i = 1, i <= Nitems( colList ), i++,
Dovrebbe essere
For( i = 1, i <= Nitems( colList ), i++,
C'è una grande differenza tra la funzione For Each() e For(). Definizione ed esempi delle 2 diverse funzioni possono essere trovati nello Scripting Index.
Dovrai anche modificare i tuoi riferimenti a
ElencoCol
nelle righe 15 e 23 per specificare a quale elemento di colList si fa riferimento.
Poiché stai utilizzando la variabile "i" come valore dell'indice di ricerca, dovrai specificare
colList[i]
Nella tabella dati di esempio che hai fornito, hai solo la colonna Test Value come colonne numeric(continuous), quindi eseguirai un ciclo solo una volta con la tua funzione For(). Tuttavia, se aggiungi più colonne numeric(continuous), il tuo codice con le modifiche alla sintassi che ho menzionato verrà eseguito per ciascuna delle colonne numeric(continuous)
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tGrazie. Ha molto senso!
Un'ultima domanda: se volessi modificare il testo del Dispatch inviato al rapporto, come potrei fare?
Al momento è "Test value ID=A1" e ciò che viene stampato è fx Test value 1 o Test value 2. Quando ho provato a cambiare in "Test value ID=colList", è stato stampato lo stesso, quindi non capisco come funziona.
Vorrei che venisse stampato il seguente testo per il valore di test fx 1 con ID A1: "Valore di test 1, ID=A1". Ho provato con diverse stringhe e funzioni, ma o ottengo un errore oppure viene stampato lo stesso testo di prima.
Distinti saluti,
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tNon capisco cosa stai dicendo. Lo affronterò da una prospettiva diversa. Ecco l'output della tua tabella dati per la colonna Test Value 1

cosa vuoi modificare da questo output?
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCaro Jim,
Ho scritto nell'immagine dove voglio che venga modificato e in che modo:

Se non specifica l'ID, non so come distinguere le diverse finestre che si aprono quando ci sono più ID.
Spero che questo abbia più senso:)
Distinti saluti,
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tÈ possibile modificare il valore dell'output del report modificando gli oggetti della struttura ad albero visualizzata.

Aggiungendo
report(fm)[OutlineBox(1)]<<SET title=""></SET>
prior to
// Save the pointer to the results in the Fitmod list
Insert Into( Fitmod, Fm );
cambierà il titolo nel valore che desideri
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCaro Jim,
Grazie mille per tutto il tuo aiuto! Lo apprezzo davvero ed è stato un immenso apprendimento anche per me. Lo script è ora completamente funzionante e può essere utilizzato con molti set di dati.
Distinti saluti,
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCaro Jim,
Ho utilizzato lo script e poi ho notato che, quando stampo i dati, l'elenco dei parametri non mi fornisce tutti i diversi parametri del valore di prova, ma solo il valore di prova 1:

Mi rendo conto che deriva dalla seguente parte dello script:
// Get the Response variable name
Insert Into( testValue, (Substr( (reportFitmod << topparent)[Outline Box( 1 )] << get title, 10 )) );
Ho provato a modificarlo, ma o stampa semplicemente il singolo parametro, o dà un errore, oppure stampa qualcosa di cui non ho idea da dove provenga.
Distinti saluti,
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tNon riesco più a ricostruire lo script completo che stai utilizzando. Allega lo script completo che stai utilizzando.
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tCiao Jim,
Ho allegato una tabella dati di lavoro e lo script.
BR/
Giulia
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tHo preso una scorciatoia per risolvere il problema. Ho aggiunto un elenco JMP chiamato "titles" che viene popolato dopo ogni esecuzione e subito dopo che il titolo di Outline Box() è impostato. Quindi uso semplicemente l'elenco dei titoli in Table Box() nella sezione dlg.

Names Default To Here( 1 ); // will ignore normal JSL naming
sd = currentdatatable(); // call upon open data table
// Define that Fitmod is empty. We will fill this with our information in the loop
Fitmod = {};
// Determine the levels in the ID column
summarize( sd, ByGroups = By( :Batch ) );
// Determine the result columns
colList = sd << Get Column Names( Continuous, String );
sum = 0; // Prepare getting the total number of result columns. Will be updated in the loop
titles = {};
// Loop across each level of Batch
nw_means = New Window("My Report",
For( i = 1, i <= Nitems( colList ), i++,
For Each( {BG, group}, ByGroups,
Fm = Fit Model(
Y( colList[i] ),
Effects( :Laboratory ),
Random Effects( :Day[:Laboratory] ),
NoBounds( 0 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
colList[i] << {Summary of Fit( 1 ), Analysis of Variance( 0 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 1 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), {:Person << {LSMeans Student's t( 0.05 )}}}
),
Where( :Batch == ByGroups[group] ),
SendToReport(
Dispatch( {"" }, "Whole Model", OutlineBox, {Close( 1 )} ),
Dispatch(
{"", "Laboratory"},
"Leverage Plot",
OutlineBox,
{Close( 1 )}
)
)
);
report(fm)[OutlineBox(1)] << set title(report(fm)[OutlineBox(1)] << get title || ", ID=" || BG);
// Save the pointer to the results in the Fitmod list
Insert Into( Fitmod, Fm );
insert into(titles, report(fm)[OutlineBox(1)] << get title);
);
sum = sum + 1
);
);
// Set the lists for the storage of the data from the by groups
testValue = dif = sumfit1 = sumfit2 = {};
// Loop across each by group and gather the data
For Each( {rpt, group}, Fitmod,
// Point to the current report
reportFitmod = Fitmod[group] << Report;
// Get the means for the 2 levels
sumfit = reportFitmod[Outline Box( "Least Squares Means Table" )][Number Col Box( 1 )] << Get as Matrix;
Insert Into( sumfit1, sumfit[1] );
Insert Into( sumfit2, sumfit[2] );
term = reportFitmod[Outline Box( "Least Squares Means Table" )][String Col Box( 1 )] << Get();
// Get By Group column
whereCol = Word( 2, ((reportFitmod << parent)[Text Box( 1 )]) << get text, ":=)" );
// Get data from CrossTab table
crossTab = reportFitmod[Outline Box( "LSMeans Differences Student's t" )][CrosstabBox( 1 )] << get as matrix;
meandiff = Round( crossTab[1, 2] , 4 );
lowerCL = Round( crossTab[3, 2] , 3 );
upperCL = Round( crossTab[4, 2] , 3 );
// Get the Response variable name
Insert Into( testValue, (Substr( (reportFitmod << topparent)[Outline Box( 1 )] << get title, 10 )) );
// Create the Difference in mean and CL string
Insert Into( dif, Char( meandiff ) || " [" || Char( lowerCL ) || " ; " || Char( upperCL ) || "]" );
);
// Create the table
dlg = New Window( "Custom Report",
Outline Box( "Selected Values",
Lineup Box( N Col( 2 ), Text Box( "Factor of Interest: " ), Text Box( term[1] ) ),
Spacer Box( size( 0, 10 ) ),
tb = Table Box(
String Col Box( "Paramenter", titles ),
String Col Box( whereCol, repeat(ByGroups, sum) ),
Number Col Box( "Mean, " || term[1], sumfit1 ),
Number Col Box( "Mean, " || term[2], sumfit2 ),
String Col Box( "Difference in mean and CI", dif )
)
)
);
tb << Set Shade Headings( 0 ); // Turn off shaded table headings.
tb << Set Column Borders( 1 ); // Turn off table column borders.
tb << Set row Borders( 1 );
tb << border( 1 );
Oggetto: Segnalazione dei dati da LSMeans Differences Student's tPerfezione! Grazie