{"id":3248,"date":"2024-03-24T14:30:46","date_gmt":"2024-03-24T13:30:46","guid":{"rendered":"https:\/\/www.gironi.it\/blog\/?p=3248"},"modified":"2026-03-06T09:17:43","modified_gmt":"2026-03-06T08:17:43","slug":"guide-to-statistical-tests-for-a-b-analysis","status":"publish","type":"post","link":"https:\/\/www.gironi.it\/blog\/en\/guide-to-statistical-tests-for-a-b-analysis\/","title":{"rendered":"Guide to Statistical Tests for A\/B Analysis"},"content":{"rendered":"\n<p><strong>Statistical tests<\/strong> are fundamental tools for data analysis and informed decision-making. Choosing the appropriate test depends on the characteristics of the data, the hypotheses to be tested, and the underlying assumptions.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>In this blog, I have separately covered each of the main statistical tests with dedicated articles. It is indeed crucial to understand the applicability conditions of each test to obtain reliable results and correct interpretations.<\/p>\n\n\n\n<p>What I aim to do in this article is to provide an &#8220;overview,&#8221; placing side by side the most common tests that can find daily applicability for a multitude of analyses related to the world of web marketing and for effective A\/B tests. This is a first comparative look, which should ideally push for the necessary in-depth study of each individual topic, but which I wanted to accompany with very simple practical examples, in order to stimulate the reader&#8217;s curiosity.<\/p>\n\n\n\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-1e8b188e      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tThe Tests We Will Discuss\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#il-test-z\" class=\"uagb-toc-link__trigger\">Il Test Z<\/a><li class=\"uagb-toc__list\"><a href=\"#students-t-test\" class=\"uagb-toc-link__trigger\">Student&#039;s t-Test<\/a><li class=\"uagb-toc__list\"><a href=\"#welchs-t-test\" class=\"uagb-toc-link__trigger\">Welch&#039;s t-Test<\/a><li class=\"uagb-toc__list\"><a href=\"#the-chi-square-test\" class=\"uagb-toc-link__trigger\">The Chi-square Test<\/a><li class=\"uagb-toc__list\"><a href=\"#analysis-of-variance-anova\" class=\"uagb-toc-link__trigger\">Analysis of Variance (ANOVA)<\/a><li class=\"uagb-toc__list\"><a href=\"#mann-whitney-u-test\" class=\"uagb-toc-link__trigger\">Mann-Whitney U Test<\/a><li class=\"uagb-toc__list\"><a href=\"#fishers-exact-test\" class=\"uagb-toc-link__trigger\">Fisher&#039;s Exact Test<\/a><li class=\"uagb-toc__list\"><a href=\"#an-overview-a-table\" class=\"uagb-toc-link__trigger\">An Overview: a Table<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<h3 class=\"wp-block-heading\">Il Test Z<\/h3>\n\n\n\n<p class=\"has-light-gray-background-color has-background\">The Z test is a statistical hypothesis test used <strong>to verify if the sample mean differs significantly from the population mean<\/strong>, when the population variance is known and the sample size is large (usually greater than 30).<\/p>\n\n\n\n<p>The Z test applies when the following conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The sample size is large (n > 30) <\/li>\n\n\n\n<li>The population variance is known <\/li>\n\n\n\n<li>The data is approximately normally distributed<\/li>\n<\/ul>\n\n\n\n<p>he Z test is used to determine if there is a significant difference between two means of proportions, such as click-through rates. It can be used, for example, to verify if the introduction of a new feature on a website has led to a significant increase in the conversion rate.<\/p>\n\n\n\n<p><strong>Example Case:<\/strong> An e-commerce site wants to test if a new version of the shopping cart has improved the conversion rate. The previous conversion rate is 5% with a known variance of 0.0025. After collecting a sample of 500 users, the new observed conversion rate is 6%. Let&#8217;s verify if the difference is statistically significant using the Z test.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Original conversion rate<br>p0 &lt;- 0.05<br># Original variance<br>var0 &lt;- 0.0025<br># Sample size<br>n &lt;- 500<br># Observed conversion rate<br>p1 &lt;- 0.06<br><br># Z test calculation<br>z &lt;- (p1 - p0) \/ sqrt(var0\/n)<br>z<br><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">[1] 4.472136<\/pre>\n\n\n\n<p>The observed z value is 4.47. Assuming a significance level of 0.05, the critical z value is 1.96. Since the observed value is greater than 1.96, we can reject the null hypothesis and conclude that the difference in the conversion rate is statistically significant.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Student&#8217;s t-Test<\/h3>\n\n\n\n<p class=\"has-light-gray-background-color has-background\">Student&#8217;s t-test is a statistical hypothesis test used to verify if the mean of a sample differs significantly from a hypothetical value or if two samples have significantly different means. This test applies when the population variance is unknown and the sample size is small (usually less than 30).<\/p>\n\n\n\n<p>Student&#8217;s t-test applies when the following conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The sample size is small (n &lt; 30) <\/li>\n\n\n\n<li>The population variance is unknown <\/li>\n\n\n\n<li>The data is approximately normally distributed<\/li>\n<\/ul>\n\n\n\n<p>Student&#8217;s t-test is used to compare the means of two distinct groups, such as the average time spent on the site for users who saw variant A compared to those who saw variant B.<br><\/p>\n\n\n\n<p><strong>Example Case: <\/strong>A company wants to test if a new landing page has an impact on the average time spent on the site. An A\/B experiment is conducted with 20 users for each group. The average time spent on the site for the control group is 3 minutes, while for the test group it is 4 minutes. Let&#8217;s verify if the difference is statistically significant using Student&#8217;s t-test.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Control group data<br>control &lt;- c(2.5, 3.1, 2.8, 3.2, 2.9, 3.5, 3.0, 2.7, 3.3, 2.6, 3.4, 3.1, 2.8, 2.9, 3.2, 3.0, 3.1, 2.7, 3.3, 2.8)<br><br># Test group data<br>test &lt;- c(3.8, 4.2, 3.9, 4.1, 4.3, 3.7, 4.5, 4.0, 3.6, 4.2, 4.1, 3.9, 4.3, 3.8, 4.0, 4.2, 3.7, 4.4, 4.1, 3.9)<br><br># Student's t-test<br>t.test(test, control, alternative = \"greater\")<br><br>data:  test and control<br>t = 12.585, df = 37.611, p-value = 2.354e-15<br>alternative hypothesis: true difference in means is greater than 0<br>95 percent confidence interval:<br> 0.900641      Inf<br>sample estimates:<br>mean of x mean of y <br>    4.035     2.995 <\/pre>\n\n\n\n<p>Student&#8217;s t-test provides a p-value less than the significance level of 0.05; therefore, we can reject the null hypothesis and conclude that the difference in average time spent on the site between the two groups is statistically significant.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Welch&#8217;s t-Test<\/h3>\n\n\n\n<p class=\"has-light-gray-background-color has-background\">Welch&#8217;s t-test is a variant of Student&#8217;s t-test that does not require the assumption of equal variances between the two samples. This test applies when the sample sizes and variances are different.<\/p>\n\n\n\n<p>Welch&#8217;s t-test applies when the following conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The sample sizes are different <\/li>\n\n\n\n<li>The sample variances are different <\/li>\n\n\n\n<li>The data is approximately normally distributed<\/li>\n<\/ul>\n\n\n\n<p>Welch&#8217;s t-test is used to compare the means of two distinct groups, such as the average income of users who made a purchase on an e-commerce site compared to those who did not make purchases.<\/p>\n\n\n\n<p><strong>Example Case<\/strong>: A company wants to test if the average income of users who made a purchase differs from that of users who did not make purchases. An experiment is conducted with 30 users who made a purchase and 20 users who did not make purchases. The average income of users who made a purchase is $50,000, while that of users who did not make purchases is $40,000. Let&#8217;s verify if the difference is statistically significant using Welch&#8217;s t-test.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Buyers group data<br>buyers &lt;- c(48000, 52000, 49000, 51000, 47000, 55000, 53000, 50000, 46000, 54000,<br>            49000, 52000, 51000, 48000, 53000, 47000, 54000, 50000, 49000, 52000,<br>            48000, 51000, 53000, 47000, 52000, 49000, 50000, 51000, 48000, 53000)<br><br># Non-buyers group data<br>non_buyers &lt;- c(38000, 42000, 39000, 41000, 37000, 43000, 40000, 39000, 42000, 38000,<br>                41000, 40000, 39000, 42000, 37000, 41000, 38000, 39000, 40000, 41000)<br><br># Welch's t-test<br>t.test(buyers, non_buyers, alternative = \"greater\", var.equal = FALSE)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">Welch Two Sample t-test\n\ndata:  buyers and non_buyers\nt = 17.811, df = 47.626, p-value &lt; 2.2e-16\nalternative hypothesis: true difference in means is greater than 0\n95 percent confidence interval:\n 9556.368      Inf\nsample estimates:\nmean of x mean of y \n    50400     39850 <\/pre>\n\n\n\n<p>Welch&#8217;s t-test provides a p-value of 2.2e-16. Since this value is less than the significance level of 0.05, we can reject the null hypothesis and conclude that the difference in average income between users who made a purchase and those who did not make purchases is statistically significant.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Chi-square Test<\/h3>\n\n\n\n<p class=\"has-light-gray-background-color has-background\">The chi-square test is a non-parametric statistical test used to verify if there is a significant relationship between two categorical variables or if the observed distribution of a categorical variable differs from the expected distribution.<\/p>\n\n\n\n<p>The chi-square test applies when the following conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The variables are categorical <\/li>\n\n\n\n<li>The samples are independent <\/li>\n\n\n\n<li>The expected frequencies in each cell of the contingency table are greater than 5<\/li>\n<\/ul>\n\n\n\n<p>The chi-square test is used to analyze the association between two categorical variables, such as the relationship between users&#8217; gender and preference for a particular product.<br><\/p>\n\n\n\n<p><strong>Example Case:<\/strong> A clothing store wants to understand if there is a relationship between users&#8217; gender and preference for a particular product line. A survey is conducted on 200 users, of which 100 are men and 100 are women. The results show that 60 men and 40 women prefer product line A, while 40 men and 60 women prefer product line B. Let&#8217;s verify if there is a significant relationship between gender and preference using the chi-square test.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Observed data<br>observed &lt;- matrix(c(60, 40, 40, 60), nrow = 2, byrow = TRUE)<br>rownames(observed) &lt;- c(\"Uomini\", \"Donne\")<br>colnames(observed) &lt;- c(\"Linea A\", \"Linea B\")<br>observed<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">##        Line A Line B<br>## Men        60     40<br>## Women      40     60<br><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># Chi-square test<br>chisq.test(observed)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">## Pearson's Chi-squared test with Yates' continuity correction\n\n## data:  observed\n## X-squared = 7.22, df = 1, p-value = 0.00721\n<\/pre>\n\n\n\n<p>The chi-square test provides a p-value of 0.00721. Since this value is less than the significance level of 0.05, we can reject the null hypothesis and conclude that there is a significant relationship between users&#8217; gender and preference for a particular product line.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Analysis of Variance (ANOVA)<\/h3>\n\n\n\n<p class=\"has-light-gray-background-color has-background\">Analysis of variance (ANOVA) is a statistical test used to compare the means of three or more groups and determine if there are significant differences between them.<br><\/p>\n\n\n\n<p>Analysis of variance applies when the following conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The data is approximately normally distributed <\/li>\n\n\n\n<li>The variances of the groups are equal (<em>homoscedasticity<\/em>) <\/li>\n\n\n\n<li>The samples are independent<\/li>\n<\/ul>\n\n\n\n<p>Analysis of variance is used to compare the means of different versions of a product, different marketing strategies, or different sales techniques.<\/p>\n\n\n\n<p><strong>Example Case:<\/strong> A company wants to test the effectiveness of three different marketing strategies (A, B, and C) on average monthly revenue. 15 stores are selected for each strategy and the average monthly revenue is recorded for a period of 6 months. Let&#8217;s verify if there is a significant difference between the marketing strategies using analysis of variance.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Dati<br>fatturato_A &lt;- c(120000, 115000, 130000, 125000, 110000, 135000, 118000, 122000, 127000, 115000, 128000, 120000, 124000, 117000, 121000)<br>fatturato_B &lt;- c(112000, 118000, 110000, 115000, 122000, 108000, 120000, 114000, 116000, 119000, 111000, 117000, 113000, 121000, 109000)<br>fatturato_C &lt;- c(105000, 110000, 108000, 112000, 107000, 115000, 111000, 109000, 113000, 106000, 108000, 114000, 110000, 112000, 107000)<br><br># Data<br>revenue_A &lt;- c(120000, 115000, 130000, 125000, 110000, 135000, 118000, 122000, 127000, 115000, 128000, 120000, 124000, 117000, 121000)<br>revenue_B &lt;- c(112000, 118000, 110000, 115000, 122000, 108000, 120000, 114000, 116000, 119000, 111000, 117000, 113000, 121000, 109000)<br>revenue_C &lt;- c(105000, 110000, 108000, 112000, 107000, 115000, 111000, 109000, 113000, 106000, 108000, 114000, 110000, 112000, 107000)<br><br># Analysis of variance<br>anova_result &lt;- aov(c(revenue_A, revenue_B, revenue_C) ~ rep(c(\"A\", \"B\", \"C\"), each = 15))<br>summary(anova_result)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">                                 Df    Sum Sq   Mean Sq F value   Pr(&gt;F)    \nrep(c(\"A\", \"B\", \"C\"), each = 15)  2 1.086e+09 543200000    22.7 2.07e-07 ***\nResiduals                        42 1.005e+09  23923810                     \n---\nSignif. codes:  0 \u2018***\u2019 0.001 \u2018**\u2019 0.01 \u2018*\u2019 0.05 \u2018.\u2019 0.1 \u2018 \u2019 1<\/pre>\n\n\n\n<p>The analysis of variance provides a p-value of 2.07e-07. Since this value is less than the significance level of 0.05, we can reject the null hypothesis and conclude that there is a significant difference in average monthly revenue between the three marketing strategies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Mann-Whitney U Test<\/h3>\n\n\n\n<p class=\"has-light-gray-background-color has-background\">The Mann-Whitney U test is a non-parametric test used to compare the means of two independent groups when the data does not meet the normality or equal variance requirements required for Student&#8217;s t-test.<\/p>\n\n\n\n<p>The Mann-Whitney U test applies when the following conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The data is not normally distributed <\/li>\n\n\n\n<li>The variances of the groups are not equal <\/li>\n\n\n\n<li>The samples are independent<\/li>\n<\/ul>\n\n\n\n<p>The Mann-Whitney U test is used to compare the means of two distinct groups, such as the average revenues of two different advertising campaigns.<\/p>\n\n\n\n<p><strong>Example Case:<\/strong> A company wants to compare the average revenues of two different advertising campaigns, A and B. Revenue data is collected from 15 stores for each campaign. Let&#8217;s verify if there is a significant difference between the two campaigns using the Mann-Whitney U test.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Campaign A data<br>revenue_A &lt;- c(12000, 15000, 10000, 13000, 11000, 14000, 12500, 13500, 11500, 14500, 12200, 13800, 11800, 12700, 13200)<br><br># Campaign B data<br>revenue_B &lt;- c(11000, 14000, 13000, 12000, 15000, 11500, 13500, 12500, 14500, 11800, 13200, 12700, 14200, 11600, 13800)<br><br># Mann-Whitney U test<br>wilcox.test(revenue_A, revenue_B, alternative = \"two.sided\", correct = FALSE)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\tWilcoxon rank sum test<br><br>data:  revenue_A and revenue_B<br>W = 102.5, p-value = 0.6779<br>alternative hypothesis: true location shift is not equal to 0<\/pre>\n\n\n\n<p>The Mann-Whitney U test provides a p-value of 0.6779. Since this value is greater than the significance level of 0.05, we cannot reject the null hypothesis and cannot conclude that there is a significant difference in average revenues between the two advertising campaigns.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Fisher&#8217;s Exact Test<\/h3>\n\n\n\n<p class=\"has-light-gray-background-color has-background\">Fisher&#8217;s exact test is a non-parametric statistical test used to analyze the association between two categorical variables in 2\u00d72 contingency tables, especially when sample sizes are small.<\/p>\n\n\n\n<p>Fisher&#8217;s exact test applies when the following conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The variables are categorical <\/li>\n\n\n\n<li>The samples are independent <\/li>\n\n\n\n<li>The sample sizes are small (one or more cells in the contingency table have expected values less than 5)<\/li>\n<\/ul>\n\n\n\n<p>Fisher&#8217;s exact test is used to analyze the association between two categorical variables, such as the relationship between the use of a particular drug and the occurrence of a side effect.<\/p>\n\n\n\n<p><strong>Example Case:<\/strong> In a clinical study on a new drug for the treatment of hypertension, 15 patients who took the drug and 10 patients who took a placebo are observed. Of the 15 patients who took the drug, 3 experienced a side effect, while of the 10 patients who took the placebo, 1 experienced the side effect. Let&#8217;s verify if there is a significant association between taking the drug and the occurrence of the side effect using Fisher&#8217;s exact test.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Data<br>side_effect &lt;- c(3, 12, 1, 9)<br>dim(side_effect) &lt;- c(2, 2)<br>rownames(side_effect) &lt;- c(\"Drug\", \"Placebo\")<br>colnames(side_effect) &lt;- c(\"Side effect\", \"No side effect\")<br>side_effect<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">        Side effect No side effect<br>Drug               3              1<br>Placebo           12              9<br><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># Fisher's exact test<br>fisher.test(side_effect)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\tFisher's Exact Test for Count Data<br><br>data:  side_effect<br>p-value = 0.6265<br>alternative hypothesis: true odds ratio is not equal to 1<br>95 percent confidence interval:<br>   0.145667 130.928066<br>sample estimates:<br>odds ratio <br>  2.183137<\/pre>\n\n\n\n<p>Fisher&#8217;s exact test provides a p-value of 0.6265. Since this value is greater than the significance level of 0.05, we cannot reject the null hypothesis and cannot conclude that there is a significant association between taking the drug and the occurrence of the side effect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Regression Analysis<\/h2>\n\n\n\n<p class=\"has-light-gray-background-color has-background\">Regression analysis is a set of statistical techniques used to model the relationship between a dependent variable (or response variable) and one or more independent variables (or explanatory variables).<\/p>\n\n\n\n<p>Regression analysis applies when the following conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>There is a linear relationship between the dependent variable and the independent variables <\/li>\n\n\n\n<li>The residuals are normally distributed and homoscedastic (i.e., have constant variance) <\/li>\n\n\n\n<li>The observations are independent<\/li>\n<\/ul>\n\n\n\n<p>Regression analysis is used to understand the impact of different independent variables on a dependent variable, such as the effect of age, income, and education level on the consumption of a particular product category.<\/p>\n\n\n\n<p><strong>Example Case: <\/strong>A clothing company wants to analyze the impact of age, income, and education level on annual clothing consumption. Data is collected on a sample of 100 individuals. We use multiple linear regression analysis to model the relationship between annual clothing consumption (dependent variable) and age, income, and education level (independent variables).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Data<br>consumption &lt;- c(1200, 1500, 2000, 1800, 2200, 1700, 2100, 1900, 1600, 2300, 1400, 1800, 2100, 1700, 2000, 1600, 1900, 2200, 1500, 1800)<br>age &lt;- c(25, 35, 42, 30, 38, 28, 45, 33, 27, 40, 22, 31, 39, 26, 37, 24, 32, 41, 29, 36)<br>income &lt;- c(35000, 45000, 60000, 50000, 55000, 40000, 65000, 48000, 38000, 70000, 32000, 46000, 58000, 42000, 52000, 37000, 49000, 62000, 40000, 51000)<br>education &lt;- c(2, 3, 4, 3, 4, 2, 4, 3, 2, 4, 2, 3, 4, 2, 3, 2, 3, 4, 3, 3)<br><br># Multiple linear regression model<br>model &lt;- lm(consumption ~ age + income + education)<br>summary(model)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">Call:<br>lm(formula = consumption ~ age + income + education)<br><br>Residuals:<br>    Min      1Q  Median      3Q     Max <br>-261.06  -93.14   39.80   66.26  223.24 <br><br>Coefficients:<br>              Estimate Std. Error t value Pr(>|t|)   <br>(Intercept) 639.775078 165.734340   3.860  0.00139 **<br>age         -13.127175  14.699870  -0.893  0.38509   <br>income        0.030875   0.008645   3.571  0.00255 **<br>education    34.426950 107.969978   0.319  0.75396   <br>---<br>Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1<br><br>Residual standard error: 128.1 on 16 degrees of freedom<br>Multiple R-squared:  0.8404,\tAdjusted R-squared:  0.8105 <br>F-statistic: 28.08 on 3 and 16 DF,  p-value: 1.302e-06<\/pre>\n\n\n\n<p><strong>Coefficients:<\/strong> The output shows the coefficients for each independent variable in the model. In this case, the independent variables are &#8216;age&#8217;, &#8216;income&#8217;, and &#8216;education&#8217;. The intercept coefficient is 639.775078.<\/p>\n\n\n\n<p><strong>Significance:<\/strong> The &#8216;income&#8217; variable is statistically significant at the 5% significance level (since the p-value is less than 0.05), while the &#8216;age&#8217; and &#8216;education&#8217; variables are not. This suggests that only &#8216;income&#8217; has a significant impact on &#8216;consumption&#8217;.<\/p>\n\n\n\n<p><strong>R-squared:<\/strong> The R-squared value is 0.8404, which indicates that about 84% of the variation in &#8216;consumption&#8217; can be explained by the variables &#8216;age&#8217;, &#8216;income&#8217;, and &#8216;education&#8217;. However, the adjusted R-squared value is 0.8105, which suggests that when accounting for the number of independent variables in the model, about 81% of the variation in &#8216;consumption&#8217; can be explained by these variables.<\/p>\n\n\n\n<p><strong>F-statistic: <\/strong>The F-statistic value is 28.08 with a p-value of 1.302e-06, which indicates that the overall model is statistically significant.<\/p>\n\n\n\n<p>The model suggests that &#8216;income&#8217; is the only significant predictor of &#8216;consumption&#8217;. However, the model as a whole is significant and explains a large portion of the variation in &#8216;consumption&#8217;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">An Overview: a Table<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Statistical Test<\/strong><\/th><th><strong>Conditions of Applicability<\/strong><\/th><th><strong>Advantages<\/strong><\/th><th><strong>Disadvantages<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Z Test<\/strong><\/td><td>Large sample size (n &gt; 30).<br>Known population variance.<br>Normally distributed data.<\/td><td>Simple to calculate and interpret.<br>Suitable for large samples.<\/td><td>Requires knowledge of population variance.<br>Not suitable for small samples.<\/td><\/tr><tr><td><strong>Student&#8217;s t-Test<\/strong><\/td><td>Small sample size (n &lt; 30).<br>Unknown population variance.<br>Normally distributed data.<\/td><td>Suitable for small samples.<br>Does not require knowledge of population variance.<\/td><td>Assumes normality of data.<\/td><\/tr><tr><td><strong>Welch&#8217;s t-Test<\/strong><\/td><td>Different sample sizes.<br>Different variances.<br>Normally distributed data.<\/td><td>Does not require the assumption of equal variances.<\/td><td>Assumes normality of data.<\/td><\/tr><tr><td><strong>Chi-Square Test<\/strong><\/td><td>Categorical variables.<br>Independent samples.<br>Expected frequencies &gt; 5 per cell.<\/td><td>Suitable for categorical variables.<br>Does not require assumptions about distribution.<\/td><td>Can be inaccurate if expected frequencies are too low.<\/td><\/tr><tr><td><strong>ANOVA<\/strong><\/td><td>Normally distributed data.<br>Homoscedasticity (equal variances).<br>Independent samples.<\/td><td>Allows comparison of more than two groups simultaneously.<\/td><td>Requires assumptions of normality and homoscedasticity.<\/td><\/tr><tr><td><strong>Mann-Whitney U Test<\/strong><\/td><td>Non-normally distributed data.<br>Different variances. Independent samples.<\/td><td>Does not require assumptions about distribution or equality of variances.<\/td><td>Less powerful than parametric tests if assumptions are met.<\/td><\/tr><tr><td><strong>Fisher&#8217;s Exact Test<\/strong><\/td><td>Categorical variables.<br>Independent samples.<br>Small sample sizes.<\/td><td>Accurate for small samples.<br>Suitable for 2&#215;2 contingency tables.<\/td><td>Not suitable for large samples or larger contingency tables.<\/td><\/tr><tr><td><strong>Regression Analysis<\/strong><\/td><td>Linear relationship between variables.<br>Normally distributed and homoscedastic residuals.<br>Independent observations.<\/td><td>Allows modeling of the relationship between variables.<br>Identifies significant predictors.<\/td><td>Requires assumptions about residuals and linearity.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Before running any A\/B test, make sure you have enough data to detect a meaningful difference. Use our <a href=\"https:\/\/www.gironi.it\/blog\/en\/ab-test-sample-size-calculator\/\">free sample size calculator<\/a> to determine how many users you need per variant based on your baseline conversion rate and the minimum effect you want to detect.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Statistical tests are fundamental tools for data analysis and informed decision-making. Choosing the appropriate test depends on the characteristics of the data, the hypotheses to be tested, and the underlying assumptions.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[161],"tags":[300],"class_list":["post-3248","post","type-post","status-publish","format-standard","hentry","category-statistics","tag-statistical-tests"],"lang":"en","translations":{"en":3248,"it":3111},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"paolo","author_link":"https:\/\/www.gironi.it\/blog\/author\/paolo\/"},"uagb_comment_info":102,"uagb_excerpt":"Statistical tests are fundamental tools for data analysis and informed decision-making. Choosing the appropriate test depends on the characteristics of the data, the hypotheses to be tested, and the underlying assumptions.","_links":{"self":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/comments?post=3248"}],"version-history":[{"count":9,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3248\/revisions"}],"predecessor-version":[{"id":3500,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3248\/revisions\/3500"}],"wp:attachment":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/media?parent=3248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/categories?post=3248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/tags?post=3248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}