<?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 summarize by variable column names in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-summarize-by-variable-column-names/m-p/39107#M22869</link>
    <description>&lt;P&gt;Put and Eval() around the columns list and it will work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");

ColNames = dt &amp;lt;&amp;lt; Get Column Names(Numeric, "Continuous");

dt &amp;lt;&amp;lt; Summary(
		Group(:sex),
		Mean(eval(ColNames)),
		statistics column name format( "column" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 May 2017 01:01:18 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-05-11T01:01:18Z</dc:date>
    <item>
      <title>How to summarize by variable column names</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-summarize-by-variable-column-names/m-p/39098#M22862</link>
      <description>&lt;P&gt;I have a table with variable numeric, continuous column names. &amp;nbsp;I need to get the mean of each column, grouped by a different column. &amp;nbsp;The script below shows what I'm trying to do and it makes a generic table that works for this purpose. &amp;nbsp;I'm getting hung up on the "Mean(ColNames)" line because it can't seem to process that. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I replace &lt;SPAN&gt;"Mean(ColNames)"&lt;/SPAN&gt; with "Mean(:Col2, :Col3)" or "Mean(:Name("Col2"), :Name("Col3"))" then it works but obviously doesn't meet my need of being able to use variable columns. &amp;nbsp;Am I close or way off?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;BR /&gt;// Make a table to work with
nr = 20;
nc = 3;
dt = NewTable("Random_Table");
For(c=1, c&amp;lt;=nc, c++,
  dt &amp;lt;&amp;lt; NewColumn("Col"||Char(c), Numeric, Continuous, Formula(RandomInteger(1, 10)));
  );
dt &amp;lt;&amp;lt; AddRows(nr);
Column(1) &amp;lt;&amp;lt; Data Type(Character);

//Get column names for the numeric continuous columns
ColNames = dt &amp;lt;&amp;lt; Get Column Names(Numeric, "Continuous");

dt &amp;lt;&amp;lt; Summary(
		Group(:Col1),
		Mean(ColNames),
		statistics column name format( "column" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 23:22:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-summarize-by-variable-column-names/m-p/39098#M22862</guid>
      <dc:creator>MuttonChops</dc:creator>
      <dc:date>2017-05-10T23:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to summarize by variable column names</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-summarize-by-variable-column-names/m-p/39107#M22869</link>
      <description>&lt;P&gt;Put and Eval() around the columns list and it will work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");

ColNames = dt &amp;lt;&amp;lt; Get Column Names(Numeric, "Continuous");

dt &amp;lt;&amp;lt; Summary(
		Group(:sex),
		Mean(eval(ColNames)),
		statistics column name format( "column" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 May 2017 01:01:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-summarize-by-variable-column-names/m-p/39107#M22869</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-05-11T01:01:18Z</dc:date>
    </item>
  </channel>
</rss>

