如何編寫校準曲線腳本您好,我的腳本編寫水平非常基礎,希望您能幫助我。
如何編寫腳本來實現以下目標?
我有一張表格,其中包含校準劑的已知濃度。 在每次測定(每個測定一個表)中,我都有幾個未知物的信號以及校準器的信號,它基本上是每個測定的內部校準曲線。
是否可以創建一個腳本,從已知濃度表中獲取值,根據特定測定(測定表)的信號繪製它們,然後使用線性回歸來計算未知物的濃度?
先謝謝您的幫助!
回复:如何編寫校準曲線腳本太棒了! 我對你感激不盡,馬克。
回复:如何編寫校準曲線腳本
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 );
);
回复:如何編寫校準曲線腳本這是最後的請求,我保證!
我應該如何重寫這部分,以便腳本更加通用,並且可以應用於任何樣本集,無論它們的名稱是什麼? 例如,不要寫:
樣本=列表(“001-AAA”,“002-AAA”,“003-AAA”,“004-AAA”);
我們可以編寫代碼來對示例列進行摘要並獲取這些條目來製作列表嗎?
如果能夠使用雙變量函數繪製校準曲線並最終顯示它們,以便我們可以直觀地看到所執行的擬合,那就太好了。
回复:如何編寫校準曲線腳本完美的!
謝謝你所做的一切,馬克!
回复:如何編寫校準曲線腳本該索引現在僅用於迭代計數。 在迭代之前,特定樣本標籤將被捕獲在列表中。
// 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;
回复:如何編寫校準曲線腳本我想你誤解了我。 我所說的疑惑,是指我不明白代碼的功能。 我對編碼知之甚少,我不敢懷疑你的代碼!我只是想了解你並向你學習。
我想我理解了第一個例子。
在第二個示例中,如果樣本也有文本名稱而不是數字,那麼代碼將如何更改? 例如,我們沒有樣本 1、2 和 3,而是樣本 001-AAA、002-AAA 和 003-AAA?
回复:如何編寫校準曲線腳本你懷疑我的代碼? 好吧,這是你的特權。
第一個示例在不使用列公式屬性的情況下填充新列。
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
這對於每一行()函數迭代當前數據表的行。 它自動處理索引行。 所以分配是按行進行的。 作業的右側是如果()功能。 第一個參數被解釋為布爾表達式。 如果此表達式的計算結果為 true,則計算並返回第二個參數(“Calibrator”)。 否則,將計算並返回第三個參數(“未知”)。 第一個參數確定 Peps 數是否在 1 到 29 的範圍內。 使用正則表達式提取數字字符串並將其轉換為數字。 正則表達式匹配由三個單詞字符後跟一個或多個數字字符組成的模式。 反向引用返回唯一的捕獲組。
第二個示例迭代數據集中的三個樣本。
For( s = 1, s <= 3, s++,
// isolate sample
ss = Char( s );
combined
<< Select Where( :Sample == ss )
<< Invert Row Selection
<< Exclude;
它使用轉換為字符串的整數索引來匹配數據列屬性。 它向組合數據表發送級聯消息,以 (1) 選擇當前樣本的所有行,(2) 將選擇更改為非當前樣本的所有行,以及 (3) 排除這些行。 這種方法通常比對數據表進行子集化然後將數據表與結果連接起來更簡單、更快速。
回复:如何編寫校準曲線腳本它工作完美! 謝謝。
我想我明白每一行代碼在做什麼。 我對這些確實有一些疑問:
<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>
請你向我解釋一下好嗎?
回复:如何編寫校準曲線腳本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 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 );
);回复:如何編寫校準曲線腳本是的,他們有 29 個 pep 作為內部校準器。 這些特定的 29 個 peps 應從校準表中獲取 AU 2 值,然後每組校準與樣本編號相關的其餘 peps。
我認為我在同一篇文章中詢問了兩個不同的事情,這讓這變得更加混亂。 我對此感到抱歉。
回复:如何編寫校準曲線腳本那麼這三個樣本集應該分開處理嗎?
回复:如何編寫校準曲線腳本我想我說得太早了。 有一個問題馬克。 現在,腳本正在將所有 AU 2 值從 calib 表提取到校準器的 unk 表中,這很好。 但是,新表使用了所有分配給擬合模型中的校準品名稱的數據,並且從該模型(將樣品 1、2 和 3 中的校準品匯集在一起)預測未知數,對嗎?
我需要的是每個樣本的擬合模型,並且該樣本的未知數僅通過與該樣本相關的擬合模型來確定。
回复:如何編寫校準曲線腳本太棒了! 非常感謝馬克!
回复:如何編寫校準曲線腳本好的,謝謝您的澄清。
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
);
由於 AU 1 的隨機測量,一些預測的 AU 2 值丟失。
回复:如何編寫校準曲線腳本它確實工作得很好。 它完成了我請求幫助的任務。 但我最初的帖子有兩個部分。 首先是了解如何編寫校準腳本,就像您向我展示的那樣。
第二個與第一個無關,因此它將是一個完全不同的腳本,執行以下操作:
未知表有 3 個樣本,每個樣本分析了 74 個 Peps。 我想用其中 29 個 Peps 來校准其他 45 個。 我想通過從校準表中獲取 AU 2 值來做到這一點。 因此,腳本應該從校準表中獲取 AU 2 值,並將它們與未知表中每個樣本的 1-29 Peps 連接起來,之後應該為每個樣本製作校準曲線(線性回歸)並屬性 AU 2值為餘數 45 Peps。
謝謝你對我的包容!
我知道這些值不相關,這些是隨機生成的值,目的是學習如何編寫腳本。
回复:如何編寫校準曲線腳本我很困惑。
首先,它有效嗎? 它起到作用了嗎?
其次,是的,校準完全是使用校準表中的 AU 1 和 AU 2 值進行的。 這不正確嗎?
第三,未知表中沒有 AU 2 值。 您的意思是使用預測的未知 AU 2 值嗎?
第四,這是對校准定義的更改還是預測 AU 後的新要求(後續步驟) 2 在未知表中?
五、什麼是Sample? 它與佩普有什麼關係?
第六,Pep1 至 Pep29 校準品表中的 AU 1 不應該相關嗎? 他們不是:

