<?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 Use for loop on variability chart for several columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44605#M25546</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have several columns in a dataset and wanted to use script to plot them in variability chart so that I can generate these plots with similar settings. But there is an error. Can someone enlighten what should be the correct syntax?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my script:&lt;/P&gt;&lt;P&gt;dt = currentdatatable();&lt;BR /&gt;&lt;BR /&gt;colnames = dt &amp;lt;&amp;lt; get column names( numeric );&lt;BR /&gt;&lt;BR /&gt;show(colnames);&lt;BR /&gt;&lt;BR /&gt;nw = New window("Plots");&lt;BR /&gt;&lt;BR /&gt;for(i=5, i&amp;lt;nItems(colnames), i++,&lt;BR /&gt;test = colnames[i];&lt;BR /&gt;&lt;BR /&gt;gb = Variability Chart(&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Y( as column(test) ) ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;X( :Group, :Lot, :Wafer ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Max Iter( 100 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Conv Limit( 0.00000001 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Integration Abscissas( 128 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Function Evals( 65536 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Std Dev Chart( 0 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Show Box Plots(1),&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;nw&amp;lt;&amp;lt;append(report(gb));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;log message:&lt;/P&gt;&lt;P&gt;colnames = {Lot, Wafer, X, Y, Name("4V01PC03MHVN_BF00-LT-VL_HN_11.1X1.1-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_HN_11.1X11.1-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_MN_11.1X0.76-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_MN_11.1X11.1-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_MNT_11.1X0.76-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_MNT_11.1X11.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_HP_0.4X1.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_HP_11.1X1.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_HP_11.1X11.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_MP_11.1X1.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_MP_11.1X11.1-VALUE_F"), Name("4V01PC06TX5V_BF00-LT-VL_N5_11.1X11.1-VALUE_F"), Name("4V01PC06TX5V_BF00-LT-VL_P5_11.1X11.1-VALUE_F"), EndTimestamp};&lt;BR /&gt;Not Found in access or evaluation of 'Variability Chart' , Bad Argument( {., Role requires at least 1 columns.} ), Variability Chart(/*###*/Y( As Column( test ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;X( :Group, :Lot, :Wafer ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Max Iter( 100 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Conv Limit( 0.00000001 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Integration Abscissas( 128 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Function Evals( 65536 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Std Dev Chart( 0 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Show Box Plots( 1 )&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;In the following script, error marked by /*###*/&lt;BR /&gt;dt = Current Data Table();&lt;BR /&gt;colnames = dt &amp;lt;&amp;lt; get column names( numeric );&lt;BR /&gt;Show( colnames );&lt;BR /&gt;nw = New Window( "Plots" );&lt;BR /&gt;For( i = 5, i &amp;lt; N Items( colnames ), i++,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;test = colnames[i];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;gb = Variability Chart(/*###*/Y( As Column( test ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;X( :Group, :Lot, :Wafer ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Max Iter( 100 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Conv Limit( 0.00000001 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Integration Abscissas( 128 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Function Evals( 65536 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Std Dev Chart( 0 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Show Box Plots( 1 )&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;);&lt;BR /&gt;);&lt;BR /&gt;nw &amp;lt;&amp;lt; append( Report( gb ) );&lt;/P&gt;</description>
    <pubDate>Fri, 15 Sep 2017 06:06:56 GMT</pubDate>
    <dc:creator>cdoraem</dc:creator>
    <dc:date>2017-09-15T06:06:56Z</dc:date>
    <item>
      <title>Use for loop on variability chart for several columns</title>
      <link>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44605#M25546</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have several columns in a dataset and wanted to use script to plot them in variability chart so that I can generate these plots with similar settings. But there is an error. Can someone enlighten what should be the correct syntax?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my script:&lt;/P&gt;&lt;P&gt;dt = currentdatatable();&lt;BR /&gt;&lt;BR /&gt;colnames = dt &amp;lt;&amp;lt; get column names( numeric );&lt;BR /&gt;&lt;BR /&gt;show(colnames);&lt;BR /&gt;&lt;BR /&gt;nw = New window("Plots");&lt;BR /&gt;&lt;BR /&gt;for(i=5, i&amp;lt;nItems(colnames), i++,&lt;BR /&gt;test = colnames[i];&lt;BR /&gt;&lt;BR /&gt;gb = Variability Chart(&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Y( as column(test) ) ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;X( :Group, :Lot, :Wafer ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Max Iter( 100 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Conv Limit( 0.00000001 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Integration Abscissas( 128 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Function Evals( 65536 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Std Dev Chart( 0 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Show Box Plots(1),&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;nw&amp;lt;&amp;lt;append(report(gb));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;log message:&lt;/P&gt;&lt;P&gt;colnames = {Lot, Wafer, X, Y, Name("4V01PC03MHVN_BF00-LT-VL_HN_11.1X1.1-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_HN_11.1X11.1-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_MN_11.1X0.76-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_MN_11.1X11.1-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_MNT_11.1X0.76-VALUE_F"), Name("4V01PC03MHVN_BF00-LT-VL_MNT_11.1X11.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_HP_0.4X1.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_HP_11.1X1.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_HP_11.1X11.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_MP_11.1X1.1-VALUE_F"), Name("4V01PC04MHVP_BF00-LT-VL_MP_11.1X11.1-VALUE_F"), Name("4V01PC06TX5V_BF00-LT-VL_N5_11.1X11.1-VALUE_F"), Name("4V01PC06TX5V_BF00-LT-VL_P5_11.1X11.1-VALUE_F"), EndTimestamp};&lt;BR /&gt;Not Found in access or evaluation of 'Variability Chart' , Bad Argument( {., Role requires at least 1 columns.} ), Variability Chart(/*###*/Y( As Column( test ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;X( :Group, :Lot, :Wafer ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Max Iter( 100 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Conv Limit( 0.00000001 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Integration Abscissas( 128 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Function Evals( 65536 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Std Dev Chart( 0 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Show Box Plots( 1 )&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;In the following script, error marked by /*###*/&lt;BR /&gt;dt = Current Data Table();&lt;BR /&gt;colnames = dt &amp;lt;&amp;lt; get column names( numeric );&lt;BR /&gt;Show( colnames );&lt;BR /&gt;nw = New Window( "Plots" );&lt;BR /&gt;For( i = 5, i &amp;lt; N Items( colnames ), i++,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;test = colnames[i];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;gb = Variability Chart(/*###*/Y( As Column( test ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;X( :Group, :Lot, :Wafer ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Max Iter( 100 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Conv Limit( 0.00000001 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Integration Abscissas( 128 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Number Function Evals( 65536 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Std Dev Chart( 0 ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Show Box Plots( 1 )&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;);&lt;BR /&gt;);&lt;BR /&gt;nw &amp;lt;&amp;lt; append( Report( gb ) );&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 06:06:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44605#M25546</guid>
      <dc:creator>cdoraem</dc:creator>
      <dc:date>2017-09-15T06:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Use for loop on variability chart for several columns</title>
      <link>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44617#M25552</link>
      <description>&lt;P&gt;I have changed your code, and I think it will work the way you want it to work.&lt;/P&gt;
