<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Antonia Villarino</title>
    <description>The latest articles on DEV Community by Antonia Villarino (@antoniavillarino).</description>
    <link>https://dev.to/antoniavillarino</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F613571%2Fb3b42347-b20c-4695-ac19-1dd02602fcbd.jpeg</url>
      <title>DEV Community: Antonia Villarino</title>
      <link>https://dev.to/antoniavillarino</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/antoniavillarino"/>
    <language>en</language>
    <item>
      <title>Null hypothesis, alternative hypothesis and hypothesis testing</title>
      <dc:creator>Antonia Villarino</dc:creator>
      <pubDate>Thu, 08 Jul 2021 14:37:00 +0000</pubDate>
      <link>https://dev.to/antoniavillarino/null-hypothesis-alternative-hypothesis-and-hypothesis-testing-4afp</link>
      <guid>https://dev.to/antoniavillarino/null-hypothesis-alternative-hypothesis-and-hypothesis-testing-4afp</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A fact is a simple statement that everyone believes. It is innocent, unless found guilty. A hypothesis is a novel suggestion that no one wants to believe. It is guilty, until found effective.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Edward Teller&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Often we can't get to unambiguous conclusions using machine learning models and we end up saying: "we can't reject the null hypothesis". But, what does that mean? This article tries to explain what does &lt;strong&gt;null hypothesis&lt;/strong&gt; mean, according to Statistics.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's a hypothesis?
&lt;/h3&gt;

&lt;p&gt;Sometimes, we feel that something is off about what we are told as truth. That's what happened to &lt;strong&gt;Charles Darwin&lt;/strong&gt; when &lt;a href="https://robertcurrylab.com/sites/darwins-mockingbirds/how-did-the-mock-birds-especially-influence-darwin/"&gt;he observed different species of mockingbirds in each island of the Galapagos archipelago&lt;/a&gt;. He knew that there were just one species of mockingbird in South America, but found &lt;strong&gt;three more&lt;/strong&gt; in those islands. So he formulated a &lt;strong&gt;hypothesis&lt;/strong&gt;: "What if those new species are evolved separately, by natural selection, from the continent mockingbird which, somehow, arrived into the islands flying?"&lt;/p&gt;

&lt;p&gt;After that, Darwin knew he had to prove this hypothesis to transform it into a well-established theory, but this is another story.&lt;/p&gt;

&lt;p&gt;More formally: a hypothesis is an &lt;strong&gt;educated guess&lt;/strong&gt; made to explain some event.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ok. Then, why is the Null Hypothesis called "Null"?
&lt;/h3&gt;

&lt;p&gt;What Darwin was proposing is what is called &lt;strong&gt;Alternative Hypothesis&lt;/strong&gt;: a premise that challenges the established beliefs. So the &lt;strong&gt;Null Hypothesis is the one that doesn't change the status quo&lt;/strong&gt;. It's called "null" because it brings no difference to the knowledge we have (null difference)&lt;/p&gt;

&lt;h3&gt;
  
  
  Oh, I see. And how do we define this "Alternative" Hypothesis?
&lt;/h3&gt;

&lt;p&gt;The Alternative Hypothesis has to bring some change compared with the Null Hypothesis. This change can go from &lt;strong&gt;just modifying some value&lt;/strong&gt; to the &lt;strong&gt;total opposition&lt;/strong&gt; of the Null Hypothesis. For instance, you could propose a variation in the value of Earth's gravity (say, that is greater than 

&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;9.8ms−29.8ms^{-2}&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;9.8&lt;/span&gt;&lt;span class="mord mathnormal"&gt;m&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;s&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mtight"&gt;−&lt;/span&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
) or affirm that there is no gravity at all!&lt;/p&gt;

&lt;h3&gt;
  
  
  The Alternative Hypothesis is proposed, what now? How do we test it?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;First, we should &lt;strong&gt;measure the value&lt;/strong&gt; we want to evaluate. For example, we measure the Earth's gravity a hundred times and take the mean of all the records. Or, say that we want to analyse the mean age of the population of Barcelona: to do that, we take a sample of the entire population and average their ages (being careful that our sample is &lt;a href="https://en.wikipedia.org/wiki/Sampling_(statistics)#Population_definition"&gt;representative&lt;/a&gt; of Barcelona's population!).&lt;/li&gt;
&lt;li&gt;Then we &lt;strong&gt;propose a statistical model for the null hypothesis.&lt;/strong&gt; We are going to use this model (for example, a Normal distribution) to check if the value we measured is compatible with it.&lt;/li&gt;
&lt;li&gt;We compute then the &lt;strong&gt;probability of our measured value&lt;/strong&gt; occurring under the null hypothesis. This probability is called the &lt;strong&gt;p-value&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;And if this p-value is &lt;strong&gt;below 1%-5%&lt;/strong&gt; (depending on the author), we &lt;strong&gt;reject the Null Hypothesis&lt;/strong&gt;, because the measured value has a probability too low to be compatible with it. This 1%-5% (or 0.01-0.05) is called the &lt;strong&gt;significance level&lt;/strong&gt; and is usually written as 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;α\alpha&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;α&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the probability is &lt;strong&gt;greater&lt;/strong&gt; than 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;α\alpha&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;α&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
, we cannot reject the Null Hypothesis, because there is a higher probability that the measured value belongs to its modelled distribution. Even so, this doesn't mean that the Null Hypothesis is definitely confirmed! There is no absolute certainty in science. &lt;/p&gt;

&lt;h3&gt;
  
  
  TL;DR
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;hypothesis&lt;/strong&gt; is an &lt;strong&gt;educated guess&lt;/strong&gt; made to explain some event.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;null hypothesis&lt;/strong&gt; is the one that &lt;strong&gt;doesn't change&lt;/strong&gt; our current knowledge.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;alternative hypothesis&lt;/strong&gt; proposes a &lt;strong&gt;change in some measurable feature&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;We &lt;strong&gt;accept&lt;/strong&gt; the alternative hypothesis if its &lt;strong&gt;probability of occurrence&lt;/strong&gt; under the null hypothesis (p-value) is below &lt;strong&gt;1%-5%&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  More:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Stephanie Glen, &lt;a href="https://www.statisticshowto.com/probability-and-statistics/null-hypothesis/"&gt;Null Hypothesis Definition and Examples, How to State&lt;/a&gt; from &lt;a href="https://www.statisticshowto.com/"&gt;StatisticsHowTo.com&lt;/a&gt;:&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Exclusion_of_the_null_hypothesis"&gt;Exclusion of the null hypothesis&lt;/a&gt; from &lt;a href="https://en.wikipedia.org/wiki/Main_Page"&gt;Wikipedia&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Statistical_significance"&gt;Statistical significance&lt;/a&gt; from &lt;a href="https://en.wikipedia.org/wiki/Main_Page"&gt;Wikipedia&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Vinita Silaparasetty
, &lt;a href="https://medium.com/vinita-silaparasetty/what-is-a-hypothesis-in-machine-learning-847ac0dd87a"&gt;What is a Hypothesis in Machine Learning?&lt;/a&gt; from &lt;a href="https://medium.com/"&gt;Medium&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>statistics</category>
      <category>science</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
