cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
ond_stats
Level II

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]);

fit_model_display_box.png

 

results_table.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
ond_stats
Level II

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);

View solution in original post

4 REPLIES 4
txnelson
Super User

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.

Jim
ond_stats
Level II

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. 

 

tree_structure.png

txnelson
Super User

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];
Jim
ond_stats
Level II

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);