- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to Get the AUC value
I am trying to get the AUC value from logistic regression output and write it to a table. So far, my script returns a blank value instead of 0.62937 as shown in the output below. The data table is created correctly, and the "fit model" command runs. Is there an error in the last line? I am following an example in another post in this forum, but I suspect my older version of JMP (version 9.0) may be an issue.
Names Default To Here( 1 );
// Open data table
dt = Open( "sample.jmp" );
// Create an output data table for the results
MyTable = New Table( "Results", New Column( "AUC" ) );
// Add a new row to the output data table
MyTable << Add Rows( 1 );
// Run Fit Model
MyResult = dt << Fit Model(Y( :case ),Effects( :weight ),Personality( Nominal Logistic ),Run(Positive Level( "1" ),Likelihood Ratio Tests( 1 ),ROC Curve( 1 ),));
// Add the AUC to the data table by grabbing it from the display report output
MyTable:AUC = (Report( MyResult )["Receiver Operating Characteristic"][Number Col Box( 1 )] << get [1]);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to Get the AUC value
Thanks for your help, txnelson! Ultimately, this is what worked:
Names Default To Here( 1 );
// Open data table
dt = Open( "sample.jmp" );
// Create an output data table for the results
MyTable = New Table( "Results", New Column( "AUC" ) );
// Add a new row to the output data table
MyTable << Add Rows( 1 );
// Run Fit Model
MyResult = dt << Fit Model(Y( :case ),Effects( :weight ),Personality( Nominal Logistic ),Run(Positive Level( "1" ),Likelihood Ratio Tests( 1 ),ROC Curve( 1 ),));
// Add the AUC to the data table by grabbing it from the display report output
MyTable:AUC = (Report( MyResult )["Receiver Operating Characteristic"][numberbox(1)] << get text);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to Get the AUC value
The entry for the AUC does not look like a Number Col Box(). What version of JMP are you using, and what operating system is it running on?
It looks more like a Text Box.
In my running on various versions of JMP, I do not see the format of the AUC that you are showing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to Get the AUC value
I am using JMP9.0.0 on Windows 11. If I change the last line to:
MyTable:AUC = (Report( MyResult )["Receiver Operating Characteristic"][TextBox(6)] << get text );
Then the string "Area Under Curve =" is returned as the result for the variable 'AUC'. Here is a portion of the tree structure. It's that value in NumberBox(1) that I am trying to extract.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to Get the AUC value
Try moving the trailing ")" to before the substring reference "[1]"
:AUC = (Report( MyResult )["Receiver Operating Characteristic"][Number Col Box( 1 )] << get )[1];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to Get the AUC value
Thanks for your help, txnelson! Ultimately, this is what worked:
Names Default To Here( 1 );
// Open data table
dt = Open( "sample.jmp" );
// Create an output data table for the results
MyTable = New Table( "Results", New Column( "AUC" ) );
// Add a new row to the output data table
MyTable << Add Rows( 1 );
// Run Fit Model
MyResult = dt << Fit Model(Y( :case ),Effects( :weight ),Personality( Nominal Logistic ),Run(Positive Level( "1" ),Likelihood Ratio Tests( 1 ),ROC Curve( 1 ),));
// Add the AUC to the data table by grabbing it from the display report output
MyTable:AUC = (Report( MyResult )["Receiver Operating Characteristic"][numberbox(1)] << get text);