<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhamad Risman on Medium]]></title>
        <description><![CDATA[Stories by Muhamad Risman on Medium]]></description>
        <link>https://medium.com/@muhrisman_stat?source=rss-1f6446e9b523------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*uZuQphxCls07-DFU</url>
            <title>Stories by Muhamad Risman on Medium</title>
            <link>https://medium.com/@muhrisman_stat?source=rss-1f6446e9b523------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:31:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhrisman_stat/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introduction to Outlier: What Is That and How to Detect It?]]></title>
            <link>https://medium.com/@muhrisman_stat/introduction-to-outlier-what-is-that-and-how-to-detect-it-3a85635c939b?source=rss-1f6446e9b523------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a85635c939b</guid>
            <category><![CDATA[outliers]]></category>
            <category><![CDATA[r-programming]]></category>
            <category><![CDATA[outlier-detection]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Muhamad Risman]]></dc:creator>
            <pubDate>Fri, 03 Jun 2022 14:45:45 GMT</pubDate>
            <atom:updated>2022-06-03T14:56:16.364Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is an Outlier?</strong></p><p>Outlier is observations that do not follow the same pattern compared to the rest of the data. For example, a boy with a 100 score for his math test while his friends mainly got around 30 is the outlier. The score achieved by the boy is considered an outlier since the pattern of the data here is 30. An a-10-years old girl with an IQ of 170 while his classmates’ IQ is around 100 is also an outlier since most of the information in that situation tells us that the “normal” number is 100.</p><p>There are two types of an outlier, point outlier, and collective outlier. Point outlier is a single data point that is unusual compared to the rest of the data, while a collective outlier is more than a 1-point outlier than the rest of the data. Instances of point outlier have been introduced earlier, and it can be visualized with a graphical summary, the boxplot.</p><p>For example, there are 101 students attending math tests with the following result. Here, I will use R programming language, you can also recreate this code in your R Studio.</p><pre>math_test &lt;- c(rnorm(100, mean=30, sd=4),100)</pre><pre>boxplot(math_test,<br>main = &quot;Math Test Score&quot;,<br>col = &quot;orange&quot;,<br>border = &quot;brown&quot;,<br>horizontal = TRUE,<br>notch = TRUE)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*PEK0HtW1T4_nyADMWZlBWg.jpeg" /></figure><p>The student mostly got 30 for their marks, while one student stunningly got 100.</p><p>An example of a collective outlier can be visualized as follow:</p><pre>math_test2 &lt;- c(rnorm(100, mean=30, sd=4),90,80,93,100)</pre><pre>boxplot(math_test2,<br>main = &quot;Math Test Score&quot;,<br>col = &quot;orange&quot;,<br>border = &quot;brown&quot;,<br>horizontal = TRUE,<br>notch = TRUE)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*dRzYUQ1l5Y9I9i8YVxrM7g.jpeg" /></figure><p>Four students achieved stunning scores compared to their classmates. The four students here were considered a collective outlier. The example of a collective outlier can be found in many datasets since the most dataset is contributed with many observations.</p><p><strong>Formal Way To Test Outlier</strong></p><p>Visualization is a great tool to see outlier points. Besides using visualization, we can also use statistical procedures to validate if a data point is an outlier or not. One Test that can handle is Grubbs’ Test. Grubbs’ Test will see the most significant or most minor point in the data by assuming the data are typically distributed. When using Grubb’s Test, the user needs to check the data distribution. One common way to see the data distribution is using the histogram. A typical normal distributed histogram can be seen like this.</p><pre>data_example &lt;- rnorm(10000, mean= 50, sd = 15)</pre><pre>hist(data_example)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*_hsyY7bS2QQIXAw5BprnWQ.jpeg" /></figure><p>With the example of the math score above, we can do Grubbs’ Test from the `outlier` package as follow:</p><pre>library(outliers)<br>grubbs.test(math_test)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C%2B184%252C%2B195%252C%2B1%2529%26t%3Dseti%26wt%3Dnone%26l%3Dr%26width%3D680%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3D%252509Grubbs%252520test%252520for%252520one%252520outlier%25250A%25250Adata%25253A%252520%252520math_test%25250AG%252520%25253D%2525208.54533%25252C%252520U%252520%25253D%2525200.26247%25252C%252520p-value%252520%25253C%2525202.2e-16%25250Aalternative%252520hypothesis%25253A%252520highest%252520value%252520100%252520is%252520an%252520outlier&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C%2B184%25252C%2B195%25252C%2B1%252529%26t%3Dseti%26wt%3Dnone%26l%3Dr%26width%3D680%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3D%25252509Grubbs%25252520test%25252520for%25252520one%25252520outlier%2525250A%2525250Adata%2525253A%25252520%25252520math_test%2525250AG%25252520%2525253D%252525208.54533%2525252C%25252520U%25252520%2525253D%252525200.26247%2525252C%25252520p-value%25252520%2525253C%252525202.2e-16%2525250Aalternative%25252520hypothesis%2525253A%25252520highest%25252520value%25252520100%25252520is%25252520an%25252520outlier&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd89c0f51c96dd662b3fc58b12fdc935/href">https://medium.com/media/bd89c0f51c96dd662b3fc58b12fdc935/href</a></iframe><p>The threshold for p-value is 0.05, and if the p-value is below 0.05, the point is considered an outlier. Grubbs’s Test will produce the hypothesis for either the highest or lowest value in the dataset. Grubbs’s Test indicates that the highest value is an anomaly with a p-value below 0.05. We can also see which row is an outlier by specifying the max or the min of the data; here, we will use max.</p><pre>which.max(math_test)</pre><pre>101</pre><pre>math_test[101]</pre><pre>100</pre><p>Row number 101 is the student with a score of 100, the student that got a far better result than the rest of his classmates.</p><p>Detecting anomaly conditions is crucial to preventing unwanted conditions further. The application of anomaly detection can be used in various industries such as e-commerce or the banking industry. Preventing anomalies or unusual situations from getting bigger will help a company prevent financial loss.</p><p>There are also different methods to detect outliers, such as Local Outlier Factor and Isolation Forest. For the next article, I will write this outlier detection technique.</p><p>If you have any comments or questions, please write them down below!</p><p>Thank you for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a85635c939b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>