Come scriptare la curva di calibrazioneCiao, il mio livello di scripting è davvero di base e spero che tu possa aiutarmi.
Come faccio a scrivere una sceneggiatura per ottenere quanto segue?
Ho una tabella con le concentrazioni note dei calibratori. In ogni analisi (una tabella per analisi) ho il segnale di diverse incognite così come il segnale per i calibratori, è fondamentalmente una curva di calibrazione interna per ogni analisi.
È possibile creare uno script che prenda i valori dalla tabella delle concentrazioni note, li tracci rispetto ai loro segnali per quel dosaggio specifico (tabella del dosaggio) e quindi utilizzi la regressione lineare per calcolare la concentrazione delle incognite?
Grazie in anticipo per l'aiuto!
Ri: Come scriptare la curva di calibrazioneQuesto è perfetto! Non posso ringraziarti abbastanza Mark.
Ri: Come scriptare la curva di calibrazione
Names Default to Here( 1 );
// check for sufficient tables
n tables = N Table();
If( n tables < 2,
Throw( "Two data tables are required for this analysis" )
);
tables = List();
For( t = 1, t <= n tables, t++,
Insert Into( tables, Eval( Data Table( t ) << Get Name ) );
);
// identify the calibration and unknown data tables
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload the dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// include AU 2 values for calibrators from calibration table
combined = cal table << Join( With( unk table ),
Copy formula( 0 ),
Select With( :Sample, :Peps, :AU 1 ),
Select( :AU 2 ),
By Matching Columns( :Peps = :Peps ),
Drop Multiples( 0, 0 ),
Include Nonmatches( 0, 1 ),
Preserve Main Table Order( 0 )
);
Close( cal table, No Save );
Close( unk table, No Save );
// distinquish peps
Current Data Table( combined );
combined << New Column( "Status", "Character", "Nominal" );
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
// placeholders for matching information
combined
<< New Column( "Predicted AU 2", "Numeric", "Continuous" )
<< New Column( "Lower 95%", "Numeric", "Continuous" )
<< New Column( "Upper 95%", "Numeric", "Continuous" );
// handle each sample set separatelySummarize( sample = By( combined:Sample ) );
Summarize( sample list = By( combined:Sample ) );
For( s = 1, s <= N Items( sample list ), s++,
// isolate sample
combined
<< Select Where( :Sample == sample list[s] )
<< Invert Row Selection
<< Exclude;
// fit the calibration curve for this sample
dlg = combined << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Where( :Status == "Calibrator" )
);
fit = dlg << Run;
// access report layer
fit rep = fit << Report;
title = fit rep[OutlineBox(1)] << Get Title;
fit rep[OutlineBox(1)] << Set Title( title || ", Sample = " || sample list[s] );
// determine the assay for the unknown samples from the calibration curve
For Each Row(
If( Not( Excluded( Row State( Row() ) ) ),
fit << Inverse Prediction( Response( :AU 1[] ) );
);
);
// remove extraneous string column box that interferes with making combined data table
(fit rep << XPath( "//StringColBox[StringColBoxHeader=\!"Type of CI\!"]")) << Delete;
// extract the assays into a new data table
assays = fit rep["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
// fit << Close Window;
// prepare predicted values for join
assays
<< Delete Columns( Column( assays, 1 ) )
<< New Column( "Sample", "Character", "NominaL" )
<< New Column( "Peps", "Character", "NominaL" );
Current Data Table( combined );
r = 1;
For Each Row(
If( Not( Excluded( Row State( Row() ) ) ),
assays:Sample[r] = combined:Sample;
assays:Peps[r] = combined:Peps;
r++;
);
);
combined << Clear Row States;
combined << Update(
With( assays ),
Match Columns(
:Sample = :Sample,
:Peps = :Peps
)
);
Close( assays, No Save );
);
Ri: Come scriptare la curva di calibrazioneQuesta è l'ultima richiesta, promesso!
Come dovrei riscrivere questa parte in modo che lo script sia un po' più generico e possa essere applicato a qualsiasi set di campioni, indipendentemente dai loro nomi? Ad esempio, invece di scrivere:
campione = Lista( "001-AAA", "002-AAA", "003-AAA", "004-AAA");
possiamo codificare per creare un riepilogo della colonna Sample e recuperare quelle voci per creare l'elenco?
Sarebbe anche fantastico se fosse possibile tracciare le curve di calibrazione con la funzione Bivariata e farle apparire alla fine in modo da poter avere una visuale dell'adattamento che è stato eseguito.
Ri: Come scriptare la curva di calibrazionePerfetto!
Grazie di tutto Marco!
Ri: Come scriptare la curva di calibrazioneL'indice viene ora utilizzato solo per il conteggio delle iterazioni. Le etichette di esempio specifiche verrebbero acquisite in un elenco prima dell'iterazione.
// handle each sample set separately
sample = List( "001-AAA", "002-AAA", "003-AAA" );
For( s = 1, s <= 3, s++,
// isolate sample
combined
<< Select Where( :Sample == sample[s] )
<< Invert Row Selection
<< Exclude;
Ri: Come scriptare la curva di calibrazionePenso che tu mi abbia frainteso. Per dubbi intendevo dire che non capivo la funzione del codice. So molto poco di programmazione e non oserei dubitare del tuo codice!Sto solo cercando di capire e imparare da te.
Penso di aver capito il primo esempio.
Nel secondo esempio, se al posto dei numeri i campioni hanno anche una designazione testuale, come verrebbe modificato il codice? Ad esempio, invece del campione 1, 2 e 3, abbiamo il campione 001-AAA, 002-AAA e 003-AAA?
Ri: Come scriptare la curva di calibrazioneDubiti del mio codice? Beh, è una tua prerogativa.
Il primo esempio popola una nuova colonna senza utilizzare una proprietà della formula di colonna.
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
IL Per ogni riga() La funzione itera sulle righe della tabella di dati corrente. Gestisce automaticamente l'indicizzazione delle righe. Quindi l'assegnazione avviene per riga. Il lato destro del compito è il Se() funzione. Il primo argomento viene interpretato come un'espressione booleana. Se questa espressione restituisce true, il secondo argomento ("Calibrator") viene valutato e restituito. In caso contrario, viene valutato e restituito il terzo argomento ("Sconosciuto"). Il primo argomento determina se il numero Peps è compreso tra 1 e 29. La stringa numerica viene estratta con un'espressione regolare e convertita in un numero. L'espressione regolare corrisponde a un modello di tre caratteri alfanumerici seguiti da uno o più caratteri numerici. Il riferimento all'indietro restituisce l'unico gruppo di acquisizione.
Il secondo esempio itera sui tre campioni nel set di dati.
For( s = 1, s <= 3, s++,
// isolate sample
ss = Char( s );
combined
<< Select Where( :Sample == ss )
<< Invert Row Selection
<< Exclude;
Utilizza un indice intero che viene convertito in una stringa di caratteri per corrispondere all'attributo della colonna di dati. Invia una cascata di messaggi alla tabella dei dati combinati per (1) selezionare tutte le righe per il campione corrente, (2) modificare la selezione in tutte le righe non per il campione corrente e (3) escludere quelle righe. Questo approccio è in genere più semplice e veloce rispetto al sottoinsieme delle tabelle di dati e successivamente all'unione e alla concatenazione delle tabelle di dati con i risultati.
Ri: Come scriptare la curva di calibrazioneFunziona perfettamente! Grazie.
Penso di capire cosa sta facendo ogni riga di codice. Ho alcuni dubbi su questi:
<SPAN class="token function">For Each Row</SPAN><SPAN class="token punctuation">(</SPAN>
<SPAN class="token punctuation">:</SPAN>Status <SPAN class="token operator">=</SPAN> <SPAN class="token function">If</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token number">1</SPAN> <SPAN class="token operator"><=</SPAN> <SPAN class="token function">Num</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token function">Regex</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN>Peps<SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"\w{3}(\d+)"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"\1"</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token operator"><=</SPAN> <SPAN class="token number">29</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"Calibrator"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"Unknown"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN><SPAN class="token function">For</SPAN><SPAN class="token punctuation">(</SPAN> s <SPAN class="token operator">=</SPAN> <SPAN class="token number">1</SPAN><SPAN class="token punctuation">,</SPAN> s <SPAN class="token operator"><=</SPAN> <SPAN class="token number">3</SPAN><SPAN class="token punctuation">,</SPAN> s<SPAN class="token operator">++</SPAN><SPAN class="token punctuation">,</SPAN>
<SPAN class="token comment">// isolate sample</SPAN>
ss <SPAN class="token operator">=</SPAN> <SPAN class="token function">Char</SPAN><SPAN class="token punctuation">(</SPAN> s <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
combined
<SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Select Where</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN>Sample <SPAN class="token operator">==</SPAN> ss <SPAN class="token punctuation">)</SPAN>
<SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Invert Row Selection
</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Exclude</SPAN><SPAN class="token punctuation">;</SPAN>
Potresti spiegarmeli, per favore?
Ri: Come scriptare la curva di calibrazioneNames Default to Here( 1 );
// check for sufficient tables
n tables = N Table();
If( n tables < 2,
Throw( "Two data tables are required for this analysis" )
);
tables = List();
For( t = 1, t <= n tables, t++,
Insert Into( tables, Eval( Data Table( t ) << Get Name ) );
);
// identify the calibration and unknown data tables
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload the dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// include AU 2 values for calibrators from calibration table
combined = cal table << Join( With( unk table ),
Copy formula( 0 ),
Select With( :Sample, :Peps, :AU 1 ),
Select( :AU 2 ),
By Matching Columns( :Peps = :Peps ),
Drop Multiples( 0, 0 ),
Include Nonmatches( 0, 1 ),
Preserve Main Table Order( 0 )
);
Close( cal table, No Save );
Close( unk table, No Save );
// distinquish peps
Current Data Table( combined );
combined << New Column( "Status", "Character", "Nominal" );
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
// placeholders for matching information
combined
<< New Column( "Predicted AU 2", "Numeric", "Continuous" )
<< New Column( "Lower 95%", "Numeric", "Continuous" )
<< New Column( "Upper 95%", "Numeric", "Continuous" );
// handle each sample set separately
For( s = 1, s <= 3, s++,
// isolate sample
ss = Char( s );
combined
<< Select Where( :Sample == ss )
<< Invert Row Selection
<< Exclude;
// fit the calibration curve for this sample
dlg = combined << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Where( :Status == "Calibrator" )
);
fit = dlg << Run;
// determine the assay for the unknown samples from the calibration curve
For Each Row(
If( Not( Excluded( Row State( Row() ) ) ),
fit << Inverse Prediction( Response( :AU 1[] ) );
);
);
// access report layer
fit rep = fit << Report;
// remove extraneous string column box that interferes with making combined data table
(fit rep << XPath( "//StringColBox[StringColBoxHeader=\!"Type of CI\!"]")) << Delete;
// extract the assays into a new data table
assays = fit rep["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
fit << Close Window;
// prepare predicted values for join
assays
<< Delete Columns( Column( assays, 1 ) )
<< New Column( "Sample", "Character", "NominaL" )
<< New Column( "Peps", "Character", "NominaL" );
Current Data Table( combined );
r = 1;
For Each Row(
If( Not( Excluded( Row State( Row() ) ) ),
assays:Sample[r] = combined:Sample;
assays:Peps[r] = combined:Peps;
r++;
);
);
combined << Clear Row States;
combined << Update(
With( assays ),
Match Columns(
:Sample = :Sample,
:Peps = :Peps
)
);
Close( assays, No Save );
);Ri: Come scriptare la curva di calibrazioneSì, hanno i 29 peps come calibratori interni. Quei 29 pep specifici dovrebbero recuperare i valori AU 2 dalla tabella calib e quindi ogni set calibra i pep rimanenti associati al numero del campione.
Penso di aver reso questo più confuso chiedendo due cose diverse nello stesso post. Mi dispiace per questo.
Ri: Come scriptare la curva di calibrazioneQuindi i tre set di campioni dovrebbero essere gestiti separatamente?
Ri: Come scriptare la curva di calibrazionePenso di aver parlato troppo presto. C'è un problema Mark. In questo momento lo script sta estraendo tutti i valori AU 2 dalla tabella calib alla tabella unk per i calibratori e va bene. Ma poi la nuova tabella utilizza tutto ciò che è stato assegnato con la designazione del calibratore da utilizzare nel modello di adattamento e le incognite vengono previste da quell'unico modello (che ha i calibratori del campione 1, 2 e 3 raggruppati insieme), giusto?
Ciò di cui ho bisogno è un modello di adattamento per campione e che le incognite di quel campione siano determinate solo con il modello di adattamento associato a quel campione.
Ri: Come scriptare la curva di calibrazioneQuesto è perfetto! Grazie mille Marco!
Ri: Come scriptare la curva di calibrazioneOK, grazie per il chiarimento.
Names Default to Here( 1 );
// check for sufficient tables
n tables = N Table();
If( n tables < 2,
Throw( "Two data tables are required for this analysis" )
);
tables = List();
For( t = 1, t <= n tables, t++,
Insert Into( tables, Eval( Data Table( t ) << Get Name ) );
);
// identify the calibration and unknown data tables
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload the dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// include AU 2 values for calibrators from calibration table
combined = cal table << Join(
With( unk table ),
Copy formula( 0 ),
Select With( :Sample, :Peps, :AU 1 ),
Select( :AU 2 ),
By Matching Columns( :Peps = :Peps ),
Drop Multiples( 0, 0 ),
Include Nonmatches( 0, 1 ),
Preserve Main Table Order( 0 )
);
Close( cal table, No Save );
Close( unk table, No Save );
// distinquish peps
Current Data Table( combined );
combined << New Column( "Status", "Character", "Nominal" );
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
// fit the calibration curve
dlg = combined << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Where( :Status == "Calibrator" )
);
fit = dlg << Run;
// determine the assay for the unknown samples from the calibration curve
For Each Row(
fit << Inverse Prediction( Response( :AU 1[] ) );
);
// extract the assays into a new data table
assays = Report( fit )["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
fit << Close Window;
assays << Delete Columns( Column( assays, 1 ) );
// add the assays to the unknown table
final = combined << Join(
With( assays ),
Copy formula( 0 ),
By Matching Columns( :AU 1 = :Specified AU 1 ),
Drop Multiples( 0, 0 ),
Include Nonmatches( 1, 0 ),
Preserve Main Table Order( 1 )
);
Close( combined, No Save );
Close( assays, No Save );
final << Sort(
By( :Peps, :Sample ),
Order( Ascending, Ascending ),
Replace Table
);
Alcuni dei valori AU 2 previsti mancano a causa delle misurazioni casuali di AU 1.
Ri: Come scriptare la curva di calibrazioneHa funzionato perfettamente. E fa quello per cui ho chiesto aiuto. Ma c'erano due parti del mio post iniziale. Il primo era sapere come programmare la calibrazione proprio come mi hai mostrato.
Il secondo, che non è correlato al primo, quindi sarebbe uno script completamente diverso, consiste nel fare quanto segue:
La tabella sconosciuta ha 3 campioni, ogni campione è stato analizzato per 74 Peps. 29 di quei Peps voglio usarli per la calibrazione degli altri 45. E voglio farlo recuperando i valori AU 2 dalla tabella di calibrazione. Quindi lo script dovrebbe recuperare i valori AU 2 dalla tabella di calibrazione e unirli con 1-29 Peps per ciascun campione nella tabella sconosciuta, dopodiché dovrebbe creare una curva di calibrazione (regressione lineare) per ciascuno dei campioni e attribuire AU 2 valori al resto 45 Peps.
Grazie per avermi sopportato!
So che i valori non sono correlati, questi erano valori generati casualmente con lo scopo di imparare a scrivere script.
Ri: Come scriptare la curva di calibrazioneIo sono confuso.
Prima di tutto, ha funzionato o no? Ha funzionato fino a un certo punto?
In secondo luogo, sì, la calibrazione viene eseguita interamente con i valori AU 1 e AU 2 nella tabella di calibrazione. Non è corretto?
Terzo, non hai valori AU 2 nella tabella sconosciuta. Intendi utilizzare i valori AU 2 sconosciuti previsti?
In quarto luogo, si tratta di una modifica alla definizione di calibrazione o di un nuovo requisito (fase successiva) dopo aver previsto l'AU 2 nella tabella sconosciuta?
In quinto luogo, cos'è Sample? Che relazione ha con Peps?
Sesto, l'AU 1 nella tabella del calibratore per Pep1 con Pep29 non dovrebbe essere correlato? Non sono:

Probabilmente mi manca qualcosa di molto importante e molto basilare.
Ri: Come scriptare la curva di calibrazioneGrazie Marco, ora ha funzionato.
Da quello che ho capito, guardando lo script, questo è per la semplice calibrazione usando i valori AU 1 e AU 2 dalla tabella del calibratore, sì?
Come possiamo riorganizzarlo in modo che il calibratore sia i valori AU 1 specificati nella tabella del calibratore rispetto all'AU 2 dalla tabella sconosciuta (rendendolo un calibratore diverso per ogni campione) e quindi prevedere i valori AU 2 per il resto dei componenti nel campione?
Ri: Come scriptare la curva di calibrazioneÈ un problema di versione. Ho aperto JMP 13 e (1) la funzione non era più evidenziata come tale e (2) non si trova nello Scripting Index.
Odio quando succede!
Prova questa soluzione alternativa:
Names Default to Here( 1 );
// find all open data tables
/* for JMP 14 and later:
tables = Get Data Table List();
*/
n tables = N Table();
If( n tables < 2,
Throw( "Two data tables are required for this analysis" )
);
tables = List();
For( t = 1, t <= n tables, t++,
Insert Into( tables, Eval( Data Table( t ) << Get Name ) );
);
// present open tables for assignment as calibration or unknown.
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// perform the linear calibration
dlg = cal table << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" )
);
fit = dlg << Run;
// perform inverse prediction on unknown
Current Data Table( unk table );
For Each Row(
fit << Inverse Prediction( Response( :AU 1[] ) );
);
// unload unknown assays
assays = Report( fit )["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
fit << Close Window;
assays << Delete Columns( Column( assays, 1 ) );
// join with unknown table
unk table << Join(
With( assays ),
By Row Number
);
Close( assays, No Save );
// plot predictions with 95% confidence intervals versus actual
unk table << Graph Builder(
Size( 534, 454 ),
Show Control Panel( 0 ),
Variables(
X( :AU 1 ),
Y( :Lower 95% ),
Y( :Upper 95%, Position( 1 ) ),
Y( :Predicted AU 2, Position( 1 ) )
),
Elements(
Bar( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 8 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch( {}, "AU 1", ScaleBox, {Format( "Best", 12 )} ),
Dispatch( {}, "Lower 95%", ScaleBox, {Format( "Fixed Dec", 12, 0 )} )
)
);Ri: Come scriptare la curva di calibrazioneForse è un problema di versione di JMP (ho JMP 13.1) ma lo script non funziona. Ho usato JSL Debugger e ottengo un errore proprio all'inizio: Name Unresolved: Get Data Table List in accesso o valutazione di 'Get Data Table List' , Get Data Table List() /*####*/
Ri: Come scriptare la curva di calibrazionePenso di aver capito il problema di base, ma potrei aver perso un dettaglio. Prova questo script con entrambe le tabelle di dati aperte (tabella di calibrazione e tabella sconosciuta):
Names Default to Here( 1 );
// find all open data tables
tables = Get Data Table List();
If( N Items( tables ) < 2,
Throw( "Two data tables are required for this analysis" )
);
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// perform the linear calibration
dlg = cal table << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" )
);
fit = dlg << Run;
// perform inverse prediction on unknown
Current Data Table( unk table );
For Each Row(
fit << Inverse Prediction( Response( :AU 1[] ) );
);
// unload unknown assays
assays = Report( fit )["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
fit << Close Window;
assays << Delete Columns( Column( assays, 1 ) );
// join with unknown table
unk table << Join(
With( assays ),
By Row Number
);
Close( assays, No Save );
// plot predictions with 95% confidence intervals versus actual
unk table << Graph Builder(
Size( 534, 454 ),
Show Control Panel( 0 ),
Variables(
X( :AU 1 ),
Y( :Lower 95% ),
Y( :Upper 95%, Position( 1 ) ),
Y( :Predicted AU 2, Position( 1 ) )
),
Elements(
Bar( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 8 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch( {}, "AU 1", ScaleBox, {Format( "Best", 12 )} ),
Dispatch( {}, "Lower 95%", ScaleBox, {Format( "Fixed Dec", 12, 0 )} )
)
);
Lo script non è flessibile ma è un inizio.
Ri: Come scriptare la curva di calibrazioneEcco due tabelle di esempio. Uno è il tavolo del calibratore. L'altra tabella è quella che ha i valori misurati (AU 1) e necessita di calibrazione per ottenere i valori sconosciuti (AU 2). Per complicare un po' le cose, questa tabella ha le misurazioni per 3 diversi campioni e ognuno di questi 3 campioni conteneva anche i componenti che sono stati usati per realizzare il calibratore. Quindi in ogni campione abbiamo un calibratore interno, per così dire.
Sarebbe bello sapere come scrivere una calibrazione che ometta completamente il fatto che abbiamo un calibratore interno (regressione lineare semplice e semplice di ciò che è sulla tabella del calibratore e utilizzare l'espressione per ottenere le incognite dalla tabella dei campioni). E sarebbe ancora meglio sapere come creare uno script per una calibrazione che utilizzi i valori misurati (AU 1) dei componenti del calibratore in ogni campione (tabella dei campioni), li confronti con i valori noti (AU 2) nella tabella del calibratore e calcoli le incognite per quello specifico campione, e fa lo stesso per ogni campione presente nella tabella dei campioni.
L'inglese non è la mia lingua madre, quindi per favore fatemi sapere se avete bisogno che io sia un po' più chiaro.
Spero che puoi aiutarmi.
Saluti.
Ri: Come scriptare la curva di calibrazioneGrazie per aver verificato il metodo e il processo di analisi. Avanti con la sceneggiatura!
Potete fornire un campione di dati? È possibile utilizzare nomi generici (dati anonimi). In questo modo capirò cosa dovrebbe aspettarsi lo script dalla tabella dei dati.
Ri: Come scriptare la curva di calibrazioneGrazie Marco.
Ho seguito i passaggi che hai menzionato per ottenere la previsione inversa personalizzata. Sì, è una regressione lineare.
Il mio problema è il numero limitato di sconosciuti che posso inserire. La domanda di scripting è stata posta tenendo presente che ho migliaia di incognite e ho pensato che lo scripting della procedura mi avrebbe consentito di valutare tutte quelle incognite.
Ri: Come scriptare la curva di calibrazioneTi suggerisco di imparare prima come eseguire questa analisi in modo interattivo utilizzando JMP. Vedere Aiuto > Libri > Modellazione predittiva e specializzata > capitolo su Adatta curva . Spiegherà come utilizzare questa piattaforma per il tuo scopo. Include esempi per guidarti e aiutarti a fare pratica prima di tentare di analizzare i tuoi dati.
Quale modello utilizzi attualmente per la tua curva di calibrazione? Hai menzionato la regressione lineare. In tal caso, fare clic sul triangolo rosso accanto a Adatta curva e selezionare Polinomi > Adatta lineare . Ora fai clic sul triangolo rosso accanto a Lineare e seleziona Previsione inversa personalizzata . Viene visualizzata una finestra di dialogo in cui è possibile inserire le risposte sconosciute.
Usa prima la piattaforma Fit Curve in modo interattivo per assicurarti che questa analisi sia appropriata e produca i risultati che cerchi. Quindi possiamo aiutare con una sceneggiatura.