<?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 Ahmad Nur Aziz on Medium]]></title>
        <description><![CDATA[Stories by Ahmad Nur Aziz on Medium]]></description>
        <link>https://medium.com/@ahmadnuraziz3?source=rss-db1883a3c71f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TGKajcVYCcDmIIu_ICibsw.jpeg</url>
            <title>Stories by Ahmad Nur Aziz on Medium</title>
            <link>https://medium.com/@ahmadnuraziz3?source=rss-db1883a3c71f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:44:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ahmadnuraziz3/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[Application of A/A Tests in A/B Testing Experiment]]></title>
            <link>https://medium.com/@ahmadnuraziz3/application-of-a-a-tests-in-online-controlled-experiments-a098a3922b5?source=rss-db1883a3c71f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a098a3922b5</guid>
            <category><![CDATA[ab-testing]]></category>
            <category><![CDATA[a-b-testing]]></category>
            <dc:creator><![CDATA[Ahmad Nur Aziz]]></dc:creator>
            <pubDate>Wed, 27 Apr 2022 08:14:46 GMT</pubDate>
            <atom:updated>2023-05-01T07:38:16.287Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Getting numbers is easy, getting numbers you can trust is hard. -Kohavi et.al</blockquote><p>Even though randomized controlled experiments (or A/B testing) are the gold standard for establishing causality, the pitfalls during a design or analysis will affect the trustworthiness of the experiments.</p><p>Here we will discuss A/A tests, a simple yet powerful method to detect several pitfalls in experiments such as:</p><ol><li>Metric trustworthiness.</li><li>Metric calculation problem.</li><li>Selection bias.</li></ol><p>Basically, the A/A test is like an A/B test. But in the A/A test, we didn’t change anything.</p><h3>Metric trustworthiness: are our metrics affected by outliers?</h3><p>The existence of outliers in the data will affect metrics mean and variance so that the sensitivity or statistical power of an experiment will decrease. We may suffer from type II error or we fail to reject the null hypothesis that is actually false.</p><p>Offline A/A test could be done to validate the metric trustworthiness towards outliers[1,<a href="https://exp-platform.com/Documents/2009-ExPpitfalls.pdf">2</a>,<a href="https://www.microsoft.com/en-us/research/group/experimentation-platform-exp/articles/p-values-for-your-p-values-validating-metric-trustworthiness-by-simulated-a-a-tests/">3</a>]. Here is the step by step of simulating the A/A test:</p><ol><li>Randomly shuffle data into two variants.</li><li>Calculate the mean and variance of the metric.</li><li>Run the two sample significance test (e.g t-test)</li><li>Repeat steps (1) to (3) for <em>n </em>iterations. So we have <em>n</em> p-value.</li><li>Run the goodness-of-fit test such as Anderson-Darling or Kolmogorov- Smirnoff. When the metric of interest is continuous, then the distribution of p-values under the Null hypothesis (equal means) should be uniform[<a href="https://exp-platform.com/Documents/2009-ExPpitfalls.pdf">1</a>].</li></ol><p>We expect to see uniform distributions of the p-value. If the metric is affected by outliers, the distribution won’t be uniform.</p><p>Below is an example of an A/A test simulation result for the Clicks/User metric. Without outliers, the p-value is uniformly distributed (left graph). On the other hand, the presence of outliers causes the non-uniformly distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*DoWZjI7-PHzYvt4pqLiQ0g.png" /><figcaption>(Left) The p-value distribution <strong>is uniform, </strong>KS test: 0.2886460. (Right) The p-value distribution <strong>is not uniform, </strong>KS test: 0.00000.</figcaption></figure><h3>Metric calculation problem: is the way we calculate correct?</h3><p>In the <a href="https://medium.com/@ahmadnuraziz3/applying-delta-method-for-a-b-tests-analysis-8b1d13411c22">previous post</a>, we discussed variance estimation using the delta method for ratio metrics. Here we will see that if we calculate the variance using the wrong formula, the A/A test will fail.</p><p>For example, we use user ID as our randomization unit (unit that is randomly assigned to a variant) and we have a metric Clicks/Page View which measures how many clicks are generated per page view. The page views for one user are not independent of each other (or they are correlated), the first view will affect the second view, the third view, and so on. Therefore we can’t calculate the variance using the following formula. Instead, we have to use the delta method to estimate the variance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/205/0*LzNaCq5J-N62_OCG.png" /><figcaption>Standard formula to calculate variance</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/0*uLRxCuXFwzOJGGnB.png" /><figcaption>Variance estimation of metrics ratio using the delta method</figcaption></figure><p>To validate that the metric calculation is correct, we will run an A/A test simulation. If the calculation is valid, we will see the uniform distribution of the p-value, otherwise invalid calculation will produce a non-uniform distribution of the p-value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*AFvRphoUN6PTGkQnr2siZw.png" /><figcaption>(Left) The p-value distribution <strong>is not uniform</strong>, KS test: 0.0000009. (Right) The p-value distribution <strong>is uniform, </strong>KS test:0.7741735.</figcaption></figure><h3>Selection bias due to carryover effects</h3><p>In online controlled experiments, we might run multiple experiments using the same population (or same bucket users assignment). This will probably cause carryover effects where the impact of previous experiments might affect further experiments.</p><p>We can avoid this by using simple A/A tests that utilize the historical performance of users.</p><ol><li>Collect the historical performance of users.</li><li>Calculate the mean and variance of the metric.</li><li>Run the significance test (e.g. t-test).</li><li>Get the p-value.</li></ol><p>In A/A tests, we expect there to be no difference between variants. So that if the p-value is less than the significance level (e.g. 5%), we should re-randomize the users[<a href="https://exp-platform.com/Documents/puzzlingOutcomesInControlledExperiments.pdf">4</a>].</p><p>Reference:</p><ol><li>R. Kohavi, D. Tang, &amp; Y. Xu. (2020). Chapter 19: The A/A Test. <em>Trustworthy Online Controlled Experiments</em> (pp. 200–208). Cambridge University Press.</li><li><a href="https://exp-platform.com/Documents/2009-ExPpitfalls.pdf">https://exp-platform.com/Documents/2009-ExPpitfalls.pdf</a></li><li><a href="https://www.microsoft.com/en-us/research/group/experimentation-platform-exp/articles/p-values-for-your-p-values-validating-metric-trustworthiness-by-simulated-a-a-tests/">https://www.microsoft.com/en-us/research/group/experimentation-platform-exp/articles/p-values-for-your-p-values-validating-metric-trustworthiness-by-simulated-a-a-tests/</a></li><li><a href="https://exp-platform.com/Documents/puzzlingOutcomesInControlledExperiments.pdf">https://exp-platform.com/Documents/puzzlingOutcomesInControlledExperiments.pdf</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a098a3922b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying Delta Method in A/B Tests Analysis]]></title>
            <link>https://medium.com/@ahmadnuraziz3/applying-delta-method-for-a-b-tests-analysis-8b1d13411c22?source=rss-db1883a3c71f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b1d13411c22</guid>
            <category><![CDATA[metrics-ratio]]></category>
            <category><![CDATA[delta-method]]></category>
            <category><![CDATA[a-b-testing]]></category>
            <dc:creator><![CDATA[Ahmad Nur Aziz]]></dc:creator>
            <pubDate>Wed, 11 Aug 2021 05:11:16 GMT</pubDate>
            <atom:updated>2021-08-11T08:44:29.687Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*5CGti-p-jZqk59D2pjf1Xg.png" /></figure><p>Hi! This is my first article in Medium. Hopefully, the article is easy to understand and useful. Writing is one of the things I’ve wanted for a long time but determine an interesting topic is not easy for me. Finally, I decided to write about A/B testing, a gold method that is commonly used in many tech companies. Feel free to give me feedback for my improvement, thank you! 😊</p><h3>WHY Delta Method</h3><p>In A/B test analysis, it’s mandatory to do hypothesis testing whether the treatment variant is statistically significantly different from the control variant. If our metrics are continuous, this could be done using an independent t-test since we know that the variants are independent of each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*_9_spRFTY0jSrVNLKutIIg.png" /><figcaption>Independent t-test formula</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/205/1*TdipV3KTfJdbSq2Y3ceOaA.png" /><figcaption>Variance formula</figcaption></figure><p>However, the mean and variance formula only applied to i.i.d (independent and identically distributed) random variables, and in real business cases our metrics are more complex. Mostly, business metrics are defined as ratios, for example, Clickthrough rate or CTR which is defined as Clicks/Views.</p><p>Clicks and views are random variables, when we combined them as a single metric CTR they will have joint distribution. Also if our randomization is based on user_id, one user is possibly generated multiple views so that the views are not independent of each other. Therefore the variance estimation formula above can’t be used to estimate the CTR variance. Here, we will utilize the delta method to approximate the variance of the metrics ratio.</p><h3>WHAT is Delta Method?</h3><p>Basically, Delta method extends the normal approximations of the central limit theorem. Delta method approximates asymptotically normal random variables by applying the Taylor series on the function of random variables. Suppose that we have y=g(x), we can expand the function into series such as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*jLOaVGgaZKGcjs85df4c6Q.png" /><figcaption>Taylor approximation of y=g(x)</figcaption></figure><p>We can approximate the variance of the function as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/139/1*MXHXPJf7y5seS1PQrtn7Ng.png" /><figcaption>Variance approximation of y=g(x)</figcaption></figure><p>Suppose that we have metrics ratio Z = Y/X, by applying the Taylor series we can derive the equation according to the procedure above with a note that the function contains multiple variables X and Y. Without being into further technical detail, we can approximate the variance of Z as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*a5GqT3ipRaNa0_PjM2Dlwg.png" /><figcaption>Variance approximation of ratio Z</figcaption></figure><h3>Example</h3><p>For example, we have two variants: Treatment and Control variant. Our metric is CTR = Clicks/Views. First, we calculate the mean of the metric for each variant:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*NzD5Lj6Uw_Vjvha3FLUFPQ.png" /><figcaption>Mean CTR of treatment and control variant</figcaption></figure><p>Then we calculate the variance of the CTR using the variance formula for ratio where Y as Clicks and X as Views.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*Edv6QADkqfp_dUO_y4jXQg.png" /><figcaption>Variance of CTR</figcaption></figure><p>Finally, we can calculate the t-value. If the absolute t-value is more than the critical value we reject the null hypothesis. Conversely, if the absolute t-value is less than the critical value we fail to reject the null hypothesis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*t9KBsFZ7uaX-QjxwxV2UUg.png" /><figcaption>t-value of CTR difference between control and treatment</figcaption></figure><p>Last, I put the example of calculation using dummy data. The calculation is straightforward and simple. Even if you commonly use SQL to collect and process the data from a database, you can directly calculate the confidence interval from SQL.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a58c66fc2c9c9201fa18c927720697de/href">https://medium.com/media/a58c66fc2c9c9201fa18c927720697de/href</a></iframe><p>Reference:</p><ol><li><a href="https://alexdeng.github.io/public/files/jsm2011-deng.pdf">Choice of randomization unit and analysis</a></li><li><a href="https://arxiv.org/pdf/1803.06336.pdf">Applying delta method in metric analytics</a></li><li><a href="https://link.springer.com/article/10.1007/s10618-008-0114-1">Controlled experiments on the web survey and guide</a></li><li><a href="https://www.researchgate.net/publication/322969314_Consistent_Transformation_of_Ratio_Metrics_for_Efficient_Online_Controlled_Experiments">Consistent Transformation of Ratio Metrics for Efficient Online Controlled Experiments</a></li><li><a href="https://en.wikipedia.org/wiki/Ratio_estimator">Ratio estimator</a></li></ol><h3>Thank You!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b1d13411c22" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>