<?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 Name Unresolved: Column name will not resolved when I specify it as a value in a list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684401#M87015</link>
    <description>&lt;P&gt;I am trying to calculate the AUC for each column in a data table. I am collecting all of the column names into a list "colNamesList", and retrieving each column name in Fit Model inside a For loop by incrementing the list subscript. However, the call to the array is not resolving inside the Fit Model call.&amp;nbsp; If I include show(colNamesList[i]) on a separate line, it resolves fine, just not inside the Fit Model call. I am using a script from a prior post in this forum, and I suspect that my older version of JMP (version 9.0.0) just needs slightly different syntax. Any ideas would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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.jmp" );

// Get the columns to be analyzed
colNamesList = dt &amp;lt;&amp;lt; get column names( string );

// Create a data table to save the results to
dtOutput = New Table( "Results", New Column( "var_name", character ), New Column( "AUC", character ) );

// 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:var_name[i] = colNamesList[i];
	// Run the Logistic Regression
	theLog = dt &amp;lt;&amp;lt; Fit Model(invisible, Y( :case ),Effects( column (colNameList[i]) ),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
	dtOutput:AUC = (Report( theLog )["Receiver Operating Characteristic"][numberbox(1)] &amp;lt;&amp;lt; get text);
	// Close the report window
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The error in the log is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Name Unresolved: colNameList{1}

 in access or evaluation of 'colNameList' , colNameList

Exception in platform launch{1}

 in access or evaluation of 'Fit Model' , Fit Model(
	invisible,
	Y( :case ),
	Effects( Column( colNameList[i] ) ),
	Personality( Nominal Logistic ),
	Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
)

In the following script, error marked by /*###*/
Fit Model(
	invisible,
	Y( :case ),
	Effects( Column( colNameList/*###*/[i] ) ),
	Personality( Nominal Logistic ),
	Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
)
Cannot subscript Display Box{1}

 in access or evaluation of 'Subscript' , Report( theLog )["Receiver Operating Characteristic"]

In the following script, error marked by /*###*/
Names Default To Here( 1 );
dt = Open( "sample.jmp" );
colNamesList = dt &amp;lt;&amp;lt; get column names( string );
dtOutput = New Table( "Results",
	New Column( "var_name", character ),
	New Column( "AUC", character )
);
For( i = 1, i &amp;lt;= N Items( colNamesList ), i++,
	dtOutput &amp;lt;&amp;lt; Add Rows( 1 );
	dtOutput:var_name[i] = colNamesList[i];
	theLog = dt &amp;lt;&amp;lt; Fit Model(/*###*/invisible,
		Y( :case ),
		Effects( Column( colNameList[i] ) ),
		Personality( Nominal Logistic ),
		Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
	);
	dtOutput:AUC = Report( theLog )[/*###*/"Receiver Operating Characteristic"][
	numberbox( 1 )] &amp;lt;&amp;lt; get text;
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Oct 2023 01:40:23 GMT</pubDate>
    <dc:creator>ond_stats</dc:creator>
    <dc:date>2023-10-06T01:40:23Z</dc:date>
    <item>
      <title>Name Unresolved: Column name will not resolved when I specify it as a value in a list</title>
      <link>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684401#M87015</link>
      <description>&lt;P&gt;I am trying to calculate the AUC for each column in a data table. I am collecting all of the column names into a list "colNamesList", and retrieving each column name in Fit Model inside a For loop by incrementing the list subscript. However, the call to the array is not resolving inside the Fit Model call.&amp;nbsp; If I include show(colNamesList[i]) on a separate line, it resolves fine, just not inside the Fit Model call. I am using a script from a prior post in this forum, and I suspect that my older version of JMP (version 9.0.0) just needs slightly different syntax. Any ideas would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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.jmp" );

// Get the columns to be analyzed
colNamesList = dt &amp;lt;&amp;lt; get column names( string );

// Create a data table to save the results to
dtOutput = New Table( "Results", New Column( "var_name", character ), New Column( "AUC", character ) );

// 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:var_name[i] = colNamesList[i];
	// Run the Logistic Regression
	theLog = dt &amp;lt;&amp;lt; Fit Model(invisible, Y( :case ),Effects( column (colNameList[i]) ),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
	dtOutput:AUC = (Report( theLog )["Receiver Operating Characteristic"][numberbox(1)] &amp;lt;&amp;lt; get text);
	// Close the report window
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The error in the log is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Name Unresolved: colNameList{1}

 in access or evaluation of 'colNameList' , colNameList

Exception in platform launch{1}

 in access or evaluation of 'Fit Model' , Fit Model(
	invisible,
	Y( :case ),
	Effects( Column( colNameList[i] ) ),
	Personality( Nominal Logistic ),
	Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
)

In the following script, error marked by /*###*/
Fit Model(
	invisible,
	Y( :case ),
	Effects( Column( colNameList/*###*/[i] ) ),
	Personality( Nominal Logistic ),
	Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
)
Cannot subscript Display Box{1}

 in access or evaluation of 'Subscript' , Report( theLog )["Receiver Operating Characteristic"]

In the following script, error marked by /*###*/
Names Default To Here( 1 );
dt = Open( "sample.jmp" );
colNamesList = dt &amp;lt;&amp;lt; get column names( string );
dtOutput = New Table( "Results",
	New Column( "var_name", character ),
	New Column( "AUC", character )
);
For( i = 1, i &amp;lt;= N Items( colNamesList ), i++,
	dtOutput &amp;lt;&amp;lt; Add Rows( 1 );
	dtOutput:var_name[i] = colNamesList[i];
	theLog = dt &amp;lt;&amp;lt; Fit Model(/*###*/invisible,
		Y( :case ),
		Effects( Column( colNameList[i] ) ),
		Personality( Nominal Logistic ),
		Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
	);
	dtOutput:AUC = Report( theLog )[/*###*/"Receiver Operating Characteristic"][
	numberbox( 1 )] &amp;lt;&amp;lt; get text;
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2023 01:40:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684401#M87015</guid>
      <dc:creator>ond_stats</dc:creator>
      <dc:date>2023-10-06T01:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Name Unresolved: Column name will not resolved when I specify it as a value in a list</title>
      <link>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684412#M87016</link>
      <description>&lt;OL&gt;
&lt;LI&gt;The reason the Name was Unresolved is because you called the list, colNamesList, and you referenced it as colNameLise.&lt;/LI&gt;
&lt;LI&gt;The AUC value needs to be placed at a defined row, therefore you need to add the suscript to dtOutput:AUC&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Open and example data table
dt = Open( "sample.jmp" );

// Get the columns to be analyzed
colNamesList = dt &amp;lt;&amp;lt; get column names( string );

// Create a data table to save the results to
dtOutput = New Table( "Results", New Column( "var_name", character ), New Column( "AUC", character ) );

// 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:var_name[i] = colNamesList[i];
	// Run the Logistic Regression
	theLog = dt &amp;lt;&amp;lt; Fit Model(
		invisible,
		Y( :case ),
		Effects( Column( colNamesList[i] ) ),
		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
	dtOutput:AUC[i] = (Report( theLog )["Receiver Operating Characteristic"][numberbox( 1 )] &amp;lt;&amp;lt; get text);
	// Close the report window
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2023 03:42:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684412#M87016</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-06T03:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Name Unresolved: Column name will not resolved when I specify it as a value in a list</title>
      <link>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684633#M87051</link>
      <description>&lt;P&gt;Yes, that was a typo and fixing it was part of the solution, so thanks for seeing that. I was still getting a "could not find column{1}" error, and that resolved by referencing the data table when specifying the column: Column(dt, colNamesList[i]) instead of&amp;nbsp;Column(colNamesList[i]). Then I got the error "Response should also not be a factor, ^1case", so I added an IF statement to ignore the response column.&amp;nbsp;This ran whether I added the subscript to AUC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is my first jsl script. Quite a learning experience. Thanks to txnelson for you help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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.jmp" );

// Get the columns to be analyzed
colNamesList = dt &amp;lt;&amp;lt; get column names( string );

// Create a data table to save the results to
dtOutput = New Table( "Results", New Column( "var_name", character ), New Column( "AUC", character ) );

// 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:var_name[i] = colNamesList[i];
	//Get the next column name
	colName = colNamesList[i];
	// If the column is "case", leave AUC blank, otherwise run the Logistic Regression
	if(colName=="case", AUC=.,
		theLog = dt &amp;lt;&amp;lt; Fit Model(
			invisible,
			Y(:case),
			Effects(column(dt,colName)),
			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
		dtOutput:AUC[i] = (Report( theLog )["Receiver Operating Characteristic"][numberbox(1)] &amp;lt;&amp;lt; get text);
	);
	// Close the report window
	Report( theLog ) &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2023 18:25:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684633#M87051</guid>
      <dc:creator>ond_stats</dc:creator>
      <dc:date>2023-10-06T18:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Name Unresolved: Column name will not resolved when I specify it as a value in a list</title>
      <link>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684634#M87052</link>
      <description>&lt;P&gt;Great job!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can avoid the error response by changing the line to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;try(Report( theLog ) &amp;lt;&amp;lt; close window);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can also shorten and make the JSL run more efficiently by removing the duplicate assignments to a single statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;colName = dtOutput:var_name[i] = colNamesList[i];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2023 18:54:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Name-Unresolved-Column-name-will-not-resolved-when-I-specify-it/m-p/684634#M87052</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-06T18:54:53Z</dc:date>
    </item>
  </channel>
</rss>

