<?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: dynamic Y variable for oneway analysis in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/544122#M76301</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12626"&gt;@XiangCD_MP_User&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try using Response Screening under the Analyze&amp;gt;Screening menu. &amp;nbsp;You can still pass in the list of column names into the Y variable place holder. The output of Response Screening will allow an option in the red triangle to save means for each X level or a Pvalues table that has the mean for each Y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you find all of the columns that match a string and put them into a list (which looks like what you are doing), you can use the variable name (using Eval()) within the Y variable of Response Screening. Or you can group them into a column group and reference the column group within Response Screening. Effectively it will do the loop like you want and it is dynamic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something Like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Probe.jmp" );
dt &amp;lt;&amp;lt; Response Screening(
	X( :Process ),
	Y( Column Group( "Responses" ) ),
    PValues Table on Launch( 1 ),
	Save Means
); &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This outputs the p-values as well as the mean of Y for each comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 18:25:57 GMT</pubDate>
    <dc:creator>Chris_Kirchberg</dc:creator>
    <dc:date>2022-09-13T18:25:57Z</dc:date>
    <item>
      <title>dynamic Y variable for oneway analysis</title>
      <link>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/543381#M76243</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to script a dynamic Y variable for oneway analysis, then output the mean into a combined table. Is this a correct way to do so ?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Data Table ("Analysis");
ColNamesList = d1 &amp;lt;&amp;lt; get column names (string );
For( i = N Items( ColNamesList ), i &amp;gt;= 1, i--,
OW = (dt &amp;lt;&amp;lt; Oneway( Y( Column(ColNamesList) ),
	   X(:SITE),
	   Mean ( 1 ),
	   Automatic Recalc( 0 )
	 )) &amp;lt;&amp;lt; Report;
);
dtCombined = Report( OW[1] )[Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:54:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/543381#M76243</guid>
      <dc:creator>XiangCD_MP_User</dc:creator>
      <dc:date>2023-06-10T23:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic Y variable for oneway analysis</title>
      <link>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/543508#M76246</link>
      <description>&lt;P&gt;Run it: is it working for your table?&lt;/P&gt;&lt;P&gt;If yes, this is a correct way to do it!&lt;/P&gt;&lt;P&gt;If not, let us know where you run into trouble?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 09:59:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/543508#M76246</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2022-09-12T09:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic Y variable for oneway analysis</title>
      <link>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/543511#M76249</link>
      <description>&lt;P&gt;Sorry, I accidentally clicked on the solution button.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script did not prompt any error. But, there was also no graph seen as an output.&lt;/P&gt;&lt;P&gt;The script log only shows scriptable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 10:30:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/543511#M76249</guid>
      <dc:creator>XiangCD_MP_User</dc:creator>
      <dc:date>2022-09-12T10:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic Y variable for oneway analysis</title>
      <link>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/544100#M76298</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12626"&gt;@XiangCD_MP_User&lt;/a&gt;&amp;nbsp;, I had several issues with your script. If I got your task, it is doing a oneway analysis for each continuous column of the data table by :site, and saving the data table with the mean.&lt;/P&gt;
&lt;P&gt;If so, I would do it like follows:&lt;/P&gt;
&lt;P&gt;Alternatively there are other possiblities, e.g. putting all together in one "Fit Group" statement. The best way depends on your scripting skills, and what exact environment it should run in.&amp;nbsp;&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 );

dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
// dt = Data Table ("Analysis");

OW_lst = {};

ColNamesList = dt &amp;lt;&amp;lt; get column names( string, "Continuous" );

// When using single report windows, you would need to collect the result table from each of them
/*
For( i = N Items( ColNamesList ), i &amp;gt;= 1, i--,
	Insert Into( OW_lst, dt &amp;lt;&amp;lt; Oneway( Y( Column( ColNamesList[i] ) ), X( :sex ), Means( 1 ), Automatic Recalc( 0 ) ) )
);
*/

// Generate new report window to collect all analyses
nw = New Window( "Oneway Collection",
	hlb = H List Box(
		For( i = N Items( ColNamesList ), i &amp;gt;= 1, i--, 
		// collect references to each analysis in OW_lst
			Insert Into( OW_lst, dt &amp;lt;&amp;lt; Oneway( Y( Column( ColNamesList[i] ) ), X( :sex ), Means( 1 ), Automatic Recalc( 0 ) ) )
		)
	)
);

// Message will collect all similar tables in one data table
dtCombined = Report( OW_lst[1] )[Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;

// Alternatively you would be able to get the same result w/o working with a list like follows
//(nw &amp;lt;&amp;lt; XPATH( "//TableBox" ))[2] &amp;lt;&amp;lt; Make Combined Data Table;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Sep 2022 17:39:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/544100#M76298</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2022-09-13T17:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic Y variable for oneway analysis</title>
      <link>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/544122#M76301</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12626"&gt;@XiangCD_MP_User&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try using Response Screening under the Analyze&amp;gt;Screening menu. &amp;nbsp;You can still pass in the list of column names into the Y variable place holder. The output of Response Screening will allow an option in the red triangle to save means for each X level or a Pvalues table that has the mean for each Y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you find all of the columns that match a string and put them into a list (which looks like what you are doing), you can use the variable name (using Eval()) within the Y variable of Response Screening. Or you can group them into a column group and reference the column group within Response Screening. Effectively it will do the loop like you want and it is dynamic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something Like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Probe.jmp" );
dt &amp;lt;&amp;lt; Response Screening(
	X( :Process ),
	Y( Column Group( "Responses" ) ),
    PValues Table on Launch( 1 ),
	Save Means
); &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This outputs the p-values as well as the mean of Y for each comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 18:25:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamic-Y-variable-for-oneway-analysis/m-p/544122#M76301</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2022-09-13T18:25:57Z</dc:date>
    </item>
  </channel>
</rss>

