<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to return AUC for a column as a single value (not a graph)? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231883#M45989</link>
    <description>&lt;P&gt;Here is a simple example to do what you are trying to do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;&amp;lt; 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 &amp;lt;= N Items( colNamesList ), i++,
	// Add a new row to the output data table
	dtOutput &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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 )] &amp;lt;&amp;lt; get)[1];
	// Close the report window
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 03 Nov 2019 03:33:13 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2019-11-03T03:33:13Z</dc:date>
    <item>
      <title>How to return AUC for a column as a single value (not a graph)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231873#M45988</link>
      <description>&lt;P&gt;I can use the following to generate an ROC curve which contains the AUC value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open( "RESULTS.jmp" );
Logistic( Y( :IsDef ), X( :Interest ), Positive Level( 0 ), ROC Curve );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="p3"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This generates a graphical curve. I have a table with 80 columns and I want to calculate the AUC value for each column and simply return each as a numerical value. I don't want to generate the graphic representation. Is there a formula that could be used within the sheet itself?&lt;BR /&gt;&lt;BR /&gt;Many thanks in advance for any assistance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2019 18:06:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231873#M45988</guid>
      <dc:creator>marcstein</dc:creator>
      <dc:date>2019-11-03T18:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to return AUC for a column as a single value (not a graph)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231883#M45989</link>
      <description>&lt;P&gt;Here is a simple example to do what you are trying to do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;&amp;lt; 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 &amp;lt;= N Items( colNamesList ), i++,
	// Add a new row to the output data table
	dtOutput &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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 )] &amp;lt;&amp;lt; get)[1];
	// Close the report window
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Nov 2019 03:33:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231883#M45989</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-11-03T03:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to return AUC for a column as a single value (not a graph)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231918#M45996</link>
      <description>&lt;P&gt;Thanks! It seems an excellent solution, but it only processes 23 out of 75&lt;BR /&gt;values. The script runs fully and successfully with no debugging errors,&lt;BR /&gt;yet fails to process numeric columns that can be processed manually.&lt;BR /&gt;&lt;BR /&gt;Any idea why?&lt;BR /&gt;&lt;BR /&gt;Here's the script as running:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Open and example data table
dt = Open( "RESULTS3.jmp" );

// Get the columns to be analyzed
colNamesList = dt &amp;lt;&amp;lt; 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 &amp;lt;= N Items( colNamesList ), i++, 

// Add a new row to the output data table
	dtOutput &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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 )] &amp;lt;&amp;lt; get)[1];

// Close the report window
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Many thanks for the assistance!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Marc&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 14:35:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231918#M45996</guid>
      <dc:creator>marcstein</dc:creator>
      <dc:date>2019-11-04T14:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to return AUC for a column as a single value (not a graph)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231919#M45997</link>
      <description>&lt;P&gt;Perfect!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2019 15:02:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231919#M45997</guid>
      <dc:creator>marcstein</dc:creator>
      <dc:date>2019-11-03T15:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to return AUC for a column as a single value (not a graph)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231920#M45998</link>
      <description>&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;My first question is, do you understand how the script I provided works?&amp;nbsp; The simple example was not provided under the assumption that it work work with the real data.&amp;nbsp; The key line is&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtOutput:AUC = (Report( theLog )["Receiver Operating Characteristic"][Number Col Box( 1 )] &amp;lt;&amp;lt; get)[1];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I assume that there is something different in the way JMP is displaying the columns that work with this line of code vs. the ones that do not.&amp;nbsp; I suggest you manually look at the differences, and then figure out what is different and then adapt the code to handle both cases.&amp;nbsp; And there may be more than two cases you will have to deal with.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2019 15:06:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-AUC-for-a-column-as-a-single-value-not-a-graph/m-p/231920#M45998</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-11-03T15:06:34Z</dc:date>
    </item>
  </channel>
</rss>