我可能錯過了一些非常重要和非常基本的東西。
回复:如何編寫校準曲線腳本謝謝馬克,現在可以了。
據我了解,查看腳本,這是使用校準器表中的 AU 1 和 AU 2 值進行直接校準,是嗎?
我們如何重新排列它,以便校準器是校準器表中指定的 AU 1 值與未知表中指定的 AU 2(使其成為每個樣品的不同校準器),然後預測其餘組件的 AU 2 值在樣本中?
回复:如何編寫校準曲線腳本是版本問題。 我打開 JMP 13,(1) 該函數不再突出顯示,(2) 在腳本索引中找不到該函數。
我討厭發生這種事!
嘗試這個解決方法:
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 )} )
)
);回复:如何編寫校準曲線腳本也許是 JMP 版本問題(我有 JMP 13.1),但腳本不起作用。 我使用了 JSL 調試器,一開始就出現錯誤:名稱未解析:在訪問或評估“獲取數據表列表”時獲取數據表列表,獲取數據表列表() /*###*/
回复:如何編寫校準曲線腳本我想我理解了基本問題,但我可能錯過了一個細節。 在打開兩個數據表(校準表和未知表)的情況下嘗試此腳本:
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 )} )
)
);
該腳本並不靈活,但它是一個開始。
回复:如何編寫校準曲線腳本這是兩個示例表。 一是校準表。 另一個表具有測量值 (AU 1),需要校準以獲得未知值 (AU 2)。 讓事情變得有點複雜的是,該表包含 3 個不同樣品的測量結果,這 3 個樣品中的每一個還包含用於製造校準器的組件。 所以在每個樣本中我們都有一個內部校準器,可以這麼說。
如果知道如何編寫一個完全忽略我們有內部校準器這一事實的校準腳本(校準器表上的內容的簡單簡單線性回歸併使用表達式從樣本表中獲取未知數),那就太好了。 如果知道如何編寫使用每個樣本(樣本表)中校準器組件的測量值 (AU 1) 的校準腳本,將其與校準器表中的已知值 (AU 2) 進行繪製併計算,那就更好了該特定樣本的未知數,並對樣本表中存在的每個樣本執行相同的操作。
英語不是我的母語,所以如果您需要我說得更清楚,請告訴我。
我希望你可以幫助我。
乾杯。
回复:如何編寫校準曲線腳本感謝您驗證分析方法和過程。 繼續劇本!
您能提供數據樣本嗎? 您可以使用通用名稱(匿名數據)。 這樣我就能理解腳本應該從數據表中得到什麼。
回复:如何編寫校準曲線腳本謝謝馬克。
我已按照您提到的步驟來獲得自定義逆預測。 是的,這是一個線性回歸。
我的問題是我可以輸入的未知數有限。 提出腳本問題時考慮到我有數千個未知數,並且我認為編寫該過程的腳本將允許我獲得所有這些未知數的值。
回复:如何編寫校準曲線腳本我建議您首先學習如何使用 JMP 交互式地執行此分析。 看幫助>圖書>預測和專業建模> 章節關於擬合曲線。 它將解釋如何使用該平台來實現您的目的。 它包含一些示例,可在您嘗試分析自己的數據之前指導您並幫助您進行練習。
您目前使用什麼型號的校準曲線? 你提到了線性回歸。 如果是這種情況,請單擊“擬合曲線”旁邊的紅色三角形並選擇多項式>擬合線性。 現在單擊“線性”旁邊的紅色三角形並選擇自定義逆預測。 將出現一個對話框,您可以在其中輸入未知響應。
首先以交互方式使用“擬合曲線”平台,以確保此分析適當並產生您想要的結果。 然後我們可以幫助編寫腳本。