<?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 Putri Romhadhoni on Medium]]></title>
        <description><![CDATA[Stories by Putri Romhadhoni on Medium]]></description>
        <link>https://medium.com/@putriromhadhoni?source=rss-6342df2ed44a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Putri Romhadhoni on Medium</title>
            <link>https://medium.com/@putriromhadhoni?source=rss-6342df2ed44a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:26:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@putriromhadhoni/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[Exploratory Data Analysis 911 Calls with Python]]></title>
            <link>https://medium.com/@putriromhadhoni/exploratory-data-analysis-911-calls-using-python-8dfd48d1d70c?source=rss-6342df2ed44a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dfd48d1d70c</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Putri Romhadhoni]]></dc:creator>
            <pubDate>Sun, 09 Oct 2022 15:33:49 GMT</pubDate>
            <atom:updated>2022-10-09T15:36:22.260Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Exploratory Data Analysis?</h3><p>Exploratory Data Analysis is a process to analyze data sets for better understanding of the data we faced with the help of Statistics and Data Visualization. EDA can make easier to discover patterns, spot anomalies, test hypothesis, or check assumptions before going to another process such as feature engineering and modeling.</p><p>In this article, I’m gonna show a simple EDA for 911 Calls data that I got from <a href="https://www.kaggle.com/datasets/mchirico/montcoalert">Kaggle</a>.</p><h4><strong>1. Understanding the data</strong></h4><p>This data is about emergency (911) calls in Montgomory County, CA. Montgomery is a borough in Lycoming County, Pennsylvania, United States. The population was 1,570 at the 2020 census.</p><p>This emergency calls including EMS (Emergency Medical Services), Fire, and Traffic.</p><p>Columns existed in this data:</p><ul><li>lat (float): Latitude</li><li>long (float): Longitude</li><li>desc (string): Description of Emergency</li><li>zip (float): Zipcode</li><li>title (string): Title of Emergency</li><li>timestamp (string): Date and time of the call</li><li>twp (string): Township</li><li>addr (string): General Address</li><li>e (int): index column, always 1</li></ul><p>1.1 Data Information</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ro5ViIcz4IcdR7DVutTlWQ.png" /></figure><p>With using syntax .info() from pandas, we can see brief information about the data. The data contains more categorical data than numerical data. We also know the data has 663522 rows and 9 columns. Next, we’ll check whether the data has duplicated values or not and the data has missing values or not.</p><p>1.2 Remove duplicates</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZeQYl6XWq-NLAix0DZFhfg.png" /></figure><p>1.3 Check and fill missing values</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/430364cd3b2d67f1180edbdf29d9555a/href">https://medium.com/media/430364cd3b2d67f1180edbdf29d9555a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gXHlPSvRS0Jw1fJ-f2FXZQ.png" /></figure><p>As you can see, zip and twp have around 13.8% and 0.04% of missing values respectively. Since the number of missing values isn’t really that big — still less than 50%, we have to fill out the missing values. In this case, we fill the missing values with the most common value of that feature.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d3f801ef38816882e3737180e782527/href">https://medium.com/media/1d3f801ef38816882e3737180e782527/href</a></iframe><h4><strong>2. Create New Features</strong></h4><p>For deep dive analysis, sometimes we need to create new features. First feature that we want to create is ‘<em>reason’ </em>extracted from <em>title </em>column. With this new feature, we can easily categorize the calls belongs to what kind of reason, it can be EMS (Emergency Medical Service), traffic, or fire. For example, if the title value is EMS: BACK PAINS/INJURY , the value of <em>reason</em> column would be EMS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V8sPaEGNy0ctY5SmQCNi7w.png" /></figure><p>Next, we want to extract some features from <em>timeStamp </em>column such as Year, Month, Date, Day of Week, and Hour. These features will be used for analysis later.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67d675a512b5a2cce8e914f755296efe/href">https://medium.com/media/67d675a512b5a2cce8e914f755296efe/href</a></iframe><h4>3. Analysis</h4><p>There are three types of Exploratory Data Analysis:</p><ul><li>Univariate analysis: analyzing data using one variable, this is the simplest form of analyzing data.</li><li>Bivariate analysis: analyzing data using two variables to study relationship between those two variables.</li><li>Multivariate analysis: same with bivariate analysis, but using more than two variables to study their relationship.</li></ul><p>The analysis of 911 calls data derived from my curiosity about the data and trying to find out from this data. It would be nice if you have other ideas and we can sharing about each other ideas.</p><ol><li>Univariate Analysis</li></ol><p><strong>TimeStamp</strong></p><p>How’s the trend number of calls by year, month, day of week, date, and hour?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56240b79a7dac97952c37e3bedc89737/href">https://medium.com/media/56240b79a7dac97952c37e3bedc89737/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9NnfYXhP5E9zL7pz985kg.png" /></figure><ul><li><strong>Monthly</strong>: Number of calls increased at the end of the year (Oct, Nov, Dec) until the beginning of the year (Jan). But the number of calls also increased in March, this will be detected later.</li><li><strong>Day of Week: </strong>Number of calls was high on weekdays, especially on Friday.</li><li><strong>Hour</strong>: Number of calls was high at work hours and getting higher at the afternoon around 3 PM until 5 PM.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e599f253d1375f6e889083b080e4970f/href">https://medium.com/media/e599f253d1375f6e889083b080e4970f/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C383TsvdJJMR_CJdLIVzoA.png" /></figure><p><strong>Year: </strong>2018 became the top year with the highest number of calls. It was because on March 2, 2018 the number of calls was very high. Depending on the news on March 2, 2018 there was winter storm in Pennsylvania.</p><p><strong>Township</strong></p><p>What is the top townships/zip codes based on number of calls?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c157656c8235e0662df85aac1f9ca4e/href">https://medium.com/media/2c157656c8235e0662df85aac1f9ca4e/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qhd7iiUZfQfKAV2GzgA1sg.png" /><figcaption>Top 10 townships and zip codes</figcaption></figure><p>Zip codes actually wasn’t really that representative, considering that feature has around 13% of missing values. For the detail which townships with highest number of calls, we can visualize the <em>description </em>column using WordCloud.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8425c1c0a38d7a2674f304fad03d350/href">https://medium.com/media/b8425c1c0a38d7a2674f304fad03d350/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQGERxFLq7qqHXghZlvULA.png" /><figcaption>WordCloud for Description column</figcaption></figure><p>The WordCloud above seems related to the top 10 townships chart. Lower Merion, Abington, Norristown which are the top 3 townships often appeared in <em>desc </em>column.</p><p><strong>Reason</strong></p><p>What is the most common reason for a 911 call?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8aa36d4971426674a32ff1b35411ad9/href">https://medium.com/media/a8aa36d4971426674a32ff1b35411ad9/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ahIgLU9fPDHTq-Qd6q64w.png" /></figure><p>The most common reason for 911 call goes to EMS, and the second place was Traffic. For the detail reason, we can visualize the <em>title </em>column using WordCloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p86L920S_-hDAAxbD8P_wg.png" /><figcaption>WordCloud for Title column</figcaption></figure><p>We can see the WordCloud above that Vehicle Accident, Disabled Vehicle, Fire often appeared in title column. Moreover, there are EMS Cardiac, Road Obstruction, EMS respiratory, etc for the detail description of 911 call. This information can be used for further analysis, for example we want to know detail where is the most often EMS cardiac happened or else.</p><p>2. Bivariate Analysis</p><p><strong>Timestamp vs Reason</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4kShctU2JoqaS78AYd9Yw.png" /></figure><p>EMS still became the most common reason in each day of week. How about we look at each hour?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gr6HdCOsAWWxp7rByutxPw.png" /></figure><p>We can see from the graph that <em>Traffic</em> became the highest reason of 911 call at 3 PM, 4 PM, and 5 PM.</p><p><strong>Hour vs Day of Week</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7122107eac6ebc64b4ab8cad31ffd99e/href">https://medium.com/media/7122107eac6ebc64b4ab8cad31ffd99e/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOZGXN3orETMcGUgkK5drQ.png" /></figure><p>From the HeatMap chart, we can see there was a little difference between weekdays and weekend. In weekdays, number of calls was high at 3 PM till 5 PM, besides in weekend number of calls was high at around 11 AM until 2 PM.</p><p>3. Deep Analysis for Top Values</p><p><strong>Analysis for top 3 townships which are LOWER MERION, ABINGTON, NORRISTOWN</strong></p><p>When is the most frequent time for a 911 call likely to happen?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca71ea28e7b35a248e44653290abd9f0/href">https://medium.com/media/ca71ea28e7b35a248e44653290abd9f0/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ush4NntguK3qt6pjW9SHFQ.png" /></figure><ul><li>It seems the trend was quite similar to the previous analysis which has high number of calls in the end of the year, on weekdays, and at work hours.</li></ul><p>What is the most common reason in top 3 townships?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-uFAVppywUxxARDcF2fIQ.png" /></figure><ul><li>In Norristown, EMS became the most common reason. We clearly see that the number of calls with the reason of EMS was really high from the others.</li><li>In Lower Merion, Traffic became the most common reason instead of EMS.</li><li>In Abington, EMS became the most common reason with <em>Traffic </em>in the second place.</li></ul><p><strong>Analysis for the top 3 most frequent word appears in title -&gt; Vehicle accident, disabled vehicle, and fire</strong></p><ol><li>Vehicle Accident</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XI8uUIpmYLdSS9vcbYpxdA.png" /></figure><p>Lower Merion became the township with highest case of vehicle accident. Next, when is the most frequent time for this case happened?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c762cafe1eb3e58376e9e18dee111e6/href">https://medium.com/media/8c762cafe1eb3e58376e9e18dee111e6/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fXkkhWcsmiM1n-cRHSa0LQ.png" /></figure><ul><li>Friday became the day with highest number of calls because of vehicle accident.</li><li>Vehicle accident was likely to happen at 3 PM to 5 PM.</li></ul><p>2. Disabled Vehicle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PgUi7HE8b6Sy1zRs3Hy1FA.png" /></figure><p>Similar with the previous one, Lower Merion became the township with highest case of disabled vehicle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*565GXcf8ldswXTXeAJeJlA.png" /></figure><ul><li>Thursday became the day with highest number of calls because of disabled vehicle.</li><li>Traffic disruption due to Disabled Vehicled on the road was likely to happen at 3 PM to 5 PM.</li></ul><p>3. Fire</p><p>Top 10 townships</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jnE_eBFcme6lZnDnf6ZO0Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qNP4Mwqi8ieTmQu006KSmQ.png" /></figure><ul><li>Number of calls because of fire was getting higher at work hours starting at 7 AM until 5 PM.</li></ul><p><strong>Analysis for March 2, 2018 -&gt; date with highest number of calls</strong></p><p>The number of 911 calls was very high on March 2, 2018. Based on the news I read, there was a winter storm on that day, it might be the cause. First, I wonder what is the common reason of 911 call on that day?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SGcup8eNeacrIH54u0gMNw.png" /></figure><p>As we might expect that the common reason of the chaotic on that day was because of traffic impacted by winter storm.</p><p>What is the most impacted township on that day?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jYXucG2nfhvUZtojZvEZNQ.png" /></figure><p>Abington became most impacted township on that day with Lower Merion in the second place.</p><p>That’s all about a simple EDA using Python. Feel free to discuss if you guys have another insight and open for any feedback as well. You can visit my repository on my <a href="https://github.com/putriromhadhoni98/EDA-911-Calls-Data">GitHub</a> for the detailed code.</p><p>Thank you and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dfd48d1d70c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Confidence Interval and Its Calculation]]></title>
            <link>https://medium.com/@putriromhadhoni/confidence-interval-and-its-calculation-66fa23ea32d0?source=rss-6342df2ed44a------2</link>
            <guid isPermaLink="false">https://medium.com/p/66fa23ea32d0</guid>
            <category><![CDATA[confidence-interval]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Putri Romhadhoni]]></dc:creator>
            <pubDate>Wed, 29 Jun 2022 16:13:55 GMT</pubDate>
            <atom:updated>2022-06-29T16:13:55.281Z</atom:updated>
            <content:encoded><![CDATA[<p>Last week, I started to re-learn about Statistics. It started from learning about Confidence Interval which is one of the basic statistics that we should learn about since it is often used in many cases. I’ll try to summarize what I learned about this topic.</p><p>Starting from the question <strong>WHAT ARE CONFIDENCE INTERVALS?</strong></p><p>Confidence interval is a range of values that likely include value of the population parameter. In statistical case, it’s very common to hear about 95% CI –<em>CI stands for Confidence Interval</em>, but what is that mean of 95% CI?</p><p>A 95% CI means that you are 95% confident that the true population parameter would fall into the specified interval and there’s only 5% chance that the population parameter would fall outside the range. Is that possible of having 100% CI? The answer is that you can never be 100% confident unless you go through the entire population.</p><p>There are two main situations when we calculate the confidence interval for population: when the variance of population is known and when it is unknown. Both situations have a different calculation method since it depends on the situation. Okay, let’s go through it one by one!</p><ol><li><strong>Confidence Interval: when the population variance is known</strong></li></ol><p>An important assumption in this calculation is that the population is normally distributed. Even if it is not, we can use a large sample considering of Central Limit Theorem which said if you work with a large sample, you can assume normality of sample means.</p><blockquote>Central Limit Theorem: The distribution of a mean of sample values is approximately normal, whatever the distribution of the values used to calculate the mean, and grows closer to normal as the sample size increases. (<a href="https://www.sciencedirect.com/science/article/pii/B9780120887705500514">Statistics in Medicine (Second Edition), 2006</a>)</blockquote><p>The formula to estimate the population mean when the population variance is known is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n3yihEhaPmcrhy7Roy3YPQ.png" /></figure><p>x̄ is the sample mean, σ / √ (n) is standard error (SE) which σ itself is the standard deviation of population, and <em>z</em> is the z-score that depends on confidence level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*0jbkE9IJDHt8f2B6FBCh-g.png" /><figcaption>source: <a href="https://courses.lumenlearning.com/suny-natural-resources-biometrics/chapter/chapter-2-sampling-distributions-and-confidence-intervals/">link</a></figcaption></figure><p>Here is the example for better understanding about this topic.</p><p>Let’s say you want to become a Data Scientist and you want to know how much the salary of a Data Scientist in your country. You have certain information related to it which is as follows:</p><ul><li>You know that the population standard deviation is equal to $15000</li><li>You have 30 samples of data and normally distributed</li></ul><p>Since we know the population standard deviation, we can estimate how much the Salary of a Data Scientist by using the formula above. Here is the calculation attached in the picture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qdn4hOhiGcgD8HQjSPGdaw.png" /></figure><p>From the result, we can infer that with 95% of Confidence Interval the mean of salaries of a Data Scientist is between $94833 and $105568.</p><p>2. <strong>Confidence Interval: when the population variance is unknown</strong></p><p>The calculation method that can be used when the population variance is unknown is Student’s T Distribution. The Student’s T Distribution is one of the biggest breakthroughs in statistics which allowed inference through small samples with unknown population variance.</p><p>The formula to estimate the population mean when the population variance is unknown is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TmiWLQZEMmiWFRPU6IzeYg.png" /></figure><p>x̄ is the sample mean, <em>s</em>/ √ (n) is standard error (SE) which <em>s</em> itself is the standard deviation of sample, and <em>t</em> is the t-score that can be seen in t-table.</p><p>This is how to look up for t-score:</p><p>For example we have 10 samples and we set the confidence interval is 95%, then we have to look up in the table for t(9,0.025) which the t-score is 2.262</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*E2kCkA0WLuLVaIiuggd_5A.png" /><figcaption>t-table</figcaption></figure><p>Here is the example of Confidence Interval calculation for this topic.</p><p>The case will be the same with the previous example. But, in this case the population variance is unknown and the sample is small yet normally distributed.</p><p>From the problem description above, the appropriate statistic to use for this case is t-statistic. Let’s set the confidence interval to 95% and here is the calculation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swmpAVlu9xnRZUniUslzxA.png" /></figure><p>From the result, we can infer that with 95% of Confidence Interval the mean of salaries of a Data Scientist is between $81820 and $103247.</p><p>Okay, we have learned how to calculate the confidence intervals in two situations — when the population variance is known and it is unknown. But, it is just one population considered, for next lesson I’ll share how to calculate the confidence intervals for two populations.</p><p>In some cases, the samples taken from two populations can be dependent on each other or they can be independent.</p><ol><li><strong>Dependent Samples</strong></li></ol><p>Dependent samples can occur in several situations. It can be about before &amp; after, and cause &amp; effect as well. For example, a teacher have applied a new learning method to increase the grade of the students, then the teacher want to see the effect of the method. What the teacher can do is take a sample of several students and monitor their grade before and after the teacher applying the method. Thus, the two dependent samples are the grade before the teacher applying the method and the grade after the teacher applying the method.</p><p>Confidence interval for difference of two means, dependent samples formula is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rkDcUVIhHAXgohOeTniBbA.png" /></figure><p>It is similar with the formula of estimating the population mean when the population variance is unknown, but in this case we use the difference of two samples as the sample itself.</p><p>Here is the example for better understanding:</p><p>The 365 gym has developed a diet program for losing weight. You are interested in how much weight are you likely to lose. In this case, you have a sample of 15 people who have completed the 12-week program.</p><p>Let’s set the confidence interval to 95% and here is the calculation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MVLXLRl7qg0RsTJT2k-5cw.png" /></figure><p>So, based on the result of a sample of 15 people who have completed the 12-week program, we are 95% confident that the average body weight that will lose by joining the 365 diet program is between 6,92kg and 16,68kg.</p><p><strong>2. Independent Samples</strong></p><p>There are three sub-cases in independent samples:</p><p><strong>Confidence Intervals: Known Population Variance</strong></p><p>Confidence Intervals formula for this case is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MezPxmvl_WPWHOOpF6xD-Q.png" /></figure><p>Here is the example for better understanding:</p><p>The manager of Z company would like to test the selling product performance in 2 branch stores that run under the Z company. The selling performance in this company expressed in percentages. The sample for this case is store A and store B. Here is the summarize of the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*4-Py7_M_S-97ysKU6xJkVg.png" /></figure><p>How could we know that the two samples are independent? such a great question. Those two stores have different locations, different product categories, and different workers, so the selling product performance of store A has no effect on the selling product performance of store B. For that reason, we can conclude that the two samples are independent.</p><p>Since the population is normally distributed, the variance of population is known, and the sample size is different, we can use the formula above to calculate the difference between the selling product performance in Store A and Store B. Let’s set the CI to 95% and here is the calculation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFhT_WekmepLlUzMbCcgKg.png" /></figure><p>Takeaways:</p><ul><li>From the result, we are 95% confident that the true mean difference between Store A and Store B selling product performance falls into the interval between -9,72 and -4,28.</li><li>As we know the whole interval is negative, we can infer that the Store A has a lower selling product performance.</li></ul><p><strong>Confidence Intervals: Population variance unknown but assumed to be equal</strong></p><p>In this case, we use pooled variance which the formula is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMK2r4T0VbipGlUmE5qlqQ.png" /></figure><p>which <em>n </em>is the number of data and <em>s </em>is the standard deviation, whereas <em>x </em>and <em>y </em>is index for each sample.</p><p>Confidence Intervals formula for this case is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bsvtt2d8O7pGOytydq9W0w.png" /></figure><p>Here is the example for better understanding</p><p>Let’s say you are trying to calculate the difference between the price of 1 kg of egg in Jakarta and Yogyakarta. You go to 12 different shops in Jakarta, and your friend who lives in Yogyakarta go to 10 different shops in Yogyakarta. Then, this is the data that you and your friend had gathered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*Hv7IN9NBtAXexbDA7yx9MQ.png" /></figure><p>In this case, you don’t know the population variance of 1 kg of egg price in Jakarta or Yogyakarta is, but you assume that it should be the same for Jakarta and Yogyakarta. Since the population variance assumed to be equal, we can use the formula above to calculate the difference between the 1 kg of egg price in Jakarta and Yogyakarta. Let’s set the CI to 95% and here is the calculation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFoUWd0EZCYLZd7pQESLwQ.png" /></figure><p>So, we are 95% confident the actual difference between the price of 1 kg of egg in Jakarta and Yogyakarta is somewhere between Rp 62,35 and 6.838,12. In addition, 1 kg of egg in Jakarta is more expensive than in Yogyakarta.</p><p><strong>Confidence Intervals: Population variance unknown but assumed to be different</strong></p><p>Confidence Intervals formula for this case is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3mI_eUNGhsilhFVAC2hiQ.png" /></figure><p>That’s all about Confidence Intervals that I have learned. I hope this can be useful to all of you guys. Happy learning!</p><p>Thank you and open for any feedback.</p><p>References:</p><ul><li>365Data Science: The Business Intelligence Analyst Course 2022</li><li><a href="https://courses.lumenlearning.com/suny-natural-resources-biometrics/chapter/chapter-2-sampling-distributions-and-confidence-intervals/">https://courses.lumenlearning.com/suny-natural-resources-biometrics/chapter/chapter-2-sampling-distributions-and-confidence-intervals/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66fa23ea32d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gender vs Math Analysis (using Student Performance Dataset UCI)]]></title>
            <link>https://medium.com/@putriromhadhoni/gender-vs-math-analysis-using-student-performance-dataset-uci-189170e35ab4?source=rss-6342df2ed44a------2</link>
            <guid isPermaLink="false">https://medium.com/p/189170e35ab4</guid>
            <category><![CDATA[bayes-theorem]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[analisis]]></category>
            <dc:creator><![CDATA[Putri Romhadhoni]]></dc:creator>
            <pubDate>Fri, 04 Feb 2022 17:05:09 GMT</pubDate>
            <atom:updated>2022-02-05T04:32:11.269Z</atom:updated>
            <content:encoded><![CDATA[<p>Saat kuliah S1, saya sempat menjadi <em>invited speaker </em>dalam acara perayaan <em>Women in Mathematics </em>tepatnya pada tanggal 13 Mei 2019. Pada saat itu, saya membawakan materi yang berjudul <em>Challenges and Opportunites of Female Indonesian Student in Math. Honestly</em>, materi ini menarik dan saya cukup banyak membaca artikel terkait topik ini. Berikut beberapa tradisional teori terkait <em>Gender Role in Mathematics </em>dari artikel yang saya baca:</p><ul><li>Stereotype; common perception of mathematics as a male domain (Graddol&amp;Swann, 1990;Thomas&amp;Wareing, 1999)</li><li>Girls poorer mathematics in class and more negative attitudes towards mathematics are as the result of societal gender stratification (Baker&amp;Jones, 1993)</li><li>It was observed that girls scored lower than boys on standardized test where it included knowledge abilities in mathematics (Kaufman, 2005)</li><li>Girls operate within entity theory to mathematics. They believe that the ability to do mathematics is inherent and unchangeable and they are conditioned to think that they lack this innate aptitude. Boys, on the other hand, believe that skills in mathematics can be learned and improved through hard work (Zuse&amp;Lee, 2008)</li></ul><p>Kalau dilihat dari beberapa poin di atas, perempuan dipandang lebih rendah dalam hal kemampuan matematika. Banyak stereotipe bahwa matematika itu lebih pantas didominasi oleh kaum pria dan wanita <em>not good enough in math</em>, hal inilah yang membuat seorang wanita harus <em>prove them wrong </em>terkait kemampuan intelektual dalam bidang matematika. Namun, jika dilihat sekarang sudah banyak wanita yang berpartisipasi dalam perlombaan matematika seperti pada Olimpiade Nasional yang diadakan setiap tahun baik jenjang sekolah maupun Perguruan Tinggi, bahkan beberapa medali dimenangkan oleh wanita. Saat saya mengikuti beberapa perlombaan matematika pun, saya melihat bahwa partisipasi dari kaum wanita cukup lumayan walau masih lebih banyak laki-laki dibanding wanita.</p><p>Dari cerita singkat di atas, saya penasaran untuk mengulik dataset Student Performance dari repository dataset UCI. Berikut link untuk datasetnya:</p><p><a href="https://archive.ics.uci.edu/ml/datasets/student+performance">https://archive.ics.uci.edu/ml/datasets/student+performance</a></p><p>Gambaran isi dari dataset tersebut yaitu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ISCpZSInfWlGGTWCKWl3sg.png" /><figcaption>Student Performance Dataset</figcaption></figure><p>Secara singkat, dataset ini berisi <em>student grade</em> dalam pelajaran matematika di dua <em>Portuguese schools </em>dengan beberapa <em>features</em> seperti <em>gender</em>, keluarga, umur, kesehatan, dsb. Namun, saya hanya ingin fokus pada gender dan grade dari siswa sehingga saya akan <em>filter </em>dataset tersebut menjadi dataset yang hanya berisi kolom sex dan grade. Dalam analisis ini, <em>grade </em>yang saya gunakan yaitu kolom G3 yang mana merupakan <em>final grade.</em></p><p>Dari dataset ini, ada satu pertanyaan terkait dengan <em>gender</em> &amp; <em>math</em> yang membuat saya penasaran dan juga mendasari saya untuk melakukan analisis dari data ini, pertanyaan itu ialah:</p><blockquote>Jika secara random dipilih seorang siswa dan siswa yang terpilih itu perempuan, berapakah probabilitas siswa tersebut mendapatkan nilai matematika (final grade) bagus?</blockquote><p>Okay, <em>let’s jump in to the dataset</em>. Pertama, berikut merupakan <em>a little overview</em> dari variabel grade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*TDcQomcPVd1kOKq9OJwWEQ.png" /><figcaption>Descriptive Statistics of Grade Variable</figcaption></figure><p>G1 merupakan <em>first period grade, </em>G2 merupakan <em>second period grade</em>, dan G3 merupakan <em>final grade</em>. G3 ini variabel yang akan digunakan untuk analisis nantinya. Rentang nilai untuk ketiga variabel grade yaitu 0 sampai 20. Kemudian jika dilihat ketiga grade di atas memiliki nilai tengah atau median yang sama yaitu 11. Nilai tengah ini nantinya akan digunakan untuk pengelompokan. Kemudian, berikut <em>pie chart </em>yang menunjukan komposisi jumlah siswa laki-laki dan perempuan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*ZwDk8PfT70TBV62fYNYXVg.png" /><figcaption>Pie Chart of Student Gender</figcaption></figure><p>Dilihat dari <em>pie chart </em>di atas bahwa siswa perempuan lebih banyak daripada siswa laki-laki. Oke, berikutnya kita lihat bagaimana gambaran perbedaan <em>grade</em> di antara kedua gender tersebut. Di sini saya menggunakan distribution plot juga perhitungan min, max, mean, dan median untuk melihat gambaran <em>final</em> <em>grade</em> dari kedua gender.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*0anTBRAzhYNHtDgE_R6ekw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*FFuZcdKHxeD9A_ZMXw1uxg.png" /></figure><p>Jika dilihat dari displot di atas, tampak bahwa density siswa laki-laki mendapatkan nilai tinggi lebih tinggi daripada density siswa perempuan (garis warna orange lebih tinggi di sekitar <em>grade </em>11 ke atas). Kemudian jika dilihat dari tabel, median dari siswa laki-laki lebih tinggi dari siswa perempuan. Dari dua hal ini, terlihat bahwa ada kecenderungan bahwa nilai tinggi banyak diraih oleh siswa laki-laki.</p><p>Tahap selanjutnya, saya mencoba untuk mengelompokan siswa menjadi dua kelompok di mana dasar pengelompokan menggunakan nilai tengah dari <em>final grade</em>. Kelompok pertama yaitu <em>good in math </em>yang berisi kelompok siswa yang mendapatkan <em>final grade </em>lebih atau sama dengan 11. Sedangkan, kelompok kedua yaitu <em>bad in math </em>yang berisi kelompok siswa yang mendapatkan <em>final grade</em> kurang dari 11. Berikut gambaran dari hasil pengelompokan yang kemudian saya <em>breakdown</em> berdasarkan gender.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*hwhD1NCb5Ucm_P4dI2EmEQ.png" /></figure><p>Selisih jumlah laki-laki dan perempuan untuk kelompok <em>good in math</em> tidak terlalu signifikan, namun tetap saja jumlah laki-laki lebih banyak dibanding dengan perempuan di kelompok ini. Untuk detail jumlah laki-laki dan perempuan di setiap kelompok ada pada tabel di bawah ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*cui_o9jIQSG6tdvXPmMGHg.png" /></figure><p>Setelah selesai melakukan pengelompokan, saya mulai untuk menghitung probabilitas untuk menjawab pertanyaan yang telah di mention sebelumnya.</p><p>Okay, mari mulai dengan menghitung berapakah probabilitas siswa mendapatkan <em>final grade </em>lebih dari atau sama dengan 11? Pertanyaan ini dapat dengan mudah dijawab dengan melihat tabel pengelompokan di atas. Bisa dilihat bahwa jumlah siswa dalam kelompok <em>good </em>sebanyak 106 siswa laki-laki dan 103 siswa perempuan, sehingga jika dijumlahkan terdapat 209 siswa yang masuk ke dalam kelompok <em>good. </em>Total dari seluruh siswa yang ada yaitu 395. Jadi, probabilitas siswa mendapatkan <em>final grade </em>lebih dari atau sama dengan 11 yaitu:</p><p>P(<em>final grade </em>≥ 11) = 209/395 ~ 0,53</p><p>Selanjutnya, saya menggunakan <em>bayes theorem </em>untuk menghitung probabilitas siswa mendapat nilai bagus jika siswa terpilih secara random itu siswa perempuan. Indikator untuk menentukan nilai siswa bagus atau tidak berdasarkan kelompok yang telah didefinisikan sebelumnya, sehingga nilai masuk dalam kategori bagus jika masuk ke dalam kelompok <em>good in math </em>(final grade ≥ 11), jika kurang dari 11 maka nilai masuk ke dalam kategori jelek.</p><blockquote>Bayes theorem<em> merupakan suatu cara untuk menghitung</em> conditional probability<em>. </em>Conditional Probability<em> itu sendiri merupakan probabilitas terjadinya suatu peristiwa di mana ia memiliki hubungan atau keterkaitan dengan peristiwa lain.</em></blockquote><p>Definisi di atas membuat <em>Bayes Theorem </em>merupakan cara yang tepat untuk menghitung probabilitas untuk <em>case </em>yang ada. Formula untuk menghitung <em>case </em>yang ada yaitu:</p><p>P(Good | Female) = P(Female | Good) * P(Good) / P(Female)</p><ul><li>Dari tabel pengelompokan di atas, dapat dilihat bahwa di antara 209 siswa yang masuk ke dalam kelompok <em>good in math, </em>103 nya merupakan siswa perempuan. Sehingga, P(Female | Good) = 103/209 ~ 0,49.</li><li>Probabilitas siswa mendapatkan <em>final grade ≥ </em>11 yang mana masuk ke dalam kelompok <em>good in math</em> yaitu 0,53.</li><li>P(Female) dapat dengan mudah dihitung dengan adanya informasi bahwa terdapat 208 siswa perempuan dari 395 total seluruh siswa. Sehingga dapat diperoleh bahwa P(Female) = 208/395 ~ 0,53</li></ul><p>Dari beberapa poin di atas, maka probabilitas siswa mendapat nilai bagus/masuk ke dalam kelompok <em>good in math </em>jika siswa yang terpilih secara random itu siswa perempuan, yaitu:</p><p>P(Good | Female) = ((103/209) * (209/395))/ (208/395) ~ 0,5</p><p>Jadi, jika dipilih siswa secara random dan siswa yang terpilih itu perempuan, maka probabilitas dia mendapatkan <em>final grade</em> bagus yaitu sekitar 50%.</p><p><em>How about male student?</em></p><p>Setelah saya hitung menggunakan cara yang sama, diperoleh hasil seperti ini:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*vHqtAg27m3Q8yZTWGWsuBQ.png" /></figure><p>Dengan demikian, probabilitas untuk <em>male student </em>lebih besar dibanding <em>female student.</em></p><p>Kesimpulan:</p><p>Dengan menggunakan sebuah <em>sample </em>dataset yang mana merupakan record nilai matematika di dua <em>Portuguese schools, </em>dapat disimpulkan bahwa siswa dengan gender laki-laki lebih unggul dibandingkan dengan siswa dengan gender perempuan dalam pelajaran matematika. Ini tampak sesuai dengan <em>background story </em>yang sempat saya <em>mention</em> di awal, namun perlu diingat bahwa analisis ini dilakukan hanya menggunakan <em>sample</em> dataset.</p><p>Sekian.</p><p><em>Open for any feedbacks, thanks!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=189170e35ab4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>