&lt;P&gt;1. I added a V List Box() to your "New Window". &amp;nbsp;This will allow you to have better control of the order of the output you want. &amp;nbsp;If you want the displays to go left to right, change to an H List Box().&lt;/P&gt;
&lt;P&gt;2. I added the "Invisible" element to the Variability Chart. &amp;nbsp;I am assuming that what you want, is to end up with a single window with no separate widows for each chart. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. The As Column() would not work. &amp;nbsp;I am not sure why not! &amp;nbsp;However, changing to a Column() function worked. &amp;nbsp;Also, I eliminated the need for the "Test" variable, since it is cleaner to just have the list reference, ColNames[] right in the Variability Chart code.&lt;/P&gt;
&lt;P&gt;4. &amp;nbsp;I am assuming that what you want is a single window with all of the output. &amp;nbsp;Your append at the end of your code would only append the last chart. &amp;nbsp;The reference to "gb" is not addative. &amp;nbsp;"gb" will be changed to each successive chart each time it is referenced in the For() loop. &amp;nbsp;Therefore, the append needs to be within the loop.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

colnames = dt &amp;lt;&amp;lt; get column names( numeric );

Show( colnames );

nw = New Window( "Plots", myVLB = V List Box() );

For( i = 5, i &amp;lt; N Items( colnames ), i++, 

	gb = Variability Chart(
		invisible,
		Y( Column( colnames[i] ) ),
		X( :Group, :Lot, :Wafer ),
		Max Iter( 100 ),
		Conv Limit( 0.00000001 ),
		Number Integration Abscissas( 128 ),
		Number Function Evals( 65536 ),
		Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),
		Std Dev Chart( 0 ),
		Show Box Plots( 1 ), 

	);
	myVLB &amp;lt;&amp;lt; append( Report( gb ) );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:06:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44617#M25552</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-09-15T14:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Use for loop on variability chart for several columns</title>
      <link>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44620#M25554</link>
      <description>&lt;P&gt;There are a couple things causing the error. One is that in your For() loop, you are initializing i = 5, when I assume you would want to start with the first item in the list stored in colnames, so it should be i = 1. The second thing is that you don't need to use As Column() - you can simply use the variable name (test) that's storing the column name through each iteration, Y( test ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you are appending the variability chart outside of the For() loop, which means that only the last plot will be addded to the window. You want to have the last line of your code inside the loop. Hope this helps!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:41:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44620#M25554</guid>
      <dc:creator>monica_beals</dc:creator>
      <dc:date>2017-09-15T14:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Use for loop on variability chart for several columns</title>
      <link>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44714#M25594</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for the tips. But tip#1 is not applicable as I really wanted to start at 5.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 02:39:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44714#M25594</guid>
      <dc:creator>cdoraem</dc:creator>
      <dc:date>2017-09-18T02:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use for loop on variability chart for several columns</title>
      <link>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44715#M25595</link>
      <description>&lt;P&gt;Hi, thank you for the changes. It worked in the way i wanted.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 02:40:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-for-loop-on-variability-chart-for-several-columns/m-p/44715#M25595</guid>
      <dc:creator>cdoraem</dc:creator>
      <dc:date>2017-09-18T02:40:26Z</dc:date>
    </item>
  </channel>
</rss>

