Skip to main content
Statistics LibreTexts

12.1: Analysis of Variance (ANOVA)

  • Page ID
    58320
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives
    • Define ANOVA (Analysis of Variance) and explain its purpose in statistical analysis.
    • Use ANOVA to compare the means of three or more groups.
    • Interpret ANOVA results to determine whether at least one group mean differs significantly from the others.
    • Distinguish between variation between groups and within groups in ANOVA.
    • Identify appropriate situations for using ANOVA, such as experiments, surveys, or studies with multiple categories or treatments.

    Introduction

    For this lesson, we will compare the differences between three or more population means using the F-test. The hypotheses testing will be the following:

    \(H_o: \mu_1 = \mu_2= \mu_3 = ...=\mu_k\)

    \(H_1: \) At least one of the means \(\mu_1, \mu_2, \mu_3,..., \mu_k \) are not equal

    With an F-test, we can compare all the means at the same time. The F-test value is a ratio between two different variances. If the variances are similar, the F-value should be close to 1. If the variances are different, then the F-value will not equal one but it will be greater or lower in value.

    \(F = \dfrac{s_1^2}{s_2^2}\)

    For this section, we will compare the variance between the three groups with the variances within the three groups.

    \(F = \dfrac{\text{variance between groups}}{\text{variance within groups}}\)

    In this case, for the groups to show evidence of different means, the variance between groups should be greater than the variance within groups. Below is an illustration, to help understand this concept.

    Low F-Value and High F-Value Comparison.
    Figure \(\PageIndex{1}\): Low F-Value and High F-Value Comparison

    If there is enough evidence to show a significant difference between these variances, then we can say we have enough statistical evidence to conclude there is a difference between the population means based on a certain α-level. The method we discussed above is called analysis of variance or ANOVA.

    Assumptions Needed to Perform an ANOVA Test:

    1. Each population from which a sample is taken is assumed to be normal.
    2. All samples are randomly selected and independent.
    3. The populations are assumed to have equal standard deviations (or variances).
    4. From each population, the samples must be simple random samples.

    ANOVA follows the same steps for hypothesis testing (P-value method).

    1. State the hypotheses \(H_0​​​​\) and \(H_1​​​​\).
    2. Find the p-value.
    3. Compare the p-value with \(\alpha​​​​\).
    4. Determine if there is enough statistical evidence to reject \(H_o​​​​\) (or support \(H_1​​​​\)).
    5. Summarize the result.

    Application of Analysis of Variance (ANOVA) Using P-Value Method

    Now let us look at an example to better understand the ANOVA method and how we can use it to compare the difference between three population means and make a conclusion based on statistical evidence.

    Example \(\PageIndex{1}\) ANOVA Test on Weights of Men in Different Cities

    Groups of men from three different cities in the United States are to be tested for population mean weight. The entries in the table below are the weights for the different groups. Is there enough evidence to conclude the difference between the mean weights of the three groups with \(\alpha\) = 0.05?

    Data Values
    Los Angeles
    Austin
    New York
    216
    202
    170
    198
    213
    165
    222
    244
    182
    184
    228
    197
    191
    210
    201

    Table \(\PageIndex{1}\): Three Samples of Weights of Men from the Cities of Los Angeles, Austin, and New York.

    Attribution: "Introductory Statistics" by Barbara Illowsky and Susan Dean, OpenStax is licensed under CC BY 4.0

    1. Please state the hypotheses.

    \(H_o: \mu_1 = \mu_2= \mu_3\)

    \(H_1: \) At least one of the means is not equal

    1. Find the P-value from our TI-84 graphing calculator.
      1. Press the [STAT] button.
      2. On the screen, highlight [EDIT], select 1: Edit…, and press the [ENTER] button.
      3. Put your data from each group (Los Angeles, Austin, and New York) in columns L1, L2, and L3. If everything is done correctly, it should look like the image below:
    Men's weight from Los Angeles, Austin ,New York are in thre different lists.
    Figure \(\PageIndex{1}\): Men's weight from Los Angeles is in L1, Austin is in L2, and New York is in L3.
    1. Press the [STAT] button again.
    2. On the screen, highlight [TESTS], scroll down, and select H:ANOVA( . Then, press the [ENTER] button.
    3. It should put ANOVA( on the screen.
    4. To enter L1 on the screen, press [2ND], then press the 1 button.
    5. Press [,] (comma) button. It is above the 7 button.
    6. To enter L2 on the screen, press [2ND] then press the 2 button.
    7. Press [,] (comma) button.
    8. To enter L3 on the screen, press [2ND] then press the 3 button. Finally, press the right parenthesis [ ) ] above the 9 button.
    9. If the instructions in Step 2 are done correctly, then the screen should look like the following:
    Calculator screen shows ANOVA(L1, L2, L3)
    Figure \(\PageIndex{2}\): Calculator Screen Shows ANOVA(L1, L2, L3)
    1. For the last step, press the ENTER button. If everything is done correctly, then your screen should show the following image on the next page.
    Calculator screen displays the p-value for ANOVA test.
    Figure \(\PageIndex{3}\): Calculator Screen Displays the P-value for ANOVA Test
    1. The screen shows that the P-value = 0.0137920794
    1. Compare the p-value with \(\alpha\) and determine if we have enough evidence to reject \(H_o\) (or support \(H_1\) if that is the claim). If not given, then we assume it is equal to 0.05.
    • If your p-value is less than \(\alpha\), we reject \(H_o\) (or support \(H_1\) )
    • If your p-value is more than \(\alpha\), we do not reject \(H_o\) (or not support \(H_1\) )

    Since p-value = 0.0138 < \(\alpha\) = 0.05, the result is to reject H0.

    1. Determine if there is enough statistical evidence to reject \(H_o​​​​\) (or support \(H_1​​​​\)).

    Since the claim is \(H_1\), write the summary in terms of \(H_1\). Since the p-value is less than our \(\alpha \), the result of the test supports \(H_1\).

    1. Summarize the results.

    There is enough statistical evidence to support the claim that there is a difference between the mean weight of men in the three cities based on an α-level of 0.05.

    Hypothesis Testing for ANOVA Using Traditional Method

    1. State the hypotheses \(H_o​​​​\) and \(H_1​​​​\).
    2. Determine critical value in F-distribution table using \(\alpha​​​​\), degrees of freedom of the numerator = k – 1 (k = number of classes/groups), and degrees of freedom of the denominator = N – k (N = total number of data values)
    3. Compute the test point.
    4. Determine if there is enough statistical evidence to reject \(H_o​​​​\) (or support \(H_1​​​​\)).
    5. Summarize the result.
    Example \(\PageIndex{2}\)

    A nutritionist conducted a 12-week study to compare the effectiveness of three popular weight loss diets: Keto, Intermittent Fasting, and Mediterranean. Participants were randomly assigned to one of the three diets, and their weight loss (in pounds) at the end of the study was recorded. The goal is to determine whether there is a statistically significant difference in average weight loss among the three diets using a one-way ANOVA test with a significance level of \( \alpha\) = 0.05.

    Data Values
    Keto Intermittent Fasting Mediterranean
    12 8 6
    15 11 5
    14 9 7
    10 10 6
    13 7 4

    Table \(\PageIndex{3}\): Three Samples of Pounds Loss for People on Three Diets: Keto, Intermittent Fasting, and Mediterranean.

    1. Please state the hypotheses.

    \(H_o: \mu_1 = \mu_2= \mu_3\)

    \(H_1: \) At least one of the means is not equal (Claim)

    1. Determine the critical value.
    • k = 3, as there are 3 different diets.
    • N =15, as there are 15 given data values.
    • Degrees of Freedom of the numerator k - 1 = 3 - 1 = 2
    • Degrees of freedom of the denominator = N - k = 15 - 3= 12
    • Look up the critical value in the F-distribution with \(\alpha\) = 0.05.
    • The value is 3.89.
    1. Use a graphing calculator or other technology to compute the test point. Below is the output of the TI-84+ found using the same steps as example 1 above.
    Calculator screen displays the test point for ANOVA test.
    Figure \(\PageIndex{4}\): Calculator Screen Displays the Test Point for ANOVA Test

    The test point is F = 24.04, rounded to two decimal places.

    1. Decide whether to reject H0 or not.
    Reject the null hypothesis as the test point falls in the critical region.
    Figure \(\PageIndex{5}\): Reject the Null Hypothesis as the Test Point Falls in the Critical Region

    Since the test point F = 24.04 > critical value = 3.89, the result is to reject H0.

    1. Summarize the results.

    There is enough evidence to support the claim that there is significant weight loss among the three diets.

    Exercises

    1. Citrus College wants to analyze whether the mean GPA of students differs across three majors: Art, STEM, and Nursing. A random sample of 10 students from each major was selected, and their GPAs were recorded. Conduct a one-way ANOVA test at a 5% significance level to determine if there is a statistically significant difference in the mean GPA among the three majors. Use the traditional method.
    A random sample of 10 students from each major
    Art STEM Nursing
    2.80 3.40 3.50
    3.00 3.60 3.70
    2.90 3.80 3.60
    3.10 3.50 3.80
    3.20 3.70 3.40
    2.70 3.40 3.50
    3.00 3.60 3.90
    3.30 3.80 3.70
    2.90 3.50 3.60
    3.10 3.60 3.80

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. Citrus College wants to analyze whether the mean GPA of students differs across three majors: Art, STEM, and Nursing. A random sample of 10 students from each major was selected, and their GPAs were recorded. Conduct a one-way ANOVA test at a 5% significance level to determine if there is a statistically significant difference in the mean GPA among the three majors. Use the p-value method.
    A random sample of 10 students from each major
    Art STEM Nursing
    2.80 3.40 3.50
    3.00 3.60 3.70
    2.90 3.80 3.60
    3.10 3.50 3.80
    3.20 3.70 3.40
    2.70 3.40 3.50
    3.00 3.60 3.90
    3.30 3.80 3.70
    2.90 3.50 3.60
    3.10 3.60 3.80

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. Citrus College wants to determine if the average height of players is the same across three sports teams: Baseball, Basketball, and Football. A random sample of 8 players from each team was selected, and their heights (in inches) were recorded. Conduct a one-way ANOVA test at a 10% significance level to determine if the mean heights among the three teams are the same. Use the traditional method.
    A random sample of 8 students from each sport
    Baseball Basketball Football
    68.5 74.3 70.1
    70.2 75.8 72.3
    69.4 76.0 71.9
    71.1 73.5 73.2
    68.9 74.7 72.5
    69.7 75.4 70.8
    70.0 76.2 71.4
    69.3 75.9 72.0

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. Citrus College wants to determine if the average height of players is the same across three sports teams: Baseball, Basketball, and Football. A random sample of 8 players from each team was selected, and their heights (in inches) were recorded. Conduct a one-way ANOVA test at a 10% significance level to determine if the mean heights among the three teams are the same. Use the p-value method.
    A random sample of 8 students from each sport
    Baseball Basketball Football
    68.5 74.3 70.1
    70.2 75.8 72.3
    69.4 76.0 71.9
    71.1 73.5 73.2
    68.9 74.7 72.5
    69.7 75.4 70.8
    70.0 76.2 71.4
    69.3 75.9 72.0

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. A Statistics instructor at Citrus College wants to examine whether the type of course format (Hybrid, Face-to-Face, or Online) has an impact on student performance on the final exam. The instructor collects a random sample of 6 students from each format and records their final exam scores. Using a significance level of 0.05, test whether there is a statistically significant difference in the average final exam scores among the three instructional formats. Use the traditional method.
    A random sample of 6 students from each course format
    Hybrid Face-to-Face Online
    78 81 75
    82 77 76
    75 79 78
    80 80 74
    79 78 79
    77 76 81

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. A Statistics instructor at Citrus College wants to examine whether the type of course format (Hybrid, Face-to-Face, or Online) has an impact on student performance on the final exam. The instructor collects a random sample of 6 students from each format and records their final exam scores. Using a significance level of 0.05, test whether there is a statistically significant difference in the average final exam scores among the three instructional formats. Use the p-value method.
    A random sample of 6 students from each course format
    Hybrid Face-to-Face Online
    78 81 75
    82 77 76
    75 79 78
    80 80 74
    79 78 79
    77 76 81

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    Answers

    If you are an instructor and want the solutions to all the exercise questions for each section, please email Toros Berberyan.


    This page titled 12.1: Analysis of Variance (ANOVA) is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Toros Berberyan, Tracy Nguyen, and Alfie Swan.

    • Was this article helpful?