<?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: Creating New Rows based on Averages from Previous Rows? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-New-Rows-based-on-Averages-from-Previous-Rows/m-p/644350#M84115</link>
    <description>&lt;P&gt;Are you creating these new rows to same data table? If you are, are these averages used for reporting purposes (JMP datatable isn't a spreadsheet)? Or could these new rows be in a new data table in which case Summary table could work (you could also concatenate it back to the original table). If you want to have them in same table take a look at &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/statistical-functions-2.shtml?os=win&amp;amp;source=application#ww4981217" target="_blank" rel="noopener"&gt;Summarize()&lt;/A&gt; and &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/data-table-messages.shtml?os=win&amp;amp;source=application#ww1902130" target="_blank" rel="noopener"&gt;Add Rows()&lt;/A&gt; besides the Summary table and concatenation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the generalization easiest option is most likely to create new column which would have "common" bucket across the other buckets and you would then use that for grouping.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jun 2023 21:11:11 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-06-20T21:11:11Z</dc:date>
    <item>
      <title>Creating New Rows based on Averages from Previous Rows?</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-New-Rows-based-on-Averages-from-Previous-Rows/m-p/644331#M84113</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Perhaps this is a quick fix, but I have a large data-set in JMP with many categories, one of which is a subgroup that each entry belongs to. I'm looking to take averages of the data collected across the entire subgroup and use it to create a whole new row. Is this possible using scripting? I am hoping for an optimized workflow where all it takes is a button to do this across different files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Bucket&lt;/TD&gt;&lt;TD&gt;Age&lt;/TD&gt;&lt;TD&gt;Height (cm)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A script would provide me with new rows that average stats by buckets 1 and 2:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Bucket&lt;/TD&gt;&lt;TD&gt;Age&lt;/TD&gt;&lt;TD&gt;Height (cm)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1 (Average)&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;95&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2 (Average)&lt;/TD&gt;&lt;TD&gt;37.5&lt;/TD&gt;&lt;TD&gt;135&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is easy enough (and scalable), I am also looking for a way to generalize these averages, i.e average across BOTH buckets 1-2 or from buckets 1-4 instead of just one. Thanks so much&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 20:49:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-New-Rows-based-on-Averages-from-Previous-Rows/m-p/644331#M84113</guid>
      <dc:creator>WebArmadillo869</dc:creator>
      <dc:date>2023-06-20T20:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating New Rows based on Averages from Previous Rows?</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-New-Rows-based-on-Averages-from-Previous-Rows/m-p/644348#M84114</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/48404"&gt;@WebArmadillo869&lt;/a&gt;, welcome to JMP!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that you're thinking of JMP like a spreadsheet, and that's not a good thing. Read &lt;LI-MESSAGE title="JMP is Not a Spreadsheet" uid="214307" url="https://community.jmp.com/t5/Discussions/JMP-is-Not-a-Spreadsheet/m-p/214307#U214307" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;for the reasons you should not think of JMP like that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, for what you're looking for, creating averages for groups, you should use &lt;A href="https://www.jmp.com/support/help/en/17.1/index.shtml#page/jmp/create-a-summary-table.shtml" target="_self"&gt;Tables-&amp;gt;Summary&lt;/A&gt; and you'll get lots of flexibility for summarizing your data into a new table. You can see more about using Summary in&amp;nbsp;&lt;LI-MESSAGE title="Getting Started with JMP: On Demand" uid="621172" url="https://community.jmp.com/t5/Learning-Center/Getting-Started-with-JMP-On-Demand/m-p/621172#U621172" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Alternatively, you can use Analyze-&amp;gt;Tabulate to create a report table with the averages. See more about Tabulate in&amp;nbsp;&lt;LI-MESSAGE title="Creating Summary Tables Using Tabulate" uid="487292" url="https://community.jmp.com/t5/Mastering-JMP/Creating-Summary-Tables-Using-Tabulate/m-p/487292#U487292" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 21:07:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-New-Rows-based-on-Averages-from-Previous-Rows/m-p/644348#M84114</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2023-06-20T21:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating New Rows based on Averages from Previous Rows?</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-New-Rows-based-on-Averages-from-Previous-Rows/m-p/644350#M84115</link>
      <description>&lt;P&gt;Are you creating these new rows to same data table? If you are, are these averages used for reporting purposes (JMP datatable isn't a spreadsheet)? Or could these new rows be in a new data table in which case Summary table could work (you could also concatenate it back to the original table). If you want to have them in same table take a look at &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/statistical-functions-2.shtml?os=win&amp;amp;source=application#ww4981217" target="_blank" rel="noopener"&gt;Summarize()&lt;/A&gt; and &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/data-table-messages.shtml?os=win&amp;amp;source=application#ww1902130" target="_blank" rel="noopener"&gt;Add Rows()&lt;/A&gt; besides the Summary table and concatenation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the generalization easiest option is most likely to create new column which would have "common" bucket across the other buckets and you would then use that for grouping.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 21:11:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-New-Rows-based-on-Averages-from-Previous-Rows/m-p/644350#M84115</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-06-20T21:11:11Z</dc:date>
    </item>
  </channel>
</rss>

