Two-proportion Z-test
Statistical methods for comparing samples
- 12 min read
- 8 chapters
Related on Lably
Through Statistical hypothesis test, Central limit theorem and Normal distribution
The test is appropriate when each observation is independent from another, can be classified as a success or failure (i.e., a Bernoulli trial) and the sample sizes are large enough that the sampling distribution of each sample proportion is well approximated by the central limit theorem. Under those conditions the observed difference of sample proportions can be converted to a standardized z-statistic (using a pooled standard error) and compared to the standard normal distribution to obtain p-values or form confidence intervals for the difference in proportions (derived slightly differently). This also allows to determine required sample-size for a minimum-detectable-effect calculations.
The test is related to other well known tests such as Pearson's chi-squared test, Fisher's exact test for small samples, and McNemar's test for paired binary data.
Definition
The two-proportion Z-test or two-sample proportion Z-test is a statistical method used to determine whether the difference between the proportions of two groups, coming from a binomial distribution is statistically significant. This approach relies on the observation that (for a sufficiently large samples) the sample proportions follow a normal distribution under the Central Limit Theorem, allowing the construction of a z-test for hypothesis testing (a Score test) and confidence interval estimation (a Wald test). It is used in various fields to compare success rates, response rates, or other proportions across different groups.
Sign in to keep reading
7 more chapters are free with a Lably account.
Hypothesis test
The z-test for comparing two proportions is a frequentist statistical hypothesis test used to evaluate whether two independent samples have different population proportions for a binary outcome. Under mild regularity conditions (sufficiently large sample sizes and independent sampling), the sample proportions (which is the average of observations coming from a Bernoulli distribution) are approximately normally distributed under the central limit theorem, which permits using a z-statistic constructed from the difference of sample proportions and an estimated standard error.
The test involves two competing hypotheses:
- null hypothesis (H0): The proportions in the two populations are equal, i.e., .
- alternative hypothesis (H1): The proportions in the two populations are not equal, i.e., (two-tailed) or / (one-tailed).
The z-statistic for comparing two proportions is computed using:where and are the sample proportion in the first and second sample, and are the size of the first and second sample, respectively, is pooled proportion, calculated as , where and are the counts of successes in the two samples The pooled proportion is used to estimate the shared probability of success under the null hypothesis, and the standard error accounts for variability across the two samples.
The z-test determines statistical significance by comparing the calculated z-statistic to a critical value. E.g., for a significance level of we reject the null hypothesis if (for a two-tailed test). Or, alternatively, by computing the p-value and rejecting the null hypothesis if .
Confidence interval
The confidence interval for the difference between two proportions, based on the definitions above, is:where is the critical value of the standard normal distribution (e.g., 1.96 for a 95% confidence level).
This interval provides a range of plausible values for the true difference between population proportions.
Notice how the variance estimation is different between the hypothesis testing and the confidence intervals. The first uses a pooled variance (based on the null hypothesis), while the second has to estimate the variance using each sample separately (so as to allow for the confidence interval to accommodate a range of differences in proportions). This difference may lead to slightly different results if using the confidence interval as an alternative to the hypothesis testing method.
Sample size determination and Minimum detectable effect
Sample size determination is the act of choosing the number of observations to include in each group for running the statistical test. For the Two-proportion Z-test, this is closely-related with deciding on the minimum detectable effect.
For finding the required sample size (given some effect size , power , and type I error ), we define that , (when κ = 1, equal sample size is assumed for each group), then:
The minimum detectable effect or MDE is the smallest difference between two proportions ( and ) that a statistical test can detect for a chosen type I error level (), statistical power (), and sample sizes ( and ). It is commonly used in study design to determine whether the sample sizes allows for a test with sufficient sensitivity to detect meaningful differences.
The MDE for when using the (two-sided) z-test formula for comparing two proportions, incorporating critical values for and , and the standard errors of the proportions:where is critical value for the significance level, is quantile for the desired power, and is when assuming the null is correct.
The MDE depends on the sample sizes, baseline proportions (), and test parameters. When the baseline proportions are not known, they need to be assumed or roughly estimated from a small study. Larger samples or smaller power requirements leads to a smaller MDE, making the test more sensitive to smaller differences. Researchers may use the MDE to assess the feasibility of detecting meaningful differences before conducting a study.
Assumptions and conditions
To ensure valid results, the following assumptions must be met:
- Independent random samples: The samples must be drawn independently from the populations of interest.
- Large sample sizes: Typically, should exceed 20.
- Success or failure condition:
- and
- and
The z-test is most reliable when sample sizes are large, and all assumptions are satisfied.
Relation to other statistical methods
Related tests
Using the z-test for hypothesis testing (Score test) would give the same results as Pearson's chi-squared test for a two-by-two contingency table. Fisher's exact test is more suitable for when the sample sizes are small.
Treatment of 2-by-2 contingency table has been investigated as early as the 19th century, with further work during the 20th century.
Notice that:
- When one or more cell counts are small (e.g. below 5), prefer exact tests (e.g., Fisher's exact test) or exact confidence intervals.
- For paired or matched binary data use McNemar's test rather than the two-sample z-test.
- The choice between pooled and unpooled variance matters: pooled variance is appropriate for hypothesis testing of equality (), whereas the unpooled variance is used for confidence intervals.
- Multiple testing, selection effects, and nonrandom sampling can invalidate p-values and CIs; these design issues should be addressed in the study methods.
In Bayesian inference context, proportions can be modeled using the Beta distribution. The parallel to two proportion z-test is performing similar inference using the difference of two Beta distributions.
Newcombe's method
The standard asymptotic confidence interval (Wald interval) for the difference between proportions can suffer from poor coverage probabilities, particularly when the sample sizes are small or the proportions are close to 0 or 1. Additionally, the Wald method can sometimes produce "overshoot" limits that extend beyond the meaningful [−1, 1] range. To address this, Robert G. Newcombe proposed a highly robust alternative method based on the Wilson score interval.
Newcombe's method computes the confidence interval for the difference by first calculating these individual score intervals for each sample proportion independently. Let be the lower and upper bounds for , and be the lower and upper bounds for . The interval bounds for a given sample proportion with sample size are calculated as: where is the critical value from the standard normal distribution (e.g., 1.96 for a 95% confidence level).
Once the individual bounds are calculated, the lower limit and upper limit for the difference between the two proportions are constructed as follows:
This method is frequently recommended over the traditional Wald method because its resulting interval is strictly bounded between −1 and 1, and it aligns much more closely with the nominal confidence level without requiring a continuity correction.
Example
Suppose group 1 has 120 successes out of 1000 trials () and group 2 has 150 successes out of 1000 trials (). The pooled proportion is . The pooled standard error is
The z-statistic isgiving a two-sided p-value of about 0.0497 (just under 0.05). An approximate 95% confidence interval for the difference using the unpooled standard error isBecause the 95% CI (just barely) excludes 0 and the p-value is ≈0.0497, the difference is statistically significant at the 5% level by the usual large-sample criteria (but is borderline; conclusions should account for study context and multiple testing if applicable).
Software implementation
Implementations are available in many statistical environments. See below for implementation details in some popular languages. Other implementations also exists for SPSS, SAS, and Minitab.
R
Use prop.test() with continuity correction disabled:
<span id="mwAT8"></span><span class="nf" id="mwAUA">prop.test</span><span class="p" id="mwAUE">(</span><span class="n" id="mwAUI">x</span><span class="w" id="mwAUM"> </span><span class="o" id="mwAUQ">=</span><span class="w" id="mwAUU"> </span><span class="nf" id="mwAUY">c</span><span class="p" id="mwAUc">(</span><span class="m" id="mwAUg">120</span><span class="p" id="mwAUk">,</span><span class="w" id="mwAUo"> </span><span class="m" id="mwAUs">150</span><span class="p" id="mwAUw">),</span><span class="w" id="mwAU0"> </span><span class="n" id="mwAU4">n</span><span class="w" id="mwAU8"> </span><span class="o" id="mwAVA">=</span><span class="w" id="mwAVE"> </span><span class="nf" id="mwAVI">c</span><span class="p" id="mwAVM">(</span><span class="m" id="mwAVQ">1000</span><span class="p" id="mwAVU">,</span><span class="w" id="mwAVY"> </span><span class="m" id="mwAVc">1000</span><span class="p" id="mwAVg">),</span><span class="w" id="mwAVk"> </span><span class="n" id="mwAVo">correct</span><span class="w" id="mwAVs"> </span><span class="o" id="mwAVw">=</span><span class="w" id="mwAV0"> </span><span class="kc" id="mwAV4">FALSE</span><span class="p" id="mwAV8">)</span>
Output includes z-test equivalent results: chi-squared statistic, p-value, and confidence interval:
<span id="mwAWM"></span> 2-sample test for equality of proportions without continuity correction data: c(120, 150) out of c(1000, 1000) X-squared = 3.8536, df = 1, p-value = 0.04964 alternative hypothesis: two.sided 95 percent confidence interval: -5.992397e-02 -7.602882e-05 sample estimates: prop 1 prop 2 0.12 0.15
Python
Use proportions_ztest from statsmodels:
<span id="mwAW0"></span><span class="kn" id="mwAW4">from</span><span class="w" id="mwAW8"> </span><span class="nn" id="mwAXA">statsmodels.stats.proportion</span><span class="w" id="mwAXE"> </span><span class="kn" id="mwAXI">import</span> <span class="n" id="mwAXM">proportions_ztest</span> <span class="n" id="mwAXQ">z</span><span class="p" id="mwAXU">,</span> <span class="n" id="mwAXY">p</span> <span class="o" id="mwAXc">=</span> <span class="n" id="mwAXg">proportions_ztest</span><span class="p" id="mwAXk">([</span><span class="mi" id="mwAXo">120</span><span class="p" id="mwAXs">,</span> <span class="mi" id="mwAXw">150</span><span class="p" id="mwAX0">],</span> <span class="p" id="mwAX4">[</span><span class="mi" id="mwAX8">1000</span><span class="p" id="mwAYA">,</span> <span class="mi" id="mwAYE">1000</span><span class="p" id="mwAYI">],</span> <span class="mi" id="mwAYM">0</span><span class="p" id="mwAYQ">)</span> <span class="c1" id="mwAYU"># For CI: from statsmodels.stats.proportion import test_proportions_2indep</span>
SQL
Direct implementation of the formulas from above, using Presto flavour of SQL (relying on VALUES, inverse_normal_cdf, and normal_cdf)
<span id="mwAZc"></span><span class="k" id="mwAZg">WITH</span><span class="w" id="mwAZk"> </span><span class="n" id="mwAZo">input_data</span><span class="w" id="mwAZs"> </span><span class="k" id="mwAZw">AS</span><span class="w" id="mwAZ0"> </span><span class="p" id="mwAZ4">(</span> <span class="w" id="mwAZ8"> </span><span class="k" id="mwAaA">SELECT</span><span class="w" id="mwAaE"> </span><span class="o" id="mwAaI">*</span><span class="p" id="mwAaM">,</span><span class="w" id="mwAaQ"> </span><span class="p" id="mwAaU">((</span><span class="n" id="mwAaY">n_1</span><span class="w" id="mwAac"> </span><span class="o" id="mwAag">*</span><span class="w" id="mwAak"> </span><span class="n" id="mwAao">p_1</span><span class="w" id="mwAas"> </span><span class="o" id="mwAaw">+</span><span class="w" id="mwAa0"> </span><span class="n" id="mwAa4">n_2</span><span class="w" id="mwAa8"> </span><span class="o" id="mwAbA">*</span><span class="w" id="mwAbE"> </span><span class="n" id="mwAbI">p_2</span><span class="p" id="mwAbM">)</span><span class="w" id="mwAbQ"> </span><span class="o" id="mwAbU">/</span><span class="w" id="mwAbY"> </span><span class="p" id="mwAbc">(</span><span class="n" id="mwAbg">n_1</span><span class="w" id="mwAbk"> </span><span class="o" id="mwAbo">+</span><span class="w" id="mwAbs"> </span><span class="n" id="mwAbw">n_2</span><span class="p" id="mwAb0">))</span><span class="w" id="mwAb4"> </span><span class="k" id="mwAb8">AS</span><span class="w" id="mwAcA"> </span><span class="n" id="mwAcE">p_pooled</span> <span class="w" id="mwAcI"> </span><span class="k" id="mwAcM">FROM</span><span class="w" id="mwAcQ"> </span><span class="p" id="mwAcU">(</span> <span class="w" id="mwAcY"> </span><span class="k" id="mwAcc">VALUES</span> <span class="w" id="mwAcg"> </span><span class="p" id="mwAck">(</span><span class="mi" id="mwAco">1000</span><span class="p" id="mwAcs">,</span><span class="w" id="mwAcw"> </span><span class="mi" id="mwAc0">1000</span><span class="p" id="mwAc4">,</span><span class="w" id="mwAc8"> </span><span class="mi" id="mwAdA">0</span><span class="p" id="mwAdE">.</span><span class="mi" id="mwAdI">12</span><span class="p" id="mwAdM">,</span><span class="w" id="mwAdQ"> </span><span class="mi" id="mwAdU">0</span><span class="p" id="mwAdY">.</span><span class="mi" id="mwAdc">15</span><span class="p" id="mwAdg">)</span> <span class="w" id="mwAdk"> </span><span class="p" id="mwAdo">)</span><span class="w" id="mwAds"> </span><span class="k" id="mwAdw">AS</span><span class="w" id="mwAd0"> </span><span class="n" id="mwAd4">t</span><span class="w" id="mwAd8"> </span><span class="p" id="mwAeA">(</span><span class="n" id="mwAeE">n_1</span><span class="p" id="mwAeI">,</span><span class="w" id="mwAeM"> </span><span class="n" id="mwAeQ">n_2</span><span class="p" id="mwAeU">,</span><span class="w" id="mwAeY"> </span><span class="n" id="mwAec">p_1</span><span class="p" id="mwAeg">,</span><span class="w" id="mwAek"> </span><span class="n" id="mwAeo">p_2</span><span class="p" id="mwAes">)</span> <span class="p" id="mwAew">),</span> <span class="n" id="mwAe0">stats_computed</span><span class="w" id="mwAe4"> </span><span class="k" id="mwAe8">AS</span><span class="w" id="mwAfA"> </span><span class="p" id="mwAfE">(</span> <span class="w" id="mwAfI"> </span><span class="k" id="mwAfM">SELECT</span> <span class="w" id="mwAfQ"> </span><span class="n" id="mwAfU">n_1</span><span class="p" id="mwAfY">,</span><span class="w" id="mwAfc"> </span><span class="n" id="mwAfg">n_2</span><span class="p" id="mwAfk">,</span><span class="w" id="mwAfo"> </span><span class="n" id="mwAfs">p_1</span><span class="p" id="mwAfw">,</span><span class="w" id="mwAf0"> </span><span class="n" id="mwAf4">p_2</span><span class="p" id="mwAf8">,</span> <span class="w" id="mwAgA"> </span><span class="n" id="mwAgE">p_2</span><span class="w" id="mwAgI"> </span><span class="o" id="mwAgM">-</span><span class="w" id="mwAgQ"> </span><span class="n" id="mwAgU">p_1</span><span class="w" id="mwAgY"> </span><span class="k" id="mwAgc">AS</span><span class="w" id="mwAgg"> </span><span class="n" id="mwAgk">p2_minus_p1</span><span class="p" id="mwAgo">,</span> <span class="w" id="mwAgs"> </span><span class="n" id="mwAgw">SQRT</span><span class="p" id="mwAg0">(</span> <span class="w" id="mwAg4"> </span><span class="p" id="mwAg8">(</span><span class="n" id="mwAhA">p_1</span><span class="w" id="mwAhE"> </span><span class="o" id="mwAhI">*</span><span class="w" id="mwAhM"> </span><span class="p" id="mwAhQ">(</span><span class="mi" id="mwAhU">1</span><span class="w" id="mwAhY"> </span><span class="o" id="mwAhc">-</span><span class="w" id="mwAhg"> </span><span class="n" id="mwAhk">p_1</span><span class="p" id="mwAho">)</span><span class="w" id="mwAhs"> </span><span class="o" id="mwAhw">/</span><span class="w" id="mwAh0"> </span><span class="n" id="mwAh4">n_1</span><span class="p" id="mwAh8">)</span><span class="w" id="mwAiA"> </span><span class="o" id="mwAiE">+</span> <span class="w" id="mwAiI"> </span><span class="p" id="mwAiM">(</span><span class="n" id="mwAiQ">p_2</span><span class="w" id="mwAiU"> </span><span class="o" id="mwAiY">*</span><span class="w" id="mwAic"> </span><span class="p" id="mwAig">(</span><span class="mi" id="mwAik">1</span><span class="w" id="mwAio"> </span><span class="o" id="mwAis">-</span><span class="w" id="mwAiw"> </span><span class="n" id="mwAi0">p_2</span><span class="p" id="mwAi4">)</span><span class="w" id="mwAi8"> </span><span class="o" id="mwAjA">/</span><span class="w" id="mwAjE"> </span><span class="n" id="mwAjI">n_2</span><span class="p" id="mwAjM">)</span> <span class="w" id="mwAjQ"> </span><span class="p" id="mwAjU">)</span><span class="w" id="mwAjY"> </span><span class="k" id="mwAjc">AS</span><span class="w" id="mwAjg"> </span><span class="n" id="mwAjk">se_p2_minus_p1</span><span class="p" id="mwAjo">,</span> <span class="w" id="mwAjs"> </span><span class="n" id="mwAjw">SQRT</span><span class="p" id="mwAj0">(</span><span class="w" id="mwAj4"> </span><span class="n" id="mwAj8">p_pooled</span><span class="w" id="mwAkA"> </span><span class="o" id="mwAkE">*</span><span class="w" id="mwAkI"> </span><span class="p" id="mwAkM">(</span><span class="mi" id="mwAkQ">1</span><span class="w" id="mwAkU"> </span><span class="o" id="mwAkY">-</span><span class="w" id="mwAkc"> </span><span class="n" id="mwAkg">p_pooled</span><span class="p" id="mwAkk">)</span><span class="w" id="mwAko"> </span><span class="o" id="mwAks">*</span><span class="w" id="mwAkw"> </span><span class="p" id="mwAk0">(</span><span class="mi" id="mwAk4">1</span><span class="p" id="mwAk8">.</span><span class="mi" id="mwAlA">0</span><span class="w" id="mwAlE"> </span><span class="o" id="mwAlI">/</span><span class="w" id="mwAlM"> </span><span class="n" id="mwAlQ">n_1</span><span class="w" id="mwAlU"> </span><span class="o" id="mwAlY">+</span><span class="w" id="mwAlc"> </span><span class="mi" id="mwAlg">1</span><span class="p" id="mwAlk">.</span><span class="mi" id="mwAlo">0</span><span class="w" id="mwAls"> </span><span class="o" id="mwAlw">/</span><span class="w" id="mwAl0"> </span><span class="n" id="mwAl4">n_2</span><span class="p" id="mwAl8">)</span><span class="w" id="mwAmA"> </span><span class="p" id="mwAmE">)</span><span class="w" id="mwAmI"> </span><span class="k" id="mwAmM">AS</span><span class="w" id="mwAmQ"> </span><span class="n" id="mwAmU">pooled_se</span><span class="p" id="mwAmY">,</span> <span class="w" id="mwAmc"> </span><span class="n" id="mwAmg">inverse_normal_cdf</span><span class="p" id="mwAmk">(</span><span class="mi" id="mwAmo">0</span><span class="p" id="mwAms">,</span><span class="w" id="mwAmw"> </span><span class="mi" id="mwAm0">1</span><span class="p" id="mwAm4">,</span><span class="w" id="mwAm8"> </span><span class="mi" id="mwAnA">0</span><span class="p" id="mwAnE">.</span><span class="mi" id="mwAnI">975</span><span class="p" id="mwAnM">)</span><span class="w" id="mwAnQ"> </span><span class="k" id="mwAnU">AS</span><span class="w" id="mwAnY"> </span><span class="n" id="mwAnc">z_975</span><span class="w" id="mwAng"> </span><span class="c1" id="mwAnk">-- for 95% CI (1.96)</span> <span class="w" id="mwAno"> </span><span class="k" id="mwAns">FROM</span><span class="w" id="mwAnw"> </span><span class="n" id="mwAn0">input_data</span> <span class="p" id="mwAn4">)</span> <span class="k" id="mwAn8">SELECT</span> <span class="w" id="mwAoA"> </span><span class="n" id="mwAoE">n_1</span><span class="p" id="mwAoI">,</span> <span class="w" id="mwAoM"> </span><span class="n" id="mwAoQ">n_2</span><span class="p" id="mwAoU">,</span> <span class="w" id="mwAoY"> </span><span class="n" id="mwAoc">ROUND</span><span class="p" id="mwAog">(</span><span class="n" id="mwAok">p_1</span><span class="p" id="mwAoo">,</span><span class="w" id="mwAos"> </span><span class="mi" id="mwAow">3</span><span class="p" id="mwAo0">)</span><span class="w" id="mwAo4"> </span><span class="k" id="mwAo8">AS</span><span class="w" id="mwApA"> </span><span class="n" id="mwApE">p_1</span><span class="p" id="mwApI">,</span> <span class="w" id="mwApM"> </span><span class="n" id="mwApQ">ROUND</span><span class="p" id="mwApU">(</span><span class="n" id="mwApY">p_2</span><span class="p" id="mwApc">,</span><span class="w" id="mwApg"> </span><span class="mi" id="mwApk">3</span><span class="p" id="mwApo">)</span><span class="w" id="mwAps"> </span><span class="k" id="mwApw">AS</span><span class="w" id="mwAp0"> </span><span class="n" id="mwAp4">p_2</span><span class="p" id="mwAp8">,</span> <span class="w" id="mwAqA"> </span><span class="n" id="mwAqE">ROUND</span><span class="p" id="mwAqI">(</span><span class="n" id="mwAqM">p2_minus_p1</span><span class="p" id="mwAqQ">,</span><span class="w" id="mwAqU"> </span><span class="mi" id="mwAqY">3</span><span class="p" id="mwAqc">)</span><span class="w" id="mwAqg"> </span><span class="k" id="mwAqk">AS</span><span class="w" id="mwAqo"> </span><span class="n" id="mwAqs">p2_minus_p1</span><span class="p" id="mwAqw">,</span> <span class="w" id="mwAq0"> </span><span class="n" id="mwAq4">ROUND</span><span class="p" id="mwAq8">(</span><span class="n" id="mwArA">se_p2_minus_p1</span><span class="p" id="mwArE">,</span><span class="w" id="mwArI"> </span><span class="mi" id="mwArM">3</span><span class="p" id="mwArQ">)</span><span class="w" id="mwArU"> </span><span class="k" id="mwArY">AS</span><span class="w" id="mwArc"> </span><span class="n" id="mwArg">se_p2_minus_p1</span><span class="p" id="mwArk">,</span> <span class="w" id="mwAro"> </span><span class="n" id="mwArs">ROUND</span><span class="p" id="mwArw">(</span><span class="n" id="mwAr0">p2_minus_p1</span><span class="w" id="mwAr4"> </span><span class="o" id="mwAr8">-</span><span class="w" id="mwAsA"> </span><span class="n" id="mwAsE">z_975</span><span class="w" id="mwAsI"> </span><span class="o" id="mwAsM">*</span><span class="w" id="mwAsQ"> </span><span class="n" id="mwAsU">se_p2_minus_p1</span><span class="p" id="mwAsY">,</span><span class="w" id="mwAsc"> </span><span class="mi" id="mwAsg">3</span><span class="p" id="mwAsk">)</span><span class="w" id="mwAso"> </span><span class="k" id="mwAss">AS</span><span class="w" id="mwAsw"> </span><span class="n" id="mwAs0">p2_minus_p1_ci_lower</span><span class="p" id="mwAs4">,</span> <span class="w" id="mwAs8"> </span><span class="n" id="mwAtA">ROUND</span><span class="p" id="mwAtE">(</span><span class="n" id="mwAtI">p2_minus_p1</span><span class="w" id="mwAtM"> </span><span class="o" id="mwAtQ">+</span><span class="w" id="mwAtU"> </span><span class="n" id="mwAtY">z_975</span><span class="w" id="mwAtc"> </span><span class="o" id="mwAtg">*</span><span class="w" id="mwAtk"> </span><span class="n" id="mwAto">se_p2_minus_p1</span><span class="p" id="mwAts">,</span><span class="w" id="mwAtw"> </span><span class="mi" id="mwAt0">3</span><span class="p" id="mwAt4">)</span><span class="w" id="mwAt8"> </span><span class="k" id="mwAuA">AS</span><span class="w" id="mwAuE"> </span><span class="n" id="mwAuI">p2_minus_p1_ci_upper</span><span class="p" id="mwAuM">,</span> <span class="w" id="mwAuQ"> </span><span class="n" id="mwAuU">ROUND</span><span class="p" id="mwAuY">(</span><span class="mi" id="mwAuc">2</span><span class="w" id="mwAug"> </span><span class="o" id="mwAuk">*</span><span class="w" id="mwAuo"> </span><span class="p" id="mwAus">(</span><span class="mi" id="mwAuw">1</span><span class="w" id="mwAu0"> </span><span class="o" id="mwAu4">-</span><span class="w" id="mwAu8"> </span><span class="n" id="mwAvA">normal_cdf</span><span class="p" id="mwAvE">(</span><span class="mi" id="mwAvI">0</span><span class="p" id="mwAvM">,</span><span class="w" id="mwAvQ"> </span><span class="mi" id="mwAvU">1</span><span class="p" id="mwAvY">,</span><span class="w" id="mwAvc"> </span><span class="k" id="mwAvg">ABS</span><span class="p" id="mwAvk">(</span><span class="n" id="mwAvo">p2_minus_p1</span><span class="p" id="mwAvs">)</span><span class="o" id="mwAvw">/</span><span class="n" id="mwAv0">pooled_se</span><span class="w" id="mwAv4"> </span><span class="p" id="mwAv8">)),</span><span class="w" id="mwAwA"> </span><span class="mi" id="mwAwE">3</span><span class="p" id="mwAwI">)</span><span class="w" id="mwAwM"> </span><span class="k" id="mwAwQ">AS</span><span class="w" id="mwAwU"> </span><span class="n" id="mwAwY">p_value</span> <span class="k" id="mwAwc">FROM</span><span class="w" id="mwAwg"> </span><span class="n" id="mwAwk">stats_computed</span><span class="p" id="mwAwo">;</span>

