<?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: How do I automatically exclude rows including outliers as identified by the &amp;quot;Explore Outliers&amp;quot; function? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353238#M60260</link>
    <description>&lt;P&gt;Without seeing your code, I can only guess what the issue is.&amp;nbsp; It sounds like, you have added a column into your data table, that contains the columns you want to base you outliers analysis on.&amp;nbsp; If I am guessing correctly, below is a modification to my previous script, that has a new column added to the data table, which contains the columns to be analyzed.&amp;nbsp; The script reads the columns to be analyzed from the column, and then used those column names to limit the columns to be evaluated&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Water Treatment.jmp" );

// Create a new column with the names of the columns to be used
// in the analysis
dt &amp;lt;&amp;lt; New Column( "theColumns",
	character,
	set values(
		{"Q-E", "ZN-E", "PH-E", "DBO-E", "DQO-E", "SS-E", "SSV-E", "SED-E", "COND-E", "PH-P", "DBO-P", "SS-P",
		"SSV-P", "SED-P", "COND-P", "PH-D", "DBO-D", "DQO-D", "SS-D", "SSV-D", "SED-D", "COND-D", "PH-S"}
	)
);

// Get the list of columns from the column that contains
// the columns to be analyzed
colNames = dt:theColumns &amp;lt;&amp;lt; get values;
// Get rid of entries that have blank/null values
For( i = N Items( colNames ), i &amp;gt;= 1, i--,
	If( colNames[i] == "",
		Remove From( colNames, i, 1 )
	)
);

// Run the analysis using the list of column extracted from the
// "theColumns" column
el = Explore Outliers(
	Y( Eval( colNames ) ),
	Quantile Range Outliers, 
	
);
dtQuant = el &amp;lt;&amp;lt; Save Quantile Outlier Limits;
dtQuant &amp;lt;&amp;lt; show window( 0 );
Report( el ) &amp;lt;&amp;lt; close window;

// Get rid of non involved columns
dtQuant &amp;lt;&amp;lt; select where( :Number of Outliers == 0 );
dtQuant &amp;lt;&amp;lt; delete rows;

// Loop through the remaining rows and set the affected rows in the dt table to selected
dt &amp;lt;&amp;lt; clear row states;
For( i = 1, i &amp;lt;= N Rows( dtQuant ), i++,
	dt &amp;lt;&amp;lt; select where(
		As Column( dt, dtQuant:Column[i] ) &amp;lt;= dtQuant:Low Threshold[i] | As Column( dt, dtQuant:Column[i] )
		 &amp;gt;= dtQuant:High Threshold[i],
		current selection( "extend" )
	)
);

// Hide and exclude the rows
dt &amp;lt;&amp;lt; hide and exclude;

