<?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: Make a variable from and average of selected rows in a column to use later as a reference line. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48455#M27575</link>
    <description>Thanks for the prompt replay,&lt;BR /&gt;I was able to create a new table with the rows I wanted, but I am not sure how to calculate the MEAN of that column (VALUE) into a variable.&lt;BR /&gt;my_list = {"B"};&lt;BR /&gt;dtsub1 = dtEPData &amp;lt;&amp;lt; subset(&lt;BR /&gt;rows( dtEPData &amp;lt;&amp;lt; get rows where( Contains( my_list, :TYPE ) ) ),&lt;BR /&gt;Selected columns only( 0 ));&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TYPE VALUE&lt;BR /&gt;A 12.5&lt;BR /&gt;B 13.4&lt;BR /&gt;B 17.5&lt;BR /&gt;B 12.8&lt;BR /&gt;A 11.1&lt;BR /&gt;A 19.4&lt;BR /&gt;B 13.8&lt;BR /&gt;&lt;BR /&gt;Dtsub1=&lt;BR /&gt;TYPE VALUE&lt;BR /&gt;B 13.4&lt;BR /&gt;B 17.5&lt;BR /&gt;B 12.8&lt;BR /&gt;B 13.8&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 11 Dec 2017 19:28:09 GMT</pubDate>
    <dc:creator>ileshem</dc:creator>
    <dc:date>2017-12-11T19:28:09Z</dc:date>
    <item>
      <title>Make a variable from and average of selected rows in a column to use later as a reference line.</title>
      <link>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48451#M27573</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want your help with finding an average of selected row in a column and use it as a reference line in a graph.&lt;/P&gt;&lt;P&gt;I have a data table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12.5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;13.4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;17.5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12.8&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;11.1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;19.4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;13.8&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want to make a variable that is an average of all the “B” line values ((13.4+17.5+12.8+13.8)/4) in the example above.&lt;/P&gt;&lt;P&gt;Then I am going to use it as a reference line in a Bivariate graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 18:20:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48451#M27573</guid>
      <dc:creator>ileshem</dc:creator>
      <dc:date>2017-12-11T18:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Make a variable from and average of selected rows in a column to use later as a reference line.</title>
      <link>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48453#M27574</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8850"&gt;@ileshem&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; Once the data table is openend , select random rows . You can do this by :&amp;nbsp;&lt;BR /&gt;Rows &amp;gt; Row Selection &amp;gt; Select Randomly&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

AgeVals = :age &amp;lt;&amp;lt; Get Values ; // Get Values in Age Column 

SR = dt &amp;lt;&amp;lt; Get Selected Rows(); // Get Selected Rows 

RequiredVar = AgeVals[SR,0]; // Desired Values subset from Column Values &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 18:57:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48453#M27574</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-12-11T18:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Make a variable from and average of selected rows in a column to use later as a reference line.</title>
      <link>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48455#M27575</link>
      <description>Thanks for the prompt replay,&lt;BR /&gt;I was able to create a new table with the rows I wanted, but I am not sure how to calculate the MEAN of that column (VALUE) into a variable.&lt;BR /&gt;my_list = {"B"};&lt;BR /&gt;dtsub1 = dtEPData &amp;lt;&amp;lt; subset(&lt;BR /&gt;rows( dtEPData &amp;lt;&amp;lt; get rows where( Contains( my_list, :TYPE ) ) ),&lt;BR /&gt;Selected columns only( 0 ));&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TYPE VALUE&lt;BR /&gt;A 12.5&lt;BR /&gt;B 13.4&lt;BR /&gt;B 17.5&lt;BR /&gt;B 12.8&lt;BR /&gt;A 11.1&lt;BR /&gt;A 19.4&lt;BR /&gt;B 13.8&lt;BR /&gt;&lt;BR /&gt;Dtsub1=&lt;BR /&gt;TYPE VALUE&lt;BR /&gt;B 13.4&lt;BR /&gt;B 17.5&lt;BR /&gt;B 12.8&lt;BR /&gt;B 13.8&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Dec 2017 19:28:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48455#M27575</guid>
      <dc:creator>ileshem</dc:creator>
      <dc:date>2017-12-11T19:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Make a variable from and average of selected rows in a column to use later as a reference line.</title>
      <link>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48456#M27576</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8850"&gt;@ileshem&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;Col Mean() - if you want to use the column&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mean() - if you want to use the matrix or a separate variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt &amp;lt;&amp;lt; Select Randomly( 0.3 );

dt1 = dt &amp;lt;&amp;lt; Subset(Selected Rows( 1 ), selected columns( 0 )); 

Res = Col Mean(dt1:age); 

Show(Res);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Dec 2017 20:23:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48456#M27576</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-12-11T20:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Make a variable from and average of selected rows in a column to use later as a reference line.</title>
      <link>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48480#M27585</link>
      <description>&lt;P&gt;If I am understanding what you want correctly, try creating a new variable using the Col Mean function with your first column as a "By" variable.&amp;nbsp; Then create another column with an IF statement that uses the B mean value for both groups A and B.&amp;nbsp; That column will then all have the same value = mean of the group B values.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 12:27:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Make-a-variable-from-and-average-of-selected-rows-in-a-column-to/m-p/48480#M27585</guid>
      <dc:creator>dale_lehman</dc:creator>
      <dc:date>2017-12-12T12:27:49Z</dc:date>
    </item>
  </channel>
</rss>

