再:列のAUCを(グラフではなく)単一の値として返す方法は?ここにあなたがやろうとしていることをする簡単な例があります
Names Default To Here( 1 );
// Open and example data table
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Get the columns to be analyzed
colNamesList = dt << get column names( string, continuous );
// Create a data table to save the results to
dtOutput = New Table( "Results", New Column( "Column", character ), New Column( "AUC" ) );
// Loop across all of the columns to be analyzed and retrieve the AUC
For( i = 1, i <= N Items( colNamesList ), i++,
// Add a new row to the output data table
dtOutput << Add Rows( 1 );
// Add the active variable name to the current row in the data table
dtOutput:Column[i] = colNamesList[i];
// Run the Logistic Regression
theLog = dt << Logistic( invisible, Y( :sex ), X( Column( colNamesList[i] ) ), Positive Level( "F" ), ROC Curve );
// Add the AUC to the data table by grabbing it from the display report output
dtOutput:AUC = (Report( theLog )["Receiver Operating Characteristic"][Number Col Box( 1 )] << get)[1];
// Close the report window
Report( theLog ) << close window;
);
再:列のAUCを(グラフではなく)単一の値として返す方法は?パーフェクト!
本当にありがとう!
マーク
再:列のAUCを(グラフではなく)単一の値として返す方法は?私の最初の質問は、私が提供したスクリプトがどのように機能するかを理解していますか?単純な例は、実際のデータで機能するという前提の下では提供されていません。 キーラインは
dtOutput:AUC = (Report( theLog )["Receiver Operating Characteristic"][Number Col Box( 1 )] << get)[1];
このコード行で機能する列とそうでない列をJMPが表示する方法に何か違いがあると思います。 違いを手動で確認し、違いを把握してから、両方のケースを処理するようにコードを調整することをお勧めします。 また、対処しなければならないケースは3つ以上あります。
列のAUCを(グラフではなく)単一の値として返す方法は?以下を使用して、AUC値を含むROC曲線を生成できます。
デフォルトの名前はHere(1); Open( "RESULTS.jmp");ロジスティック(Y(:IsDef)、X(:Interest)、正レベル(0)、ROC曲線);
これにより、グラフィカルな曲線が生成されます。80列のテーブルがあり、各列のAUC値を計算し、それぞれを数値として返します。グラフィック表現を生成したくありません。シート自体で使用できる数式はありますか?
どんな援助も事前に感謝します!
マーク
再:列のAUCを(グラフではなく)単一の値として返す方法は?ありがとう!優れたソリューションのようですが、75のうち23しか処理しません
値。スクリプトは完全に正常に実行され、デバッグエラーはありません。
ただし、手動で処理できる数値列の処理は失敗します。
理由は何ですか?
実行中のスクリプトは次のとおりです。
Names Default To Here( 1 );
// Open and example data table
dt = Open( "RESULTS3.jmp" );
// Get the columns to be analyzed
colNamesList = dt << get column names( string, continuous );
// Create a data table to save the results to
dtOutput = New Table( "AUCResults", New Column( "Column", character ), New Column( "AUC" ) );
// Loop across all of the columns to be analyzed and retrieve the AUC
For( i = 1, i <= N Items( colNamesList ), i++,
// Add a new row to the output data table
dtOutput << Add Rows( 1 );
// Add the active variable name to the current row in the data table
dtOutput:Column[i] = colNamesList[i];
// Run the Logistic Regression
theLog = dt << Logistic( invisible, Y( :isDef ), X( Column( colNamesList[i] ) ), Positive Level( "0" ), ROC Curve );
// Add the AUC to the data table by grabbing it from the display report output
dtOutput:AUC = (Report( theLog )["Receiver Operating Characteristic"][Number Col Box( 1 )] << get)[1];
// Close the report window
Report( theLog ) << close window;
);
支援に感謝します!
ベスト、
マーク