{"id":3303,"date":"2021-10-03T14:53:00","date_gmt":"2021-10-03T13:53:00","guid":{"rendered":"https:\/\/www.gironi.it\/blog\/?p=3303"},"modified":"2026-11-11T10:45:14","modified_gmt":"2026-11-11T09:45:14","slug":"analysis-of-variance-anova-explained-simply","status":"publish","type":"post","link":"https:\/\/www.gironi.it\/blog\/en\/analysis-of-variance-anova-explained-simply\/","title":{"rendered":"Analysis of Variance: ANOVA Explained Simply"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Three Google Ads campaigns. Or four landing pages, or five versions of a newsletter. The averages seem different: but are these real differences or just statistical noise?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is exactly the problem that <strong>Analysis of Variance (ANOVA)<\/strong> solves: determining whether at least one group differs genuinely from the others, without falling into the trap of running dozens of separate comparisons.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\"><strong>In short:<\/strong> <strong>ANOVA<\/strong> (analysis of variance) tests whether the means of three or more groups are all equal or whether at least one differs from the others. It does so by comparing the variability <em>between<\/em> the groups with the variability <em>within<\/em> them: their ratio is the <strong>F<\/strong> statistic. If the means are equal, the two variances estimate the same quantity; a large enough F (p-value below the chosen threshold) is evidence against the hypothesis that the means are equal. ANOVA tells us <em>whether<\/em> there is a difference, not <em>where<\/em>: to find out which groups differ we need post-hoc tests such as Tukey&#8217;s HSD; to find out <em>how much<\/em> it matters, \u03b7\u00b2. In R: <code>summary(aov(y ~ group))<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The term &#8220;analysis of variance&#8221; sounds counterintuitive: we are comparing means, not variances. The name comes from the way the test uses variances to determine whether the means differ. ANOVA compares the variance of the means <em>between<\/em> groups with the variance <em>within<\/em> each group. If the former is sufficiently larger than the latter, we have evidence that the groups are not equivalent.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"intuition\">The Intuition in a Metaphor<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let us imagine three school classes. In each class the students have fairly similar grades (low within-group variance), but the class averages are very different (high between-group variance). In this case it is easy to conclude that the classes are genuinely different.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If instead the grades within each class vary wildly \u2014 brilliant students next to struggling ones \u2014 distinguishing one class from another becomes much harder, even if the averages look different. The within-group variability &#8220;drowns out&#8221; the differences between groups.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is what ANOVA is all about: a ratio between the variability <em>between<\/em> groups and the variability <em>within<\/em> groups. When the former clearly dominates the latter, the F value grows and we have evidence against the null hypothesis.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"when\">When to Use ANOVA<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ANOVA is a parametric test. It requires a few conditions:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Normality<\/strong>: data in each group should approximate a normal distribution \u2014 the F statistic assumes that residuals follow a normal distribution<\/li><li><strong>Homogeneity of variances<\/strong>: groups should have approximately equal variances (homoscedasticity), otherwise the pooled variance estimate becomes biased<\/li><li><strong>Independence<\/strong>: observations are independent of each other \u2014 no observation should influence another<\/li><li><strong>Continuous dependent variable<\/strong> and <strong>categorical independent variable<\/strong> (the factor, with two or more levels)<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-not-ttests\">Why ANOVA Instead of Multiple t-Tests?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A natural question arises: why use ANOVA when we could simply compare every pair of groups with a <a href=\"https:\/\/www.gironi.it\/blog\/en\/the-two-sample-t-test-how-to-test-a-hypothesis-for-dependent-or-independent-samples\/\">t-test<\/a>?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem is not the inconvenience of running many tests. The problem is that <strong>each test has a probability \u03b1 of producing a false positive<\/strong> (Type I error). When we run many independent tests, these probabilities accumulate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For k groups, the number of pairwise comparisons is:<\/p>\n\n\n\n<p class=\"has-text-align-center\">\\( \\displaystyle n = \\frac{k(k-1)}{2} \\)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With 4 groups that would be 6 t-tests. The probability of committing <em>at least one<\/em> Type I error becomes:<\/p>\n\n\n\n<p class=\"has-text-align-center\">\\( \\displaystyle 1 &#8211; (1 &#8211; \\alpha)^n \\)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With \u03b1 = 0.05 and n = 6:<\/p>\n\n\n\n<p class=\"has-text-align-center\">\\( \\displaystyle 1 &#8211; (1 &#8211; 0.05)^6 = 1 &#8211; 0.735 = 0.265 \\)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is 26.5%: more than one in four. Unacceptable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>When comparing three or more groups, ANOVA is preferable<\/strong> because it runs a single test with a single \u03b1, controlling the overall error rate.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"one-way\">The Simplest Case: One-Way ANOVA<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One-way ANOVA is the simplest form. The data are organised into groups based on a single categorical variable (the factor). The question is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&gt; Are the observed differences between the means too large to be attributed to chance?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let us formalise the hypotheses:<\/p>\n\n\n\n<p class=\"has-text-align-center\">\\( \\displaystyle H_0: \\mu_1 = \\mu_2 = \\dots = \\mu_k \\)<\/p>\n\n\n\n<p class=\"has-text-align-center\">\\( \\displaystyle H_a: \\text{at least one mean differs from the others} \\)<\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#f5f7f9;margin-top:2.5rem;margin-bottom:2.5rem;padding-top:1.5rem;padding-right:1.5rem;padding-bottom:1.5rem;padding-left:1.5rem\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p><strong>Important<\/strong>: ANOVA tells us THAT a difference exists, not WHERE it is. To identify which groups differ, we need a <em>post-hoc<\/em> test, which we will see shortly.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"interpret-f\">How to Interpret the F Value<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The core of ANOVA is the F ratio:<\/p>\n\n\n\n<p class=\"has-text-align-center\">\\( \\displaystyle F = \\frac{\\text{variance between groups}}{\\text{variance within groups}} = \\frac{MS_b}{MS_e} \\)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the null hypothesis is true, both \\( MS_b \\) and \\( MS_e \\) estimate the same variance, and F is close to 1. If F is significantly greater than 1, we have evidence that the means are not all equal.<\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#f5f7f9;margin-top:2.5rem;margin-bottom:2.5rem;padding-top:1.5rem;padding-right:1.5rem;padding-bottom:1.5rem;padding-left:1.5rem\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p>ANOVA was developed by <strong>Ronald Fisher<\/strong> in the 1920s. The F statistic it relies on is named in his honour as the <strong>Fisher-Snedecor F distribution<\/strong>.<\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-4167\" src=\"https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2026\/07\/f-distribution.png\" alt=\"F distribution and critical region\"\/><figcaption class=\"wp-element-caption\">F distribution and critical region<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example\">A Step-by-Step Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let us take a concrete case. We want to know whether the type of device (desktop, mobile, tablet) affects goal completions on the site. For each device we take the goal completions on six days; for this example, we assume three independent samples of six days each:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Desktop<\/th><th>Mobile<\/th><th>Tablet<\/th><\/tr><\/thead><tbody><tr><td>39<\/td><td>45<\/td><td>30<\/td><\/tr><tr><td>67<\/td><td>54<\/td><td>45<\/td><\/tr><tr><td>78<\/td><td>64<\/td><td>22<\/td><\/tr><tr><td>59<\/td><td>52<\/td><td>39<\/td><\/tr><tr><td>42<\/td><td>46<\/td><td>38<\/td><\/tr><tr><td>51<\/td><td>35<\/td><td>41<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Group means:<\/p>\n\n\n\n<p class=\"has-text-align-center\">\\( \\displaystyle \\bar{x}_{\\text{desktop}} = 56 \\quad \\bar{x}_{\\text{mobile}} = 49.3 \\quad \\bar{x}_{\\text{tablet}} = 35.8 \\)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And the <strong>grand mean<\/strong> (mean of all observations): \\( \\bar{x} = 47 \\).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To understand where the F statistic comes from, we need to decompose the total variability into two parts: the variability <em>between<\/em> groups and the variability <em>within<\/em> groups. Without going through every manual calculation \u2014 nobody does them by hand anymore, as we will see shortly \u2014 from these we derive the respective variances (Mean Squares) and finally the F ratio.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Source<\/th><th>SS<\/th><th>df<\/th><th>MS<\/th><th>F<\/th><th>p<\/th><\/tr><\/thead><tbody><tr><td>Device (between)<\/td><td>1266.8<\/td><td>2<\/td><td>633.4<\/td><td><strong>4.86<\/strong><\/td><td><strong>0.0236<\/strong><\/td><\/tr><tr><td>Residual (within)<\/td><td>1954.2<\/td><td>15<\/td><td>130.3<\/td><td><\/td><td><\/td><\/tr><tr><td>Total<\/td><td>3220.9<\/td><td>17<\/td><td><\/td><td><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">F = 4.86 exceeds the critical value (3.68 for df = 2,15 and \u03b1 = 0.05). With a p-value of <strong>0.0236<\/strong>, we reject the null hypothesis: at least one device has a different mean.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"interpret-p\">How to Interpret the p-Value<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/www.gironi.it\/blog\/en\/p-value-misconceptions\/\">p-value<\/a> in ANOVA is read like any hypothesis test: it is the probability of observing an F value equal to or more extreme than the one obtained, assuming H\u2080 is true. A small p-value (typically &lt; 0.05) tells us that the observed differences are unlikely to be due to chance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But note: <strong>statistical significance does not mean practical importance<\/strong>. A very small p-value can hide a negligible effect if the sample is large. That is why we need effect size.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"effect-size\">Effect Size: \u03b7\u00b2 (Eta-Squared)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The p-value measures the evidence against the hypothesis that the means are equal. Eta-squared tells us <em>how much<\/em> the difference weighs: it is the share of the observed variability associated with the groups, a measure of <a href=\"https:\/\/www.gironi.it\/blog\/en\/effect-size-and-power-analysis\/\">effect size<\/a>.<\/p>\n\n\n\n<p class=\"has-text-align-center\">\\( \\displaystyle \\eta^2 = \\frac{SS_b}{SS_{\\text{total}}} = \\frac{1266.8}{3220.9} \\approx 0.39 \\)<\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#f5f7f9;margin-top:2.5rem;margin-bottom:2.5rem;padding-top:1.5rem;padding-right:1.5rem;padding-bottom:1.5rem;padding-left:1.5rem\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p>A very small p-value tells us that a difference probably exists. But it does not tell us whether that difference is large or negligible. That is why it is good practice to always accompany ANOVA with a measure of effect size.<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The conventional (Cohen&#8217;s) thresholds for \u03b7\u00b2:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>0.01<\/strong>: small effect<\/li><li><strong>0.06<\/strong>: medium effect<\/li><li><strong>0.14<\/strong>: large effect<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Our \u03b7\u00b2 = 0.39 is a very large effect: the type of device explains 39% of the variability in goal completions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"post-hoc\">What to Do After ANOVA: Post-Hoc Tests<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ANOVA tells us that a difference exists, but not which groups differ. For that we need <strong>post-hoc<\/strong> tests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The most common is <strong>Tukey&#8217;s HSD<\/strong> (Honestly Significant Difference), which compares all pairs of means while correcting for <a href=\"https:\/\/www.gironi.it\/blog\/en\/multiple-comparisons-bonferroni-benjamini-hochberg\/\">multiple comparisons<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In our example, Tukey HSD would tell us that the significant difference is between tablet and desktop, while the other pairs do not reach significance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"seo\">A Practical SEO Case: Does Time on Page Depend on Channel?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let us put ANOVA to work on a question anyone looking at site data eventually asks: do users coming from different channels behave differently?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We have time on page (in seconds) for 8 sessions from each of four channels:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>organic &lt;- c(98, 112, 85, 105, 92, 120, 88, 101)\ndirect  &lt;- c(90, 102, 78, 95, 110, 84, 99, 88)\npaid    &lt;- c(72, 65, 80, 58, 70, 75, 62, 68)\nsocial  &lt;- c(55, 48, 62, 50, 44, 58, 52, 46)\n\ntime   &lt;- c(organic, direct, paid, social)\nchannel &lt;- factor(rep(c(\"organic\",\"direct\",\"paid\",\"social\"), each = 8))<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Compute in R:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>summary(aov(time ~ channel))<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>             Df Sum Sq Mean Sq F value   Pr(&gt;F)\nchannel       3  11913    3971   46.82 4.89e-11 ***\nResiduals    28   2375      85<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">F = 46.82 and the p-value is on the order of 10\u207b\u00b9\u00b9: well below any reasonable threshold. We reject the null hypothesis: <strong>at least one channel<\/strong> behaves differently.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let us look at the means:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tapply(time, channel, mean)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code> direct organic    paid  social \n 93.250 100.125  68.750  51.875 <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Organic is the most engaged channel (100 seconds), followed by direct (93). Social stops at 52 seconds \u2014 traffic from feeds tends to bounce quickly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let us calculate \u03b7\u00b2 to understand the effect size:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>11913 \/ (11913 + 2375)  # \u2248 0.83<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>0.83<\/strong>: the channel explains 83% of the variability in time on page. A huge effect. In real-world settings such high values are quite rare: this example is deliberately constructed to make the method&#8217;s workings evident.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TukeyHSD(aov(time ~ channel))<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>                  diff        lwr        upr     p adj\norganic-direct   6.875  -5.697225  19.447225 0.4549371\npaid-direct    -24.500 -37.072225 -11.927775 0.0000652\nsocial-direct  -41.375 -53.947225 -28.802775 0.0000000\npaid-organic   -31.375 -43.947225 -18.802775 0.0000012\nsocial-organic -48.250 -60.822225 -35.677775 0.0000000\nsocial-paid    -16.875 -29.447225  -4.302775 0.0053389<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The post-hoc test confirms that all differences involving paid and social versus organic and direct are significant, and so is the one between social and paid (17 seconds, p = 0.005). The difference between organic and direct, however, is not statistically significant.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"assumptions\">Checking ANOVA Assumptions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before trusting the results, it is wise to verify the assumptions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Normality of residuals:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>model &lt;- aov(time ~ channel)\nshapiro.test(residuals(model))<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Homogeneity of variances (homoscedasticity):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bartlett.test(time ~ channel)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If these assumptions are violated, <a href=\"https:\/\/www.gironi.it\/blog\/en\/statistical-parametric-and-non-parametric-tests\/\">non-parametric<\/a> alternatives such as the <strong>Kruskal-Wallis test<\/strong> can be used (although it compares distributions rather than means) or, if the only problem is unequal variances, Welch&#8217;s ANOVA (<code>oneway.test()<\/code>).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"practice\">In Everyday Practice<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Nobody computes an ANOVA table by hand anymore. Programs like R, Python (scipy.stats), SPSS, or Jamovi perform the calculation in seconds. Understanding what the different components represent \u2014 the decomposition of variance, the F ratio, the degrees of freedom \u2014 remains essential for correctly interpreting the result.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"try\">Try It Yourself<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An e-commerce store ran three campaigns (A, B, C) and wants to know whether the average order value differs significantly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>camp_A &lt;- c(42, 38, 45, 50, 41, 47, 39, 44)\ncamp_B &lt;- c(48, 52, 46, 55, 50, 53, 49, 51)\ncamp_C &lt;- c(44, 40, 49, 43, 46, 41, 45, 47)\n\nvalue    &lt;- c(camp_A, camp_B, camp_C)\ncampaign &lt;- factor(rep(c(\"A\",\"B\",\"C\"), each = 8))\nsummary(aov(value ~ campaign))<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let us run the test, read F and the p-value, and compute \u03b7\u00b2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">F = <strong>10.77<\/strong>, p = <strong>0.0006<\/strong>, \u03b7\u00b2 = <strong>0.51<\/strong>. Campaign B (mean \u20ac50.5) performs better than A (\u20ac43.2) and C (\u20ac44.4), and the difference is statistically significant. Tukey HSD would confirm this by pointing at B.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">Frequently asked questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What is ANOVA in statistics?<\/strong><br> It is a test that compares the means of three or more groups in one go. It splits the variability of the data into a part due to differences between the groups and a part due to differences within them; divided by their degrees of freedom they become two variances (the mean squares), and their ratio is the F statistic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Does ANOVA work with only two groups?<\/strong><br> Yes, but in that case it is equivalent to a two-tailed t-test (and F = t\u00b2).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What do &#8220;one-way&#8221; and &#8220;two-way&#8221; mean?<\/strong><br> One-way: a single factor (e.g., channel). Two-way: two factors simultaneously (e.g., channel \u00d7 device), which also allows studying their interaction.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Can ANOVA be used with small samples?<\/strong><br> Yes, but normality and homoscedasticity should be checked, bearing in mind that with little data these checks have little power. ANOVA&#8217;s robustness depends on how balanced the groups are: with unequal group sizes and unequal variances it is better to switch to Welch&#8217;s ANOVA.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What if the assumptions do not hold?<\/strong><br> If the variances differ between groups, Welch&#8217;s ANOVA (oneway.test() in R) does not assume them equal; if the data are far from normal, the non-parametric Kruskal-Wallis test (kruskal.test()), which however tests a different hypothesis: it compares the distributions, and reads as a difference in location only if the groups have distributions of similar shape.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"What is ANOVA in statistics?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"It is a test that compares the means of three or more groups in one go. It splits the variability of the data into a part due to differences between the groups and a part due to differences within them; divided by their degrees of freedom they become two variances (the mean squares), and their ratio is the F statistic.\"}}, {\"@type\": \"Question\", \"name\": \"Does ANOVA work with only two groups?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes, but in that case it is equivalent to a two-tailed t-test (and F = t\u00b2).\"}}, {\"@type\": \"Question\", \"name\": \"What do \\\"one-way\\\" and \\\"two-way\\\" mean?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"One-way: a single factor (e.g., channel). Two-way: two factors simultaneously (e.g., channel \u00d7 device), which also allows studying their interaction.\"}}, {\"@type\": \"Question\", \"name\": \"Can ANOVA be used with small samples?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes, but normality and homoscedasticity should be checked, bearing in mind that with little data these checks have little power. ANOVA's robustness depends on how balanced the groups are: with unequal group sizes and unequal variances it is better to switch to Welch's ANOVA.\"}}, {\"@type\": \"Question\", \"name\": \"What if the assumptions do not hold?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"If the variances differ between groups, Welch's ANOVA (oneway.test() in R) does not assume them equal; if the data are far from normal, the non-parametric Kruskal-Wallis test (kruskal.test()), which however tests a different hypothesis: it compares the distributions, and reads as a difference in location only if the groups have distributions of similar shape.\"}}]}<\/script>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">ANOVA is one of those ideas that, once understood, we see everywhere: whenever we compare a continuous metric across multiple groups \u2014 channels, devices, variants, time periods \u2014 it is the right tool for not confusing noise with signal. And it is not an island: under the hood, analysis of variance and <a href=\"https:\/\/www.gironi.it\/blog\/en\/correlation-and-regression-analysis-linear-regression\/\">linear regression<\/a> are the same model, seen from two different angles. It is from that model \u2014 the linear model \u2014 that the most powerful part of applied statistics flows, and that is where our journey continues.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Further Reading<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analysis of variance in all its forms \u2014 one-way, two-way, repeated measures \u2014 is covered in <em>Statistics<\/em> by Newbold, Carlson and Thorne, for those who want to go beyond the introduction in this article. <a href=\"https:\/\/www.amazon.it\/dp\/8891910651?tag=consulenzeinf-21&amp;ascsubtag=analysis-of-variance-anova-explained-simply\" rel=\"nofollow sponsored noopener\" target=\"_blank\">Amazon<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Three Google Ads campaigns. Or four landing pages, or five versions of a newsletter. The averages seem different: but are these real differences or just statistical noise? This is exactly the problem that Analysis of Variance (ANOVA) solves: determining whether at least one group differs genuinely from the others, without falling into the trap of &hellip; <a href=\"https:\/\/www.gironi.it\/blog\/en\/analysis-of-variance-anova-explained-simply\/\" class=\"more-link\">Leggi tutto<span class=\"screen-reader-text\"> &#8220;Analysis of Variance: ANOVA Explained Simply&#8221;<\/span><\/a><\/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":[1228,287,1226],"class_list":["post-3303","post","type-post","status-publish","format-standard","hentry","category-statistics","tag-analysis-of-variance","tag-anova","tag-parametric-test"],"lang":"en","translations":{"en":3303,"it":2342},"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":205,"uagb_excerpt":"Three Google Ads campaigns. Or four landing pages, or five versions of a newsletter. The averages seem different: but are these real differences or just statistical noise? This is exactly the problem that Analysis of Variance (ANOVA) solves: determining whether at least one group differs genuinely from the others, without falling into the trap of&hellip;","_links":{"self":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3303","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=3303"}],"version-history":[{"count":5,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3303\/revisions"}],"predecessor-version":[{"id":4642,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3303\/revisions\/4642"}],"wp:attachment":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/media?parent=3303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/categories?post=3303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/tags?post=3303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}