<?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: getting specific percentile rows from data in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350421#M60005</link>
    <description>&lt;P&gt;I may be a little off with my solution.&amp;nbsp; You indicated that you wanted the "top" 25 percentile, and then determined the top 75th by calculating based on the 25th percentile.&amp;nbsp; The code below selects the rows from the Males and Females that are in the top 25th percentile of the data&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt &amp;lt;&amp;lt; select where( :height &amp;gt;= Col Quantile( :height, .75, :sex ) );

dtTop = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), selected columns( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 17 Jan 2021 03:37:20 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-01-17T03:37:20Z</dc:date>
    <item>
      <title>getting specific percentile rows from data</title>
      <link>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350402#M60004</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to figure it out how get top 25th percentile of row values from data. basically subset the original data with top 25th percentile of values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried this ;&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" );

top_25th_perc = dt  &amp;lt;&amp;lt; Summary(
			Group( :sex),
            Quantile( :height, .25 ),
			Freq( "None" ),
			Weight( "None" ),
			Link to original data table( 1 ),
			output table name( "top_25th_perc" )
		);&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which yields this table below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joshua_0-1610849174124.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29504i735B6F577CF40F83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joshua_0-1610849174124.png" alt="joshua_0-1610849174124.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I need is that a subset of dt with only 25th percentile rows of both groups.&lt;/P&gt;&lt;P&gt;How to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the following question how can we sample of those 25th percentile and say get some sample from that distribution. Again summary data table what I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:24:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350402#M60004</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2023-06-10T23:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: getting specific percentile rows from data</title>
      <link>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350421#M60005</link>
      <description>&lt;P&gt;I may be a little off with my solution.&amp;nbsp; You indicated that you wanted the "top" 25 percentile, and then determined the top 75th by calculating based on the 25th percentile.&amp;nbsp; The code below selects the rows from the Males and Females that are in the top 25th percentile of the data&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt &amp;lt;&amp;lt; select where( :height &amp;gt;= Col Quantile( :height, .75, :sex ) );

dtTop = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), selected columns( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jan 2021 03:37:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350421#M60005</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-01-17T03:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: getting specific percentile rows from data</title>
      <link>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350422#M60006</link>
      <description>&lt;P&gt;This is working great Thanks TXnelson!&lt;/P&gt;&lt;P&gt;is there a way to sample that 25th percentile data before moving the final data set ?&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2021 08:29:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350422#M60006</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2021-01-17T08:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: getting specific percentile rows from data</title>
      <link>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350444#M60008</link>
      <description>&lt;P&gt;Here is how I would sample from the top 25%&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

top25pRows = dt &amp;lt;&amp;lt; get rows where( :NPN1 &amp;gt;= Col Quantile( :NPN1, .75, :site ) );

dt &amp;lt;&amp;lt; clear selected row states;

// create a 5% of the top 25 percentile data

// Select 5% of the top 25 percentile rows
For(i=1,i&amp;lt;=nrows(top25pRows),i++,
	If(random uniform(0,1)&amp;lt;=.05,rowstate(top25pRows[i])=selected state(1));
);

// Create the output data table
dtTop = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), selected columns( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jan 2021 13:57:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-specific-percentile-rows-from-data/m-p/350444#M60008</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-01-17T13:57:58Z</dc:date>
    </item>
  </channel>
</rss>

