問題
JMP で分析を実行し、プラットフォーム レポートから統計の一部を抽出したいと考えています。 次に、これらの統計をカスタム レポート ウィンドウに配置して、データ テーブルとプラットフォーム レポートを閉じた後も統計を保持できるようにします。
解決
分析レポートのレポート レイヤーへの参照を取得し、JSL メッセージを使用して統計情報を抽出できます。
この例では、二変量プラットフォーム レポートが生成され、レポート レイヤーへの参照を取得します (報告する)。 その参照を使用して、二変量レポートから変数と文字列を抽出できます。 次に、新しいカスタム レポート ウィンドウが作成され、レポートから抽出された統計と文字列が入力されます。 最後に、データ テーブルが閉じられ、二変量レポートが閉じますが、カスタム レポート ウィンドウは開いたままです。
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.
議論
JMP プラットフォーム レポートには、プラットフォーム レイヤーとレポート レイヤーの 2 つのレイヤーが含まれています。 プラットフォーム層への参照である JSL オブジェクトがある場合、分析に関連するそのオブジェクトにメッセージを送信できます。 これらは通常、赤い三角形のメニューにあるオプションです。 レポート レイヤーへの参照である JSL オブジェクトがある場合、レポート自体に関連するそのオブジェクトにメッセージを送信できます。 これらのメッセージは、値や画像の抽出、選択の変更、アウトライン ノードの開閉などのアクションを実行できます。
関連項目
この記事はに基づいていますJMP ドキュメントの例.
このコードに従って、別のレポートで使用しようとしました。
私の意図は、いくつかのモデルを実行し、重要な結果をここに示す方法で表にまとめることです。
これは、私が何を目指しているかを示すサンプル データセットの簡単な例です。
まず、モデルの P 値を抽出しようとしました。 そこで、2 番目のモデルをコメントアウトして、次のコードを書きました。
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 )
)
);私が望む最終的なテーブルは次のとおりです。
属性 | モデル全体のテスト | R2乗 (U) | N | 見積もり | Prob>ChiSq | オッズ比 | AUC |
柔らかさ | 1.000 | 0.000 | 24 | 0 | 1.000 | 1.000 | 0.500 |
カウント | 0.5268 | 0.012 | 24 | 0.0183 | 0.5301 | 1.01847 | 0.5625 |
これは、抽出したデータを強調表示したレポートのスクリーン ショットです。
(属性の柔らかさでは、パラメーターの推定値とオッズ比について、ジャーナルから最初の行のみを取得しました)。




元のレポート ウィンドウが表示されますが、追加のレポート ウィンドウを開くことさえできませんでした。
どんなヒントでも感謝します。
ティア、エリ