<?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 Aziz Cherif on Medium]]></title>
        <description><![CDATA[Stories by Aziz Cherif on Medium]]></description>
        <link>https://medium.com/@mohamedaziz.cherif?source=rss-927e6670a76b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HqXPk7slP2W_ZBf-SpEgag.jpeg</url>
            <title>Stories by Aziz Cherif on Medium</title>
            <link>https://medium.com/@mohamedaziz.cherif?source=rss-927e6670a76b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 01:22:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohamedaziz.cherif/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[A/B Testing]]></title>
            <link>https://medium.com/@mohamedaziz.cherif/introduction-73b52765048a?source=rss-927e6670a76b------2</link>
            <guid isPermaLink="false">https://medium.com/p/73b52765048a</guid>
            <dc:creator><![CDATA[Aziz Cherif]]></dc:creator>
            <pubDate>Sun, 05 Nov 2023 16:33:45 GMT</pubDate>
            <atom:updated>2023-11-05T16:47:49.173Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*QIALxDvF0U9u1nlq3w7Vyg.jpeg" /></figure><h3>Introduction</h3><p>A/B testing is one of the most commonly used techniques for making data driven decisions for tech companies. It essentially evaluates the outcome of two options A and B (hence the name) based on an experiment. But what is it exactly? how and when should we run a A/B test and are the results hat it provides significant?</p><blockquote><strong>What is A/B Testing?</strong></blockquote><p>Well, say you have a website that allows users to donate for a specific cause. It’s working and some people are actually donating and life is great. But, you think to yourself, could life be greater? Is the color of that donate button optimal? Would your website visitors be more willing to donate if that color would’ve been red instead of blue? Don’t worry, A/B testing got you covered up! Its purpose is to help you decide what color to choose and here’s how to do it.</p><p>First things first, you need a metric to track: it could be the average duration of a web visit session, revenue per user (how much money people donated), Conversion rate (did they donate or not?)… For this example, we’re going to track the click rate as how many subjects (web visitors) clicked the donate button.</p><p>Second, You need two groups of subjects:</p><p>1- <strong>Control group</strong>: A group of subjects that are exposed to the standard (or no) treatment (the blue donate button)</p><p>2- <strong>Treatment group</strong>: A group of subjects that are exposed to a specific treatment (the red donate button)</p><p>The size of the two groups can vary based on the problem. The important thing to note here is that the subjects must be assigned randomly to the groups.</p><p>Well, that’s it, The A/B test is complete! We just check if the treatment group got more click rate than the control group and we make our decision based on that comparison. But, hold on! What if random chance was responsible for the effect we’re evaluating? That means what if, by chance, the subjects in the treatment group had more click rate, not because the new color is actually better, but because they personally like it? And that’s what hypothesis testing is for.</p><p>Note: You might think that, instead of using this cool technique called ‘hypothesis testing’ , we just increase the size of the groups so we can be more sure of our results. Well, you are right! But that turns out to be expensive because, in some A/B tests like pharmaceutical trials, the subjects can be scarce and the treatments might be expensive. That’s why statisticians used math to test the significance of the results run by A/B tests.</p><blockquote><strong>Hypothesis testing</strong></blockquote><p>Hypothesis testing role is to check, if the effect caused by the alternative treatment (the blue donate button in this example), is statistically significant or is it caused by random chance. Guess what? Believe it or not, we’re going to define hypothesis 😮 .</p><p>1- <strong>Null Hypothesis</strong>: It is the hypothesis that chance is to blame. It is the one that we’re trying to reject so we can conclude that the effect is significant. In our case, it’s going to be: The red and the blue donate button color have the same click rate.</p><p>2- <strong>Alternative Hypothesis</strong>: It is the hypothesis we are trying to prove. In our case, it’s going to be: The blue donate button color has more click rate the red one.</p><p>This type of hypothesis testing we just defined is called a One-Way hypothesis test because we are comparing two options A and B in one direction (is A better than B?). Another type of hypothesis testing would be the Two-Way hypothesis test which would compare the two options A and B in two directions (is A different than B?).</p><p>Until this point, we ran our A/B test, got our results, defined some hypothesis to check if the effect we are seeing is statically significant. Great! Now what? Now is the tricky part. Now, we need to choose what test are we going to run. There a lot of tests to choose from that depend on the metric we are evaluating, the number of treatments… I will not be covering all these tests on this article, I might do one just for the possible hypothesis tests and the difference between them, so stay tuned! For now, we are going to run a test called Permutation test</p><blockquote><strong>Permutation test</strong></blockquote><p>It is very simple and logical. It involves these 4 steps:</p><p>1- Combine the treatment and control group’s subjects into one group.</p><p>2- Shuffle the group and randomly sample a new control group of n subjects (n being the size of the original control group) and a new treatment group of m subjects (m being the size of the original treatment group).</p><p>3- Compute the difference of the new calculated metrics for the two new groups we obtained (In our example, it is the difference of the click rate of the two new groups).</p><p>4- Repeat step 2 and 3 R times to yield a permutation distribution of the differences we computed.</p><p>The distribution might look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*2DRNogvuxNUdLbkPWuglGA.png" /><figcaption>Permutation Distribution</figcaption></figure><p>This distribution is describing how often every difference value might occur if we resampled the groups R times. I hope it would make sense that, if the observed difference (The difference we originally calculated from the original treatment and control groups) is furthest to the right, that means that our result is extreme, thus, statistically significant. And if it’s more centered and on the left that means that our result is very common and happened by chance. The question is now? How to calculate this ‘how extreme our observed results are’ ? And that’s p-values!</p><blockquote><strong>P-values and Significance level</strong></blockquote><p>P values is just that. It is, assuming the null hypothesis is true, the probability of obtaining results as unusual or extreme as the observed results. The way of calculating this value depends on the test we ran. For the permutation test, we can calculate it straight from the distribution we made.</p><p>The significance level is the threshold that will help us to decide if the p-value is small enough to decide if the A/B test we ran is statistically significant.</p><h3><strong>Summary</strong></h3><p>That’s it! This one is for sure believe me 😄. To summarize, we just run an A/B test , defined our null and alternative hypothesis for hypothesis testing, chose the hypothesis test we are going to run, calculated the p-value, compared it with our significance level (if it’s lower, then the result is statistically significant, if not, the effect is caused by random chance)!</p><p>Thank you for reading my article! I know it was a long one but I wanted to cover as much as I could that is related to A/B testing. I wish you found my style of writing clear and fun. If you appreciate it, make sure to follow me on medium. If you have any comment make sure to contact me on <a href="https://www.linkedin.com/in/aziz-cherif-5650141b4/">LinkedIn</a>. See ya!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73b52765048a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>