<?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 Brungesh BE on Medium]]></title>
        <description><![CDATA[Stories by Brungesh BE on Medium]]></description>
        <link>https://medium.com/@brungeshms?source=rss-6cd805f59e50------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uSR-wHj-8v466aoCDWMmfA.png</url>
            <title>Stories by Brungesh BE on Medium</title>
            <link>https://medium.com/@brungeshms?source=rss-6cd805f59e50------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 13:28:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brungeshms/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[Stats 101 for Experimentation]]></title>
            <link>https://medium.com/@brungeshms/stats-101-for-experimentation-9b40c09ade58?source=rss-6cd805f59e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b40c09ade58</guid>
            <category><![CDATA[ab-testing]]></category>
            <category><![CDATA[experimentation]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[sample-size-calculation]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Brungesh BE]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 21:18:28 GMT</pubDate>
            <atom:updated>2025-10-08T21:18:28.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*uYZc7zG036bupVtfYuS8CA.jpeg" /></figure><p><em>This summer I interned with the largest multi-national retail corporation in the world, Walmart Global Tech(Fortune number 1 company according to </em><a href="https://fortune.com/company/walmart/fortune500/"><em>Forbes magazine</em></a><em>). In this internship I got an opportunity to work in Walmart’s Experimentation Platform Team. I would like to share some of the learnings from this internship in this blog.</em></p><h4>About the Experimentation Team:</h4><p>Walmart continuously strives to provide an amazing customer experience with everyday low prices. Walmart does this by constantly experimenting with new ideas. Experimentation at scale presents unique challenges and opportunities in data, engineering, and customer experience. The Experimentation platform team provides a common platform for all the product managers and developers in Walmart to set-up, run and analyze thousands of experiments.</p><p><strong>In this blog post, I am going to talk about some of important statistical concepts I learnt for doing an experiment and analyzing the results.</strong></p><p>Hypothesis testing in statistics is a way for you <strong>to test the results of an experiment to see if you have meaningful results</strong>. You’re basically testing whether your results are valid by figuring out the odds that your results have happened by chance. The actual test begins by considering two hypotheses. They are called the null hypothesis and the alternative hypothesis. These hypotheses contain opposing viewpoints.</p><h4><strong>1. What is Null Hypothesis and Alternate Hypothesis?</strong></h4><p>The null hypothesis (H0) is a statement of no effect, relationship, or difference between two or more groups or factors. In research studies, a researcher is usually interested in disproving the null hypothesis.<br> The alternative hypothesis (Ha) is the opposite of the null hypothesis. The alternate hypothesis is usually what you will be testing in hypothesis testing. It’s a statement that you or another researcher) thinks is true and one that can ultimately lead you to reject the null hypothesis and replace it with the alternate hypothesis.</p><blockquote><strong>Example:</strong> Consider an eCommerce company wants to experiment whether the color of the Add To Cart button should be green or red.</blockquote><blockquote>Here the null hypothesis would mean that the color of the button has no affect the overall click through rate of the button and the alternate hypothesis would be that the color of the button has significant effect on the overall click through rate.</blockquote><h4>2. What is the p-value and how do you interpret it to reject or accept the null hypothesis?</h4><p>The P value, or calculated probability, is the probability of finding the observed, or sample statistics when the null hypothesis (H0) of a study is true. P is also described in terms of rejecting H0 when it is true, however, it is not a direct probability of this state. Graphically, the p value is the area in the tail of a probability distribution. It’s calculated when you run a hypothesis test and is the area to the right of the test statistic (if you’re running a two-tailed test, it’s the area to the left and to the right).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*D0rkupzfoqaBhRah6RherQ.png" /><figcaption>Illustration of p-value |Photo Credit: <a href="https://www.statisticshowto.com/contact/">Stephanie Glen</a></figcaption></figure><p>We use p-values to make conclusions in significance testing. More specifically, we compare the p-value to a significance level α (alpha) to make conclusions about our hypotheses. If the p-value is lower than the significance level we chose, then we reject the null hypothesis H0 in favor of the alternative hypothesis Ha. If the p-value is greater than or equal to the significance level, then we fail to reject the null hypothesis H0, but this doesn’t mean we accept H0. To summarize:</p><blockquote>p-value &lt; α ⇒ reject H0 ⇒ Accept Ha</blockquote><blockquote>p-value ≥ α ⇒ fail to reject H0</blockquote><blockquote><strong>Example:</strong> Using the previous example, an eCommerce company wants to experiment whether the color of the Add to Cart button should be green or red. We calculate the p-value of the experiment for the Overall Evaluation metric. Let’s say the associated P-value was approximately 0.068 using a significance level of α=0.05</blockquote><blockquote><strong>Conclusion:</strong> Fail to reject H0. Since the p-value of 0.068 is greater than α=0.05, we should fail to reject H0.</blockquote><h4>3. What is Type 1 and Type 2 error?</h4><p>A Type I error (or Type 1), is the incorrect rejection of a true null hypothesis. The alpha symbol, α, is usually used to denote a Type I error.<br> A Type II error (sometimes called a Type 2 error) is the failure to reject a false null hypothesis. The probability of a type II error is denoted by the beta symbol β.</p><figure><img alt="Pictorial Illustration of Type 1 and Type 2 Error" src="https://cdn-images-1.medium.com/max/354/1*pUOrK1on0n6_VyK6WiYPag.png" /><figcaption>Pictorial Illustration of Type 1 and Type 2 Error | Photo Credit: <a href="https://scholar.google.com/citations?user=bbrkglMAAAAJ&amp;hl=en">Ben Sharp</a></figcaption></figure><p>When you perform a hypothesis test, there are four possible outcomes depending on the actual truth (or falseness) of the null hypothesis H0 and the decision to reject or not. The outcomes are summarized in the following table:</p><pre>+===================+====================+====================+<br>|      Action       |      H0 true       |      H0 false      |<br>+===================+====================+====================+<br>| Reject H0         | Type I error       | Correct conclusion |<br>+-------------------+--------------------+--------------------+<br>| Fail to reject H0 | Correct conclusion | Type II error      |<br>+-------------------+--------------------+--------------------+</pre><p>The four possible outcomes in the table are:</p><ul><li>The decision is not to reject H0 when H0 is true (correct decision).</li><li>The decision is to reject H0 when H0 is true (incorrect decision known as a Type I error).</li><li>The decision is not to reject H0 when, in fact, H0 is false (incorrect decision known as a Type II error).</li><li>The decision is to reject H0 when H0 is false (correct decision whose probability is called the Power of the Test).</li></ul><p>They are represented in terms of probabilities as follows,</p><ul><li>α = probability of a Type I error = P (Type I error) = probability of rejecting the null hypothesis when the null hypothesis is true.</li><li>β = probability of a Type II error = P (Type II error) = probability of not rejecting the null hypothesis when the null hypothesis is false.<br> α and β should be as small as possible because they are probabilities of errors. They are rarely zero.</li></ul><blockquote><strong>Example:</strong> Let’s say that you want to increase conversions on a banner displayed on your website. For that to work out, you’ve planned on adding an image to see if it increases conversions or not.</blockquote><blockquote><strong>Type I error:</strong> You start your A/B test running a control version (A) against your variation (B) that contains the image. After 5 days, the variation (B) <strong>outperforms the control version by a staggering 25% increase</strong> in conversions with an 85% level of confidence.</blockquote><blockquote>You stop the test and implement the image in your banner. However, after a month, you noticed that your month-to-month conversions have actually decreased.</blockquote><blockquote>That’s because you’ve encountered a type 1 error: <strong>your variation didn’t actually beat your control version in the long run.</strong></blockquote><blockquote><strong>Type II error:</strong> You start your A/B test running a control version (A) against your variation (B) that contains the image. After a couple of weeks, <strong>you do not notice any difference</strong> in conversions: both versions seem to convert at the same rate and you start questioning your assumption and stop the test.</blockquote><blockquote>Two weeks later, you hear that a competitor has implemented something similar at the same time and observed tangible gains in conversions and you decide to re-run the test.</blockquote><blockquote>After a month <strong>you discover positive gains in conversions for the variation (B)</strong>. Adding an image to the banner did bring your company more sales than the control version. That means your first test encountered a type 2 error!</blockquote><h4>4. What is the power of an experiment?</h4><p>The statistical power of a study (sometimes called sensitivity or β) is how likely the study is to distinguish an actual effect from one of chance. It’s the likelihood that the test is correctly rejecting the null hypothesis (i.e. “proving” your hypothesis). For example, a study that has an 80% power means that the study has an 80% chance of the test having significant results.</p><ul><li>A high statistical power means that the test results are likely valid. As the power increases, the probability of making a Type II error decreases.</li><li>A low statistical power means that the test results are questionable.</li></ul><h4>5. What is Confidence Interval?</h4><p>A confidence interval is how much uncertainty there is with any particular statistic. Confidence intervals are often used with a margin of error. It tells you how confident you can be that the results from a poll or survey reflect what you would expect to find if it were possible to survey the entire population. Confidence intervals are intrinsically connected to confidence levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*yJQKrjAHgYssEsTgYWBOAg.gif" /><figcaption>Confidence Interval for any value of α|Photo Credit: <a href="https://www.statisticshowto.com/contact/">Stephanie Glen</a></figcaption></figure><p>Confidence levels are expressed as a percentage (for example, a 95% confidence level). It means that should you repeat an experiment or survey repeatedly, 95 percent of the time your results will match the results you get from a population (in other words, your statistics would be sound!). Confidence intervals are your results, and they are usually numbers. Below figures show the representation of a 95% confidence level graph and a formula-based graph for the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*0ny9cxBg4bd1jQwJw7bi6g.png" /><figcaption>95% confidence Interval |Photo Credit: <a href="https://www.statisticshowto.com/contact/">Stephanie Glen</a></figcaption></figure><blockquote><strong>Example:</strong> You survey a group of pet owners to see how many cans of dog food they purchase a year. You test your statistic at the 99 percent confidence level and get a confidence interval of (200,300). That means you think they buy between 200 and 300 cans a year. You’re super confident (99% is a very high level!) that your results are sound, statistically.</blockquote><h4>6. Using Z-test in Experimentation (A/B testing)?</h4><p>An AB test is a statistical significance test in which two populations are compared to see if they differ significantly on a single characteristic.</p><ul><li>Are women more likely to be vegetarians than men?</li><li>Do your customers like the green “Add to Cart” button more than the red one?</li><li>Does switching to a new brand of fertilizer lead to more watermelon seeds growing to maturity?</li></ul><p>In a more statistical environment, an AB test (also known as a split test or a two-proportion statistical significance test) is a form of Z-test or vice-versa. In Z-test the null hypothesis (the default assumption) is that the two proportions are the same. We want to prove the null hypothesis wrong; we want to prove that there is a difference! The statistical significance of a Z-test is determined using p-value. We typically use a two-tailed Z-test in A/B testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*1FuyXnUTKjyh0Uv36sub_A.png" /><figcaption>Test Statistic curve for a two-tailed Z-test | Photo Credit: <a href="https://www.omnicalculator.com/statistics/ab-test">Rijk de Wet</a></figcaption></figure><ul><li>A two-tailed test/split test works by determining the Z-score of the two-population problem and determining whether it falls into the acceptance region (the blue segment) or the rejection region (the red segments) of the normal distribution.</li><li>If it falls into the acceptance region, we must accept the null hypothesis. If it falls into the rejection region, we can reject the null hypothesis.</li><li>You can see in the figure above that the rejection region is much smaller than the acceptance region. This difference in size might make it hard to disprove the null hypothesis, but if you do end up disproving it, it’s undeniably false.</li><li>In our code we first calculate the Z score/critical value for the two-tailed Z-test given by,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/157/0*WsemVMsG2dp4PXV7" /><figcaption>Z score formula</figcaption></figure><blockquote>where <strong>μc, μt</strong> = sample mean of Control and Treatment group,<br><strong>σc, σt</strong> = sample standard deviation of Control and Treatment group,<br><strong>nc, nt</strong> = sample size of Control and Treatment group</blockquote><p>The Z-score is used to calculate the P-value if your test statistic approximately follows the standard normal distribution N(0,1). Thanks to the central limit theorem, you can count on the approximation if you have a large sample (say at least 50 data points) and treat your distribution as normal.</p><ul><li>The sample size of our control and treatment group is always large hence it is assumed to be normally distributed.</li><li>The P-value is found in terms of the cumulative distribution function (cdf) of the standard normal distribution, which is traditionally denoted by Φ, it is given by the following formulae below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/0*v4_5yK0lUl9pFP-j" /></figure><blockquote>where <strong>Φ</strong> = cumulative distribution function (cdf)</blockquote><ul><li>A Z-test most often refers to testing the population mean, or the difference between two population means, in particular between two proportions. You can also find Z-tests in maximum likelihood estimations.</li><li>P-value is the smallest level of significance at which the null hypothesis would be rejected. So, if you now want to make a decision about the null hypothesis at some significance level α, just compare your p-value with α:</li><li>1. If p-value ≤ α, then you reject the null hypothesis and accept the alternative hypothesis; and</li><li>If p-value ≥ α, then you don’t have enough evidence to reject the null hypothesis.</li></ul><h4>7. What is MDE of an experiment (Minimal Detectable Effect)?</h4><p>The minimum detectable effect (or MDE) is used to gauge the potential effort and impact of an experiment. The minimum detectable effect represents the relative minimum improvement over the baseline that you’re willing to detect in an experiment, to a certain degree of statistical significance. It can help you figure out the likely relationship between impact and effort — or cost and potential value — for your experiment.</p><p>Use it to benchmark how long to run an experiment and the impact you’re likely to see, so you can prioritize experiments according to expected ROI. Set expectations for how long it may take to run an experiment based on MDE, depending on how granular you’d like your results to be.</p><p>MDE can help provide a guideline through the uncertainty of experimentation, so you can prioritize your roadmap effectively.</p><blockquote><strong>Example:</strong> Let’s say your existing conversion rate is 2% which is your baseline for the experiment. If you want to be able to measure a 5% expected improvement in your test results, you’ll want to be able to measure if your conversion rate increased from 2% to 2.5%. So, your MDE would be 5%.</blockquote><blockquote>Consider that you have to run your experiment for one week to detect 5% effect size. For 4% effect size the duration might increase to 4–5 weeks and this might seem like a reasonable tradeoff. The same for 2% effect size, you have run the same experiment for several months which is not feasible. This will help you to effectively plan your roadmap.</blockquote><h4>8. Sample Size Calculation, how many samples do you need for an experiment to come up with a p-value?</h4><p>The sample size is another variable we need to calculate the p-value. In a typical AB testing environment, stopping the experiment after reaching the reported significance level sometimes yields false positives. Also peeking at an ongoing experiment i.e, stopping the experiment to check for significance levels makes your result that much less significant. Evan miller has explained this peeking problem in one of his articles <a href="https://www.evanmiller.org/how-not-to-run-an-ab-test.html">here</a>.</p><p>For running any experiments, the best way to avoid repeated significance testing errors is to set the sample size in advance and wait until the end of the experiment. As a part of Pre-Experiment analysis tool we use the Sample Size calculator using an Overall Evaluation Metric (deep dive <a href="https://quickbooks-engineering.intuit.com/experimentation-intuit-part-4-analysis-of-experiments-1a17a3762107">here</a>) GMV which is a continuous variable.</p><p>The Sample Size is calculated by the following formula,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*X9QwbbUqyveF4dgtstDQdw.png" /></figure><blockquote>Where <strong>δ</strong> = minimum effect you wish to detect (MDE), it’s typically 50 basis point (0.5%)</blockquote><blockquote>“<strong>σ</strong>” = Baseline Standard deviation (Pre-Experiment) of Overall Evaluation Criteria i.e, GMV</blockquote><blockquote><strong>16</strong> = is a rule of thumb = 2* (Z α⁄2+Z 1−β)² where Z α⁄2 &amp; Z 1−β are z score values (α = 0.05, 1 — β = 0.80)</blockquote><p>A deep dive into the sample size calculator formula can be found <a href="https://journals.sagepub.com/doi/pdf/10.1177/201010581102000213">here</a>. The sample size calculation is inspired from <a href="https://www.linkedin.com/in/anilmadanurl/">Anil Madan</a>’s Experimentation <a href="https://quickbooks-engineering.intuit.com/experimentation-intuit-part-4-analysis-of-experiments-1a17a3762107">blog post</a> for Intuit.</p><p>For my Intern project, I used the above formula to calculate the sample size for an experiment on a specific qualifying condition. A Qualifying condition for an experiment is like a selection criterion for filtering user click stream data (A Json formatted data sent by different components from Walmart.com fired at various page loads or user actions. Also called telemetry data or Beacons) on any webpage in the company website.</p><p>Initially the telemetry data is fetched using a Big Data job. The job generates tables which is stored in the database. The table would contain the user click stream data details like user id and other information for a particular Qualifying condition. This table is joined with something like a sales table to get the sales related information regarding the Overall Evaluation Metric i.e., GMV. The final table will contain the statistics of GMV required for sample size calculation like mean, standard deviation etc.</p><p>The smallest effect in the mean GMV that the user has made w.r.t the qualifying condition is what we want to detect, and we can do that with the help of Minimum Detectable Effect calculation. MDE is the smallest improvement you’re willing to be able to detect. It determines how “sensitive” an experiment is. Using the MDE with the baseline overall evaluation metric (OEC) we can calculate the Sample Size and determine how long an experiment must run.</p><p>Consider an example for the Sample Size Calculator for the above scenario.</p><p>Let’s assume the statistics from the final table to be σ = 25.52, mean = 6.35, 16 = constant for 𝛂 at 5% &amp; 𝛃 at 80% for Cart page qualifying condition. Then we have <strong>δ </strong>as,</p><blockquote><strong>δ (MDE)</strong> = 0.5% of mean = 0.5% of 6.35</blockquote><blockquote>= 0.03175</blockquote><p>The smallest improvement that we want to observe in the mean of the baseline Overall Evaluation Metric (GMV) for running the experiment on the Cart Page is 0.03175. Substituting these values in the Sample Size calculator we get,</p><blockquote><strong>n </strong>= 16 . (25.52/0.03175)²</blockquote><blockquote>= 10,336.984.46</blockquote><p>The required sample size to run an experiment on the Cart page qualifying condition is around 10.34 million visitors. Using this we can run the experiment on the Cart Page until the number of visitors reach 10.34 million to get a statistically significant result.</p><p><strong>References:</strong></p><ol><li><a href="https://courses.lumenlearning.com/introstats1/chapter/outcomes-and-the-type-i-and-type-ii-errors/">https://courses.lumenlearning.com/introstats1/chapter/outcomes-and-the-type-i-and-type-ii-errors/</a></li><li><a href="https://www.statisticshowto.com/contact/"><strong>Stephanie Glen</strong></a>. “P-Value in Statistical Hypothesis Tests: What is it?” From <a href="https://www.statisticshowto.com/"><strong>StatisticsHowTo.com</strong></a>: Elementary Statistics for the rest of us! <a href="https://www.statisticshowto.com/probability-and-statistics/statistics-definitions/p-value/">https://www.statisticshowto.com/probability-and-statistics/statistics-definitions/p-value/</a></li><li><a href="https://www.statisticshowto.com/contact/"><strong>Stephanie Glen</strong></a>. “Confidence Interval: How to Find it: The Easy Way!” From <a href="https://www.statisticshowto.com/"><strong>StatisticsHowTo.com</strong></a>: Elementary Statistics for the rest of us! <a href="https://www.statisticshowto.com/probability-and-statistics/confidence-interval/">https://www.statisticshowto.com/probability-and-statistics/confidence-interval/</a></li><li><a href="https://help.optimizely.com/Ideate_and_Hypothesize/Use_minimum_detectable_effect_to_prioritize_expe">https://help.optimizely.com/Ideate_and_Hypothesize/Use_minimum_detectable_effect_to_prioritize_expe</a>riments</li><li><a href="https://www.statisticsteacher.org/2017/09/15/what-is-power/">https://www.statisticsteacher.org/2017/09/15/what-is-power/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b40c09ade58" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>