Fit Curveプラットフォームから適合パラメータを抽出するためのJSLの使用に関するヘルプ私はJSLコーディングを始めたばかりで、Fit Curveプラットフォームを使ったワークフローの自動化に苦労しています。自動化しようとしている内容は以下のとおりです。
ステップ1: X、Y、BYデータを指定して、曲線指数2Pモデルをデータに適合させます。以下のスクリプトコードは正常に動作します。
ステップ 2:適合パラメータ (スケールと成長率) (単に「a」と「b」であれば良いのですが) を各サンプル ID ごとに収集し、次の列を持つ新しいテーブルを作成します。「サンプル ID」、「スケール」または「a」、「成長率」または「b」、「データポイント数 (適合に使用)」
- ここでつまずいています。適切な見出し付きの新しいテーブルを作成することはできます(下記のスクリプトを参照)。しかし、フィットカーブレポートと連携して、各サンプルIDのフィット値を抽出し、それらの値を使って各サンプルIDの行を埋める方法がわかりません。JMPアシスタントとClaudeを使ってコーディングを試してみましたが、どちらもレポートからこの情報を抽出するのに苦労しました。
ステップ 3:この新しいテーブルに「TOS = 60 での予測値」と「予測値の不確実性」という 2 つの列を追加し、予測には指数 2P 式 (y = a * exp(b * x)) を使用し、パラメータの適合誤差を使用して TOS = 60 での値の不確実性を推定します。
ご協力ありがとうございます。
デイブ
New Column( "Conversion at 60 hr", Numeric, Continuous ),
New Column( "Error of Estimate", Numeric, Continuous )
);Fit Curve(
Y( :Conversion ),
X( :TOS ),
Fit Exponential 2P,
By( :Sample ID )
);<BR />results_dt = New Table( "Exponential Fit Results",<BR />Add Rows( 0 ),<BR />New Column( "Sample ID" ),<BR />New Column( "a", Numeric, Continuous ),<BR />New Column( "b", Numeric, Continuous ),<BR /><CODE class="language-jsl">New Column( "Number of Points", Numeric, Continuous ),
自動化とスクリプト作成件名:JSLを使用してFit Curveプラットフォームから適合パラメータを抽出する方法について結果テーブルのいずれかを右クリックして、結合データテーブルを作成します。

そして、結果として得られたテーブルから、「結合データテーブルの作成」というテーブルスクリプトを取得できます。これにより、何ができるかがよくわかります。
Names Default To Here(1);
rpt = New Window("Bioassay - Fit Curve of Toxicity by log Conc",
Data Table("Bioassay") << Fit Curve(
Y(:Toxicity),
X(:log Conc),
Fit Exponential 2P,
By(:Formulation)
)
);
Wait(0);
rpt["Fit Curve", "Formulation=standard", "Exponential 2P", "Parameter Estimates",
Table Box(1)] << Make Combined Data Table;
rpt << Close Window;

テーブルから、さまざまなテーブルプラットフォーム(集計、分割、更新など)を使用して最終的なテーブルを作成できます。


件名: JSL を使用して Fit Curve プラットフォームから適合パラメータを抽出する方法についてのヘルプご回答ありがとうございます。この方法も検討していましたが、テーブル全体を取得してから自分のニーズに合わせて再フォーマットするのではなく、各テーブルから直接変数を取り出す方法があると思っていました。分かりやすい説明も大変参考になりました。
件名:JSLを使用してFit Curveプラットフォームから適合パラメータを抽出する方法についてそうすることもできますが、通常はまず表形式に変換してから作業を進める方が簡単です。
件名:JSLを使用してFit Curveプラットフォームから適合パラメータを抽出する方法についてレポート構造を検索するためにXPathを使用する別のアプローチを以下に示します。これがより簡単だとは言いませんが、より堅牢で、予期せぬ事態(例えば、3番目のテーブルがもはや3番目のテーブルではないなど)が発生した場合に、単に間違った値を返すのではなく、エラーを明確に表示することがわかっています。特に、いくつかのチェックを追加して、予期しない値が現れた場合にエラーをスローするようにすればなおさらです。これはもっと簡単になるべきだと考えているので、少なくともこれらのラッパーを作成するという私の希望リスト項目を遠慮なく提案します。JSL を介してレポートから結果を取得しやすくする。
Names Default To Here( 1 );
// Example fit
dt = Open( "$SAMPLE_DATA/Nonlinear Examples/Bioassay.jmp" );
curves = dt << Fit Curve(
Y( :Toxicity ),
X( :log Conc ),
Fit Exponential 2P,
By( :Formulation )
);
// Run this to inspect the report's XML structure — it's the key to
// writing the XPath expressions below. Combine with web searches on
// XPath syntax (//, ancestor::, parent::, text(), etc.) as needed.
curves << Get XML;
// Find the right fit by matching the outline box heading — return the first match
curve = filter each( {c}, curves, length( c << XPath( "/OutlineBox[text()='Formulation=standard']" ) ) > 0 )[1];
// Find columns labeled 'Parameter' inside an outline box called 'Parameter Estimates'
// inside a box called 'Exponential 2P', then find the grandparent TableBox and return
// the first one (there should only be one — you can verify with
// if( N Items( ... ) > 1, throw( ... ) )
// Single XPath split across lines for readability; the || concatenates the fragments.
paramTableRef = (curve << XPath(
"//OutlineBox[text()='Exponential 2P']"
|| "//OutlineBox[text()='Parameter Estimates']"
|| "//StringColBoxHeader[text()='Parameter']"
|| "//ancestor::TableBox"
))[1];
// Alternative approach: you could grab the whole table as a list and parse it directly:
paramTableList = paramTableRef << Get;
Show( paramTableList );
// Sticking with XPath for now: find that StringColBoxHeader again, find its parent, and get
// the parameter names (again, assumes there is only one matching column).
paramNames = (paramTableRef << XPath( "//StringColBoxHeader[text()='Parameter']//parent::StringColBox" ))[1] << Get;
// Now get the estimates
paramEstimates = (paramTableRef << XPath( "//NumberColBoxHeader[text()='Estimate']//parent::NumberColBox" ))[1] << Get;
// Put them in an associative array
arrParamEstimates = Associative Array( paramNames, paramEstimates );
// And now you have the values keyed by parameter name
Show( arrParamEstimates["Growth Rate"], arrParamEstimates["Scale"] );