<?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: Detecting outliers in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Detecting-outliers/m-p/715514#M5404</link>
    <description>&lt;P&gt;You might find it easier to use PROC ROBUSTREG as suggested in the Outliers item in the list of &lt;A href="http://support.sas.com/kb/30333" target="_self"&gt;Frequently Asked-for Statistics (FASTats)&lt;/A&gt; in the Important Links section of the Statistical Procedures Community page. Just add a random response variable. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
   set mydata;
   y=ranuni(3);
   run;
proc robustreg data=a method=lts;
   model y = t1-t7 / diagnostics leverage;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 30 Jan 2021 04:48:05 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2021-01-30T04:48:05Z</dc:date>
    <item>
      <title>Detecting outliers</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Detecting-outliers/m-p/715494#M5403</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to apply the code from&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684" target="_blank" rel="noopener"&gt;@Rick_SAS&lt;/A&gt;:&lt;FONT size="3"&gt;"Detecting outliers in SAS: Part 3: Multivariate location and scatter".&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;article,&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2012/02/02/detecting-outliers-in-sas-part-3-multivariate-location-and-scatter/" target="_blank" rel="nofollow noopener noreferrer noopener noreferrer"&gt;&amp;nbsp;Detecting Outliers in SAS: Part 3&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;My data has 7 numerical independent variables. For mydata, The output result from " print outIdx; " is a table with1 row and 21 columns in which each value is the observation's&amp;nbsp;&lt;/FONT&gt;&lt;SPAN style="font-size: medium;"&gt;number&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: medium; font-family: inherit;"&gt;that is outlier ( as I &lt;/SPAN&gt;&lt;SPAN style="font-size: medium; font-family: inherit;"&gt;understood, please guide me if I am wrong!).&lt;/SPAN&gt;&lt;SPAN style="font-size: medium; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;I do not understand t&lt;/FONT&gt;&lt;SPAN style="font-size: medium;"&gt;he number 3 inside bracket at&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: medium; font-family: inherit;"&gt;this part of the code :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;outIdx = loc(dist[&lt;FONT color="#003300"&gt;3&lt;/FONT&gt;,]=0); /* RD &amp;gt; cutoff */&lt;BR /&gt;print outIdx;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;and I do not understand t&lt;SPAN style="font-size: medium;"&gt;he number 8 inside "&lt;CODE class=" language-sas"&gt;optn = j(8,1,.); /* default options for MCD */".&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Appreciate you all to help me understand these concepts.&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
use mydata;
read all var{ T1  T2  T3  T4  T5  T6  T7  } into x ;
/* classical estimates */
labl = {"T1"  "T2"  "T3"  "T4"  "T5"  "T6"  "T7" };
mean = mean(x);
cov = cov(x);
print mean[c=labl format=5.2], cov[r=labl c=labl format=5.2];

N = nrow(x);   /* 60 observations */
p = ncol(x);   /*  7 variables */
 
optn = j(8,1,.); /* default options for MCD */
optn[1] = 0;     /* =1 if you want printed output */
optn[4]= floor(0.75*N); /* h = 75% of obs */
 
call MCD(sc, est, dist, optn, x);
RobustLoc = est[1, ];     /* robust location */
RobustCov = est[3:2+p, ]; /* robust scatter matrix */
print RobustLoc[c=labl format=5.2], RobustCov[r=labl c=labl format=5.2];

outIdx = loc(dist[3,]=0); /* RD &amp;gt; cutoff */
print outIdx;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 00:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Detecting-outliers/m-p/715494#M5403</guid>
      <dc:creator>fatemeh</dc:creator>
      <dc:date>2021-01-30T00:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting outliers</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Detecting-outliers/m-p/715514#M5404</link>
      <description>&lt;P&gt;You might find it easier to use PROC ROBUSTREG as suggested in the Outliers item in the list of &lt;A href="http://support.sas.com/kb/30333" target="_self"&gt;Frequently Asked-for Statistics (FASTats)&lt;/A&gt; in the Important Links section of the Statistical Procedures Community page. Just add a random response variable. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
   set mydata;
   y=ranuni(3);
   run;
proc robustreg data=a method=lts;
   model y = t1-t7 / diagnostics leverage;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jan 2021 04:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Detecting-outliers/m-p/715514#M5404</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-01-30T04:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting outliers</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Detecting-outliers/m-p/715528#M5405</link>
      <description>"I do not understand the number 3 inside bracket at this part of the code :&lt;BR /&gt; outIdx = loc(dist[3,]=0); /* RD &amp;gt; cutoff */&lt;BR /&gt;print outIdx;&lt;BR /&gt;"&lt;BR /&gt;3 stands for the third row. the code get the index of the third row = 0 .&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;"&lt;BR /&gt;and I do not understand the number 8 inside "optn = j(8,1,.); /* default options for MCD */".&lt;BR /&gt;Appreciate you all to help me understand these concepts.   &lt;BR /&gt;"&lt;BR /&gt;The code create a 8*1 matrix ( 8 rows and 1 column), and its initial value are all missing .</description>
      <pubDate>Sat, 30 Jan 2021 11:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Detecting-outliers/m-p/715528#M5405</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-01-30T11:08:47Z</dc:date>
    </item>
  </channel>
</rss>

