<?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: Reduce sorted list by averaging every n rows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Reduce-sorted-list-by-averaging-every-n-rows/m-p/362684#M61247</link>
    <description>&lt;P&gt;Jim's steps are the way to go, and can be combined in a formula like this one, which avoids sort-dependency and also allows for table augmentation later:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean( :Vals, Floor( (Col Rank( :Vals ) - 1) / 100 ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Below, I've used this formula on integers 1::1000, randomly sorted. As shown, any number between 100*k+1 and 100*(k+1), inclusive, will have a group mean of&amp;nbsp; k + 50.5. In practice, you may be sorting (ranking) by another column, say a timestamp, which is fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&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_1-1614268732653.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30698iBEE33DFCE41F06E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brady_brady_1-1614268732653.png" alt="brady_brady_1-1614268732653.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Feb 2021 16:04:05 GMT</pubDate>
    <dc:creator>brady_brady</dc:creator>
    <dc:date>2021-02-25T16:04:05Z</dc:date>
    <item>
      <title>Reduce sorted list by averaging every n rows</title>
      <link>https://community.jmp.com/t5/Discussions/Reduce-sorted-list-by-averaging-every-n-rows/m-p/362647#M61244</link>
      <description>&lt;P&gt;This must be a common way to 'sample' long column of data. For example, after sorting a column of 10,000 rows from min to max, generate a column with 100 averages (or sums) of every 100 rows.&lt;/P&gt;&lt;P&gt;In Excel, this can be done with a formula using the OFFSET function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can this be done in JMP? Thank you,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:26:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reduce-sorted-list-by-averaging-every-n-rows/m-p/362647#M61244</guid>
      <dc:creator>tomSorger</dc:creator>
      <dc:date>2023-06-10T23:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce sorted list by averaging every n rows</title>
      <link>https://community.jmp.com/t5/Discussions/Reduce-sorted-list-by-averaging-every-n-rows/m-p/362669#M61245</link>
      <description>&lt;P&gt;One simple way of doing this is to create a new column which has a unique value for rows 1-100, 101-200 etc.&amp;nbsp; and then use the col mean() function to calculate separate means for each unique value created.&amp;nbsp; So interactively here is how to do it&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a new column and specify the following formula to provide a unique value for each grouping of 100 row. For this example I suggest that you call the new column "onehundreds"&amp;nbsp;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Floor((Row() - 1) / 100)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;Create a second new column of whatever name you want using the following formula
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean(:&amp;lt;the column you want averaged&amp;gt;, :onehundreds)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;I also suggest that you then follow this with opening up the Column Info for each of the new columns and specifying to remove the formula.&amp;nbsp; This will convert the values in each of the columns to static values.&amp;nbsp; You can then&amp;nbsp;
&lt;OL&gt;
&lt;LI&gt;Delete the onehundreds column&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Sort the data to whatever new order you want, and the calculated mean values will not change&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 25 Feb 2021 14:31:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reduce-sorted-list-by-averaging-every-n-rows/m-p/362669#M61245</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-02-25T14:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce sorted list by averaging every n rows</title>
      <link>https://community.jmp.com/t5/Discussions/Reduce-sorted-list-by-averaging-every-n-rows/m-p/362684#M61247</link>
      <description>&lt;P&gt;Jim's steps are the way to go, and can be combined in a formula like this one, which avoids sort-dependency and also allows for table augmentation later:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean( :Vals, Floor( (Col Rank( :Vals ) - 1) / 100 ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Below, I've used this formula on integers 1::1000, randomly sorted. As shown, any number between 100*k+1 and 100*(k+1), inclusive, will have a group mean of&amp;nbsp; k + 50.5. In practice, you may be sorting (ranking) by another column, say a timestamp, which is fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&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_1-1614268732653.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30698iBEE33DFCE41F06E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brady_brady_1-1614268732653.png" alt="brady_brady_1-1614268732653.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 16:04:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reduce-sorted-list-by-averaging-every-n-rows/m-p/362684#M61247</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2021-02-25T16:04:05Z</dc:date>
    </item>
  </channel>
</rss>