// Close the no longer needed data table
Close( dtQuant, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Jan 2021 13:09:00 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-01-27T13:09:00Z</dc:date>
    <item>
      <title>How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351467#M60097</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to replicate what I do manually in JSL script.&lt;/P&gt;&lt;P&gt;I know how to run the "Explore Outliers" function in JSL but I still have to manually select the rows with outliers identified by the "Explore Outliers" then press 'select rows' then press 'exclude'.&lt;/P&gt;&lt;P&gt;I am trying to build a script which I run and automatically excludes the outliers identified without me having to do anything else (ideally does not even open up the Explore Outliers window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone got any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:03:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351467#M60097</guid>
      <dc:creator>JC7</dc:creator>
      <dc:date>2023-06-09T22:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351506#M60099</link>
      <description>Which outlier method are you selecting when you run Explore Outliers?  It appears that different solutions may be required for the different methods.</description>
      <pubDate>Thu, 21 Jan 2021 14:36:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351506#M60099</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-01-21T14:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351507#M60100</link>
      <description>I am using the quantile range outliers method - sorry forgot to say in the original post!</description>
      <pubDate>Thu, 21 Jan 2021 14:42:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351507#M60100</guid>
      <dc:creator>JC7</dc:creator>
      <dc:date>2021-01-21T14:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351508#M60101</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/23673"&gt;@JC7&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Should be pretty easy following something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();

colnames = dt &amp;lt;&amp;lt; Get column Names();

obj = dt &amp;lt;&amp;lt; Explore Missing Values( Y( Eval( colnames ) ) );

obj &amp;lt;&amp;lt; select rows( Eval( colnames ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 14:45:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351508#M60101</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-01-21T14:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351535#M60104</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12549"&gt;@SDF1&lt;/a&gt;&amp;nbsp;the request is for Explore Outliers, not Explore Missing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/23673"&gt;@JC7&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example I worked up that uses the Water Treatment sample data table and Hides and Excludes all rows found for all columns to have been found as outliers.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Water Treatment.jmp" );
el = Explore Outliers(
	Y(
		:Name( "Q-E" ),
		:Name( "ZN-E" ),
		:Name( "PH-E" ),
		:Name( "DBO-E" ),
		:Name( "DQO-E" ),
		:Name( "SS-E" ),
		:Name( "SSV-E" ),
		:Name( "SED-E" ),
		:Name( "COND-E" ),
		:Name( "PH-P" ),
		:Name( "DBO-P" ),
		:Name( "SS-P" ),
		:Name( "SSV-P" ),
		:Name( "SED-P" ),
		:Name( "COND-P" ),
		:Name( "PH-D" ),
		:Name( "DBO-D" ),
		:Name( "DQO-D" ),
		:Name( "SS-D" ),
		:Name( "SSV-D" ),
		:Name( "SED-D" ),
		:Name( "COND-D" ),
		:Name( "PH-S" ),
		:Name( "DBO-S" ),
		:Name( "DQO-S" ),
		:Name( "SS-S" ),
		:Name( "SSV-S" ),
		:Name( "SED-S" ),
		:Name( "COND-S" ),
		:Name( "RD-DBO-P" ),
		:Name( "RD-SS-P" ),
		:Name( "RD-SED-P" ),
		:Name( "RD-DBO-S" ),
		:Name( "RD-DQO-S" ),
		:Name( "RD-DBO-G" ),
		:Name( "RD-DQO-G" ),
		:Name( "RD-SS-G" ),
		:Name( "RD-SED-G" )
	),
	Quantile Range Outliers, 
	
);
dtQuant = el &amp;lt;&amp;lt; Save Quantile Outlier Limits;
dtQuant &amp;lt;&amp;lt; show window( 0 );
Report( el ) &amp;lt;&amp;lt; close window;

// Get rid of non involved columns
dtQuant &amp;lt;&amp;lt; select where( :Number of Outliers == 0 );
dtQuant &amp;lt;&amp;lt; delete rows;

// Loop through the remaining rows and set the affected rows in the dt table to selected
dt &amp;lt;&amp;lt; clear row states;
For( i = 1, i &amp;lt;= N Rows( dtQuant ), i++,
	dt &amp;lt;&amp;lt; select where(
		As Column( dt, dtQuant:Column[i] ) &amp;lt;= dtQuant:Low Threshold[i] | As Column( dt, dtQuant:Column[i] )
		 &amp;gt;= dtQuant:High Threshold[i],
		current selection( "extend" )
	)
);

// Hide and exclude the rows
dt &amp;lt;&amp;lt; hide and exclude;

// Close the no longer needed data table
Close( dtQuant, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jan 2021 15:51:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351535#M60104</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-01-21T15:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351536#M60105</link>
      <description>Yes, you're right, sorry about that oversight on my part.</description>
      <pubDate>Thu, 21 Jan 2021 15:56:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351536#M60105</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-01-21T15:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351537#M60106</link>
      <description>&lt;P&gt;In addition to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;'s reply, you might find something in &lt;A href="https://community.jmp.com/t5/Discussions/Diving-into-Explore-Outliers/m-p/208276" target="_self"&gt;this thread&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 16:03:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/351537#M60106</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2021-01-21T16:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353235#M60258</link>
      <description>Thanks &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt; for the solution.&lt;BR /&gt;&lt;BR /&gt;I have tried to modify it so I can loop the entire code through a list of variables from a column so that I use the Quantile Range Outliers with an additional "where" function.&lt;BR /&gt;&lt;BR /&gt;The loop seems to crash not being able to save quantile outlier limits saying object is not scriptable. Any ideas?</description>
      <pubDate>Wed, 27 Jan 2021 11:41:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353235#M60258</guid>
      <dc:creator>JC7</dc:creator>
      <dc:date>2021-01-27T11:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353238#M60260</link>
      <description>&lt;P&gt;Without seeing your code, I can only guess what the issue is.&amp;nbsp; It sounds like, you have added a column into your data table, that contains the columns you want to base you outliers analysis on.&amp;nbsp; If I am guessing correctly, below is a modification to my previous script, that has a new column added to the data table, which contains the columns to be analyzed.&amp;nbsp; The script reads the columns to be analyzed from the column, and then used those column names to limit the columns to be evaluated&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Water Treatment.jmp" );

// Create a new column with the names of the columns to be used
// in the analysis
dt &amp;lt;&amp;lt; New Column( "theColumns",
	character,
	set values(
		{"Q-E", "ZN-E", "PH-E", "DBO-E", "DQO-E", "SS-E", "SSV-E", "SED-E", "COND-E", "PH-P", "DBO-P", "SS-P",
		"SSV-P", "SED-P", "COND-P", "PH-D", "DBO-D", "DQO-D", "SS-D", "SSV-D", "SED-D", "COND-D", "PH-S"}
	)
);

// Get the list of columns from the column that contains
// the columns to be analyzed
colNames = dt:theColumns &amp;lt;&amp;lt; get values;
// Get rid of entries that have blank/null values
For( i = N Items( colNames ), i &amp;gt;= 1, i--,
	If( colNames[i] == "",
		Remove From( colNames, i, 1 )
	)
);

// Run the analysis using the list of column extracted from the
// "theColumns" column
el = Explore Outliers(
	Y( Eval( colNames ) ),
	Quantile Range Outliers, 
	
);
dtQuant = el &amp;lt;&amp;lt; Save Quantile Outlier Limits;
dtQuant &amp;lt;&amp;lt; show window( 0 );
Report( el ) &amp;lt;&amp;lt; close window;

// Get rid of non involved columns
dtQuant &amp;lt;&amp;lt; select where( :Number of Outliers == 0 );
dtQuant &amp;lt;&amp;lt; delete rows;

// Loop through the remaining rows and set the affected rows in the dt table to selected
dt &amp;lt;&amp;lt; clear row states;
For( i = 1, i &amp;lt;= N Rows( dtQuant ), i++,
	dt &amp;lt;&amp;lt; select where(
		As Column( dt, dtQuant:Column[i] ) &amp;lt;= dtQuant:Low Threshold[i] | As Column( dt, dtQuant:Column[i] )
		 &amp;gt;= dtQuant:High Threshold[i],
		current selection( "extend" )
	)
);

// Hide and exclude the rows
dt &amp;lt;&amp;lt; hide and exclude;

// Close the no longer needed data table
Close( dtQuant, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jan 2021 13:09:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353238#M60260</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-01-27T13:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353572#M60307</link>
      <description>&lt;P&gt;I have broken the code down while I am trying to debug. It seems the issue is that on the second loop it is unable to save the quantile range outlier limits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the log it is saying "&lt;/P&gt;&lt;P&gt;This Where-clause for data table 'Quantile Outlier Limits' resulted in no rows: dt:Grade == grades[j]"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I know each grade on that list has limits and exists. I have checked it by starting at different values of J and it always works on the first loop then crashes on the 2nd loop. I assume it is something to do with the way I am storing the data in the el variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to here(1);
dt = current data table();

// Determine grades to loop through
dt1 = dt &amp;lt;&amp;lt; summary(Group(:Grade));
dt1 &amp;lt;&amp;lt; select where ( :Grade == "");
dt1 &amp;lt;&amp;lt; delete rows;
dt1 &amp;lt;&amp;lt; select where ( :Grade == "Check input");
dt1 &amp;lt;&amp;lt; delete rows; 
grades = dt1:Grade &amp;lt;&amp;lt; get values;
Close (dt1, nosave);

For (j = 3, j&amp;lt;= N items ( grades ), J++,

show(grades[j]);

	el = Explore Outliers(
		Y( dt:Hardness, dt:UTS, dt:M100, dt:Elongation, dt:LCR, dt:Prof, dt:SG ),
		Tail Quantile( 0.25 ),
		Show only columns with outliers( 1 ),
		Quantile Range Outliers,
		Where( dt:Grade == grades[j]);
	);
	show (el);
	dtQuant = el &amp;lt;&amp;lt; Save Quantile Outlier Limits;
	Report(el)&amp;lt;&amp;lt; close window;
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 13:34:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353572#M60307</guid>
      <dc:creator>JC7</dc:creator>
      <dc:date>2021-01-28T13:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automatically exclude rows including outliers as identified by the "Explore Outliers" function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353595#M60309</link>
      <description>&lt;P&gt;You have made a very common error.&amp;nbsp; The first time you run&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;el = Explore Outliers(&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;it is pointing to&amp;nbsp; the "dt" data table. However, by the time you go to run the second time, you have created a new data table "dtQuant", which is not the current data table as far as JMP knows.&amp;nbsp; And of course, it will not find outliers.&amp;nbsp; To fix this, all you need to do, is to force JMP to make sure it is pointing to the correct data table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;el = dt &amp;lt;&amp;lt; Explore Outliers(&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;On another topic, using "j" as a variable name can sometimes run one into issues.&amp;nbsp; JMP has a function called j.&amp;nbsp; Even though you can have a variable called j, it can make reading the code confusing.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 13:54:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-automatically-exclude-rows-including-outliers-as/m-p/353595#M60309</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-01-28T13:54:58Z</dc:date>
    </item>
  </channel>
</rss>

