<?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: col mean with byVar argument not running in script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/597736#M80122</link>
    <description>&lt;P&gt;Are you trying to create formula, use &amp;lt;&amp;lt; set each value to fill values in column or use For Each Row?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1675712202158.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49866i8E08A884D4370FA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_0-1675712202158.png" alt="jthi_0-1675712202158.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you are just trying to get mean values based on groups in a script, you will have to use other methods (Summarize for example).&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 19:37:42 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-02-06T19:37:42Z</dc:date>
    <item>
      <title>col mean with byVar argument not running in script</title>
      <link>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/597715#M80120</link>
      <description>&lt;P&gt;I am trying to use the Col Mean function with 2 additional columns to group by. The formula works perfectly when I manually enter it, but when I copy it into my script and run I get only one (incorrect) number in the first row. If I click in to view the formula and then hit apply the column the properly populates. This seems to be specific to trying to add the byVar argument as my col mean formula will work properly if I remove those. Any ideas on what I am doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; Formula(Col Mean(:RLU))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This doesn't&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; Formula(Col Mean( :RLU, :Assay))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:38:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/597715#M80120</guid>
      <dc:creator>chappe</dc:creator>
      <dc:date>2023-06-08T16:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: col mean with byVar argument not running in script</title>
      <link>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/597736#M80122</link>
      <description>&lt;P&gt;Are you trying to create formula, use &amp;lt;&amp;lt; set each value to fill values in column or use For Each Row?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1675712202158.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49866i8E08A884D4370FA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_0-1675712202158.png" alt="jthi_0-1675712202158.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you are just trying to get mean values based on groups in a script, you will have to use other methods (Summarize for example).&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 19:37:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/597736#M80122</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-02-06T19:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: col mean with byVar argument not running in script</title>
      <link>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/597797#M80131</link>
      <description>&lt;P&gt;The by Var is referencing a column in the same table. I am creating the column and then trying to populate it using the formula which works perfectly when I do it manually but even taking that exact script and pasting it into my larger script doesn't work. If I remove the ":assay" from the formula and run my script, it populates every row (but this is the mean across different groups).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 21:31:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/597797#M80131</guid>
      <dc:creator>chappe</dc:creator>
      <dc:date>2023-02-06T21:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: col mean with byVar argument not running in script</title>
      <link>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/598229#M80185</link>
      <description>&lt;P&gt;There must be something else going on, as your syntax for Col Mean is OK. For example, the following script works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = as table(J(50, 1, randomuniform()), &amp;lt;&amp;lt; column names ({"RLU"}) );

dt &amp;lt;&amp;lt; new column ("Assay", character, &amp;lt;&amp;lt; set values ( words("abcd", "")[J(50, 1, randominteger(1,4))]));

dt &amp;lt;&amp;lt; new column ("mean", formula(colmean(:RLU, :Assay)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see that it is computing group means.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brady_brady_0-1675803673716.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49907i1798AB705FBB8B53/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brady_brady_0-1675803673716.png" alt="brady_brady_0-1675803673716.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I first ran my code, I forgot to place the column name RLU in curly braces, so the column name was not created properly, and I got an error like the one you described. Perhaps it has something to do with this?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brady_brady_1-1675803764331.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49908iD6E27188A73D8498/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brady_brady_1-1675803764331.png" alt="brady_brady_1-1675803764331.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brady_brady_0-1675803890304.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49910iF8C09D0C5A7B1539/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brady_brady_0-1675803890304.png" alt="brady_brady_0-1675803890304.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 21:05:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/598229#M80185</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2023-02-07T21:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: col mean with byVar argument not running in script</title>
      <link>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/598230#M80186</link>
      <description>&lt;P&gt;Could you please right click on the non-functional formula column&amp;nbsp; and post the JSL code here. Sometimes it's just a comma or semicolon at the wrong position. If you fix it everything is fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which sample data table are you using?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 21:10:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/col-mean-with-byVar-argument-not-running-in-script/m-p/598230#M80186</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-02-07T21:10:37Z</dc:date>
    </item>
  </channel>
</rss>

