This is one of the following seven articles on Two-Factor ANOVA With Replication in Excel

Two-Factor ANOVA With Replication in 5 Steps in Excel 2010 and Excel 2013

Variance Tests: Levene’s and Brown-Forsythe For 2-Factor ANOVA in Excel 2010 and Excel 2013

Shapiro-Wilk Normality Test in Excel For 2-Factor ANOVA With Replication

2-Factor ANOVA With Replication Effect Size in Excel 2010 and Excel 2013

Excel Post Hoc Tukey’s HSD Test For 2-Factor ANOVA With Replication

2-Factor ANOVA With Replication – Test Power With G-Power Utility

Scheirer-Ray-Hare Test Alternative For 2-Factor ANOVA With Replication

# Excel Post-Hoc Test

Tukey’s HSD for Two-

Factor ANOVA With

Replication

The F-test in ANOVA is classified as an omnibus test. An omnibus test is one that tests the overall significance of a model to determine whether a difference exists but not exactly where the difference is. The F Test of ANOVA tests the Null Hypothesis that states that all of the group means in that F Test are the same. When a significant result from the F Test (the p value is smaller than alpha) causes the Null Hypothesis to be rejected, further testing must be performed to determine which pairs of means are significantly different. That type of testing is called *post hoc* testing.

*Post hoc* testing is a pairwise comparison. Groups means are compared two at a time to determine whether the difference between the pair of means is significant.

## Post-Hoc Tests Used When

Group Variances Are Equal

SPSS lists the following Post-Hoc tests or corrections available when groups variances are equal:

LSD

Bonferroni

Sidak

Scheffe

REGWF

REGWQ

S-N-K

**Tukey (Tukey’s HSD or Tukey-Kramer)**

Tukey’s b

Duncan

Hochberg’s GT2

Gabriel

Waller-Duncan

Dunnett

Of all of the *post hoc* tests available when groups variances are found to be similar, Tukey’s HSD test is used much more often than the others. Tukey’s HSD can only be used when group sizes are exactly the same, which is the case for balanced two-factor ANOVA with replication.

**Tukey’s HSD (Honestly Significant Difference) Test** – Used When Group Sizes and Group Variances Are Equal

Tukey’s HSD test compares the difference between each pair of group means to determine which differences are large enough to be considered significant.

Tukey’s HSD test is very similar to a t-test except that it makes a correction for the experiment-wide error rate that a t-test doesn’t. The experiment-wide error rate is the increased probability of type 1 errors (false positives – detecting a difference where none exists) when multiple comparisons are made.

Tukey’s HSD test can be summarized as follows:

The means of all groups are arranged into as many unique pair combinations as possible. The pair combination with the largest difference between the two means is tested first. A test statistic for this pair of means is calculated as follows:

where

*(Click On Image To See Larger Version)*

n = number of samples in any group (all groups must be of equal size for Tukey’s HSD Post-Hoc test)

This test statistic is compared to q_{Critical }. The critical q values are found on the Studentized Range q table. A unique critical q value is calculated for each unique combination of level of significance (usually set at 0.05), the degrees of freedom, and the total number of groups in the ANOVA analysis.

Tukey’s test calculates degrees of freedom as follows:

df = Degrees of freedom = (total number of samples in all groups combined) – (total number of groups in that F test)

The difference between the two means is designated as significant if its test statistic q is larger than the critical q value from the table.

If the difference between the means with the largest difference is found to be significant, the next inside pair of means is tested. This step is repeated until an innermost pair is found to have a difference that is not significant. Once an inner pair of means is found to have a difference that is not large enough to be significant, no further testing needs to be done because all untested pairs will be inside this one and have even smaller differences between the means.

The difference between the two means is designated as significant if its test statistic q is larger than the critical q value from the table.

The Tukey HSD test calculates Test Statistic q for each pair of means. This Test Statistic is compared to q_{Critical }. The critical q values are found on the Studentized Range q table using the Excel lookup function, INDEX(array, row number, column number).

The difference between the two means is designated as significant if its test statistic q is larger than the critical q value from the table.

## Tukey’s HSD Test Statistic

The Test Statistic q is calculated as follows:

q = (Max Group Mean – Min Group Mean) / SE

df = Degrees of freedom = (total number of samples) – (total number of groups in that F Test)

## Tukey’s HSD Test in Excel For

the Main Effects F Test For

Factor 1

Tukey’s HSD Test should be performed for the Factor 1 Main Effect F Test but not for the Factor 2 Main Effects F Test. The purpose of Tukey’s HSD *post hoc* test is to determine which difference(s) between mean is significant. Factor 1 has three levels and therefore two differences between the means of the three level groups. The significant result of this F Test indicates that at least one of level group means is different than the other two level group means. The F Test is a omnibus test meaning that it does not tell where that difference lies. Tukey’s HSD test will indicate whether each of the differences between any combination of the three means is different.

*Post hoc* testing does not need to be performed on the two level groups of Factor 2’s Main Effects test. Tukey’s HSD test does not need to be performed when an F Test is run on only two groups. There is only one difference between the two group means. If the F Test indicates that there is a significant difference between the means of the two groups, there is no need to determine which difference is significant because there is only one difference.

The first step when performing the Tukey HSD test is to list all unique mean pairs and the differences between the means. All of this information can be found from the Excel ANOVA output as follows:

*(Click On Image To See Larger Version)*

The total number of combinations of pairs of n objects can be found by the following Excel formula:

=COMBIN(n,2)

If there are three level group means of Factor 1 (n = 3), the total number of combination pairs of these means is three, as a result of the following Excel formula:

COMBIN(3,2) = 3

From the Excel output, the three level group means of Factor 1 are the following:

Factor 1 Level 1 group mean = 76.125

Factor 1 Level 2 group mean = 49.625

Factor 1 Level 3 group mean = 85.375

Three unique group pairings exist: (1,2), (1,3), and (2,3)

The absolute differences in means of each pair are as follows:

Pair (1,2) Mean Difference = ABS(76.125-49.625) = 26.50

Pair (1,3) Mean Difference = ABS(76.125-85.375) = 9.25

Pair (2,3) Mean Difference = ABS(49.625-85.375) = 35.75

The differences between these means in descending order are as follows:

Largest difference = Pair (2,3) Mean Difference = 35.75

2^{nd} largest difference = Pair (1,2) Mean Difference = 26.50

Smallest difference = Pair (1,3) Mean Difference = 9.25

Calculating q and q Critical for each difference requires MS_{Within} and df_{Within} from the following section of the Excel ANOVA output.

*(Click On Image To See Larger Version)*

Difference between group means are checked for significance starting with the largest difference and working down to the smallest difference. As soon as one difference is found to be insignificant, no further differences need to be checked because all smaller differences will also be insignificant.

Calculating q and q Critical for the largest difference between the means of factor 1 level groups is done as follows:

*(Click On Image To See Larger Version)*

The q Critical value for α = 0.05 can be looked up on the critical value table for the specific k and df as follows:

*(Click On Image To See Larger Version)*

Calculating q and q Critical for the 2^{nd} largest difference between the means of factor 1 level groups is done as follows:

*(Click On Image To See Larger Version)*

Calculating q and q Critical for the smallest difference between the means of factor 1 level groups is done as follows:

*(Click On Image To See Larger Version)*

**Looking Up q _{Critical} on the Studentized Range q Table With the Excel INDEX() Function**

The Studentized Range q table and the Excel Index() function appear as follows:

=INDEX( array, relative row number, relative column number )

A relative address is the address relative to the cell in upper left corner of the array. In the INDEX() function is attempting to locate a value in a cell that is in the third column over (to the right of) and third row down from the cell in the upper left corner of the array, the relative row number equals 3 and the relative column number equals 3.

The array is the absolute address of the array. This is given by:

(upper left corner cell:lower right corner cell). In this case it would be (D5:K103)

*(Click On Image To See Larger Version)*

*(Click On Image To See Larger Version)*

*(Click On Image To See Larger Version)*

*(Click On Image To See Larger Version) *

## Determining Where the Strongest

Interactions Between Factor 1 and

Factor 2 Occur

The first step is to calculate the means of treatment cell as follows:

*(Click On Image To See Larger Version)*

The second step is to plot treatment cells means on a scatterplot chart. Separate line graphs for each level of one of the factors. In this case each level of Factor 2 given its own line graph as follows.

*(Click On Image To See Larger Version)*

The preceding scatterplot shows separate line graphs for each of the two levels of Factor 2 at successive levels of Factor 1. Interaction occurs in two-Way ANOVA systematic differences between levels of one factor vary along different levels of the other factor.

The interaction of the two factors between various levels is indicated by the slopes of adjacent line segments. Adjacent line segments that are parallel show no interactions between the levels of the factors at the endpoints of the line segments. The more that the slopes differ, the greater is the interaction of the two factors between the levels at the endpoints of the adjacent line segments.

The relative degree of interaction between the two factors across all combinations of their levels can be determined by calculating the absolute difference in the slopes of adjacent line segments. The adjacent line segments that have the greatest absolute difference in slopes display the greatest degree of interaction between factor levels at the endpoints of the adjacent line segments.

The calculations below indicate that there is significantly greater interaction between Factors 1 and 2 at higher levels of Factor 1 than at lower levels of Factor 1.

*(Click On Image To See Larger Version)*

**Excel Master Series Blog Directory**

Statistical Topics and Articles In Each Topic

- Histograms in Excel
- Bar Chart in Excel
- Combinations & Permutations in Excel
- Normal Distribution in Excel
- Overview of the Normal Distribution
- Normal Distribution’s PDF (Probability Density Function) in Excel 2010 and Excel 2013
- Normal Distribution’s CDF (Cumulative Distribution Function) in Excel 2010 and Excel 2013
- Solving Normal Distribution Problems in Excel 2010 and Excel 2013
- Overview of the Standard Normal Distribution in Excel 2010 and Excel 2013
- An Important Difference Between the t and Normal Distribution Graphs
- The Empirical Rule and Chebyshev’s Theorem in Excel – Calculating How Much Data Is a Certain Distance From the Mean
- Demonstrating the Central Limit Theorem In Excel 2010 and Excel 2013 In An Easy-To-Understand Way

- t-Distribution in Excel
- Binomial Distribution in Excel
- z-Tests in Excel
- Overview of Hypothesis Tests Using the Normal Distribution in Excel 2010 and Excel 2013
- One-Sample z-Test in 4 Steps in Excel 2010 and Excel 2013
- 2-Sample Unpooled z-Test in 4 Steps in Excel 2010 and Excel 2013
- Overview of the Paired (Two-Dependent-Sample) z-Test in 4 Steps in Excel 2010 and Excel 2013

- t-Tests in Excel
- Overview of t-Tests: Hypothesis Tests that Use the t-Distribution
- 1-Sample t-Tests in Excel
- 1-Sample t-Test in 4 Steps in Excel 2010 and Excel 2013
- Excel Normality Testing For the 1-Sample t-Test in Excel 2010 and Excel 2013
- 1-Sample t-Test – Effect Size in Excel 2010 and Excel 2013
- 1-Sample t-Test Power With G*Power Utility
- Wilcoxon Signed-Rank Test in 8 Steps As a 1-Sample t-Test Alternative in Excel 2010 and Excel 2013
- Sign Test As a 1-Sample t-Test Alternative in Excel 2010 and Excel 2013

- 2-Independent-Sample Pooled t-Tests in Excel
- 2-Independent-Sample Pooled t-Test in 4 Steps in Excel 2010 and Excel 2013
- Excel Variance Tests: Levene’s, Brown-Forsythe, and F Test For 2-Sample Pooled t-Test in Excel 2010 and Excel 2013
- Excel Normality Tests Kolmogorov-Smirnov, Anderson-Darling, and Shapiro Wilk Tests For Two-Sample Pooled t-Test
- Two-Independent-Sample Pooled t-Test - All Excel Calculations
- 2- Sample Pooled t-Test – Effect Size in Excel 2010 and Excel 2013
- 2-Sample Pooled t-Test Power With G*Power Utility
- Mann-Whitney U Test in 12 Steps in Excel as 2-Sample Pooled t-Test Nonparametric Alternative in Excel 2010 and Excel 2013
- 2- Sample Pooled t-Test = Single-Factor ANOVA With 2 Sample Groups

- 2-Independent-Sample Unpooled t-Tests in Excel
- 2-Independent-Sample Unpooled t-Test in 4 Steps in Excel 2010 and Excel 2013
- Variance Tests: Levene’s Test, Brown-Forsythe Test, and F-Test in Excel For 2-Sample Unpooled t-Test
- Excel Normality Tests Kolmogorov-Smirnov, Anderson-Darling, and Shapiro-Wilk For 2-Sample Unpooled t-Test
- 2-Sample Unpooled t-Test Excel Calculations, Formulas, and Tools
- Effect Size for a 2-Independent-Sample Unpooled t-Test in Excel 2010 and Excel 2013
- Test Power of a 2-Independent Sample Unpooled t-Test With G-Power Utility

- Paired (2-Sample Dependent) t-Tests in Excel
- Paired t-Test in 4 Steps in Excel 2010 and Excel 2013
- Excel Normality Testing of Paired t-Test Data
- Paired t-Test Excel Calculations, Formulas, and Tools
- Paired t-Test – Effect Size in Excel 2010, and Excel 2013
- Paired t-Test – Test Power With G-Power Utility
- Wilcoxon Signed-Rank Test in 8 Steps As a Paired t-Test Alternative
- Sign Test in Excel As A Paired t-Test Alternative

- Hypothesis Tests of Proportion in Excel
- Hypothesis Tests of Proportion Overview (Hypothesis Testing On Binomial Data)
- 1-Sample Hypothesis Test of Proportion in 4 Steps in Excel 2010 and Excel 2013
- 2-Sample Pooled Hypothesis Test of Proportion in 4 Steps in Excel 2010 and Excel 2013
- How To Build a Much More Useful Split-Tester in Excel Than Google's Website Optimizer

- Chi-Square Independence Tests in Excel
- Chi-Square Goodness-Of-Fit Tests in Excel
- F Tests in Excel
- Correlation in Excel
- Pearson Correlation in Excel
- Spearman Correlation in Excel
- Confidence Intervals in Excel
- z-Based Confidence Intervals of a Population Mean in 2 Steps in Excel 2010 and Excel 2013
- t-Based Confidence Intervals of a Population Mean in 2 Steps in Excel 2010 and Excel 2013
- Minimum Sample Size to Limit the Size of a Confidence interval of a Population Mean
- Confidence Interval of Population Proportion in 2 Steps in Excel 2010 and Excel 2013
- Min Sample Size of Confidence Interval of Proportion in Excel 2010 and Excel 2013

- Simple Linear Regression in Excel
- Overview of Simple Linear Regression in Excel 2010 and Excel 2013
- Complete Simple Linear Regression Example in 7 Steps in Excel 2010 and Excel 2013
- Residual Evaluation For Simple Regression in 8 Steps in Excel 2010 and Excel 2013
- Residual Normality Tests in Excel – Kolmogorov-Smirnov Test, Anderson-Darling Test, and Shapiro-Wilk Test For Simple Linear Regression
- Evaluation of Simple Regression Output For Excel 2010 and Excel 2013
- All Calculations Performed By the Simple Regression Data Analysis Tool in Excel 2010 and Excel 2013
- Prediction Interval of Simple Regression in Excel 2010 and Excel 2013

- Multiple Linear Regression in Excel
- Basics of Multiple Regression in Excel 2010 and Excel 2013
- Complete Multiple Linear Regression Example in 6 Steps in Excel 2010 and Excel 2013
- Multiple Linear Regression’s Required Residual Assumptions
- Normality Testing of Residuals in Excel 2010 and Excel 2013
- Evaluating the Excel Output of Multiple Regression
- Estimating the Prediction Interval of Multiple Regression in Excel
- Regression - How To Do Conjoint Analysis Using Dummy Variable Regression in Excel

- Logistic Regression in Excel
- Logistic Regression Overview
- Logistic Regression in 6 Steps in Excel 2010 and Excel 2013
- R Square For Logistic Regression Overview
- Excel R Square Tests: Nagelkerke, Cox and Snell, and Log-Linear Ratio in Excel 2010 and Excel 2013
- Likelihood Ratio Is Better Than Wald Statistic To Determine if the Variable Coefficients Are Significant For Excel 2010 and Excel 2013
- Excel Classification Table: Logistic Regression’s Percentage Correct of Predicted Results in Excel 2010 and Excel 2013
- Hosmer- Lemeshow Test in Excel – Logistic Regression Goodness-of-Fit Test in Excel 2010 and Excel 2013

- Single-Factor ANOVA in Excel
- Overview of Single-Factor ANOVA
- Single-Factor ANOVA in 5 Steps in Excel 2010 and Excel 2013
- Shapiro-Wilk Normality Test in Excel For Each Single-Factor ANOVA Sample Group
- Kruskal-Wallis Test Alternative For Single Factor ANOVA in 7 Steps in Excel 2010 and Excel 2013
- Levene’s and Brown-Forsythe Tests in Excel For Single-Factor ANOVA Sample Group Variance Comparison
- Single-Factor ANOVA - All Excel Calculations
- Overview of Post-Hoc Testing For Single-Factor ANOVA
- Tukey-Kramer Post-Hoc Test in Excel For Single-Factor ANOVA
- Games-Howell Post-Hoc Test in Excel For Single-Factor ANOVA
- Overview of Effect Size For Single-Factor ANOVA
- ANOVA Effect Size Calculation Eta Squared in Excel 2010 and Excel 2013
- ANOVA Effect Size Calculation Psi – RMSSE – in Excel 2010 and Excel 2013
- ANOVA Effect Size Calculation Omega Squared in Excel 2010 and Excel 2013
- Power of Single-Factor ANOVA Test Using Free Utility G*Power
- Welch’s ANOVA Test in 8 Steps in Excel Substitute For Single-Factor ANOVA When Sample Variances Are Not Similar
- Brown-Forsythe F-Test in 4 Steps in Excel Substitute For Single-Factor ANOVA When Sample Variances Are Not Similar

- Two-Factor ANOVA With Replication in Excel
- Two-Factor ANOVA With Replication in 5 Steps in Excel 2010 and Excel 2013
- Variance Tests: Levene’s and Brown-Forsythe For 2-Factor ANOVA in Excel 2010 and Excel 2013
- Shapiro-Wilk Normality Test in Excel For 2-Factor ANOVA With Replication
- 2-Factor ANOVA With Replication Effect Size in Excel 2010 and Excel 2013
- Excel Post Hoc Tukey’s HSD Test For 2-Factor ANOVA With Replication
- 2-Factor ANOVA With Replication – Test Power With G-Power Utility
- Scheirer-Ray-Hare Test Alternative For 2-Factor ANOVA With Replication

- Two-Factor ANOVA Without Replication in Excel
- Randomized Block Design ANOVA in Excel
- Repeated-Measures ANOVA in Excel
- Single-Factor Repeated-Measures ANOVA in 4 Steps in Excel 2010 and Excel 2013
- Sphericity Testing in 9 Steps For Repeated Measures ANOVA in Excel 2010 and Excel 2013
- Effect Size For Repeated-Measures ANOVA in Excel 2010 and Excel 2013
- Friedman Test in 3 Steps For Repeated-Measures ANOVA in Excel 2010 and Excel 2013

- ANCOVA in Excel
- Normality Testing in Excel
- Creating a Box Plot in 8 Steps in Excel
- Creating a Normal Probability Plot With Adjustable Confidence Interval Bands in 9 Steps in Excel With Formulas and a Bar Chart
- Chi-Square Goodness-of-Fit Test For Normality in 9 Steps in Excel
- Kolmogorov-Smirnov, Anderson-Darling, and Shapiro-Wilk Normality Tests in Excel

- Nonparametric Testing in Excel
- Mann-Whitney U Test in 12 Steps in Excel
- Wilcoxon Signed-Rank Test in 8 Steps in Excel
- Sign Test in Excel
- Friedman Test in 3 Steps in Excel
- Scheirer-Ray-Hope Test in Excel
- Welch's ANOVA Test in 8 Steps Test in Excel
- Brown-Forsythe F Test in 4 Steps Test in Excel
- Levene's Test and Brown-Forsythe Variance Tests in Excel
- Chi-Square Independence Test in 7 Steps in Excel
- Chi-Square Goodness-of-Fit Tests in Excel
- Chi-Square Population Variance Test in Excel

- Post Hoc Testing in Excel
- Creating Interactive Graphs of Statistical Distributions in Excel
- Interactive Statistical Distribution Graph in Excel 2010 and Excel 2013
- Interactive Graph of the Normal Distribution in Excel 2010 and Excel 2013
- Interactive Graph of the Chi-Square Distribution in Excel 2010 and Excel 2013
- Interactive Graph of the t-Distribution in Excel 2010 and Excel 2013
- Interactive Graph of the t-Distribution’s PDF in Excel 2010 and Excel 2013
- Interactive Graph of the t-Distribution’s CDF in Excel 2010 and Excel 2013
- Interactive Graph of the Binomial Distribution in Excel 2010 and Excel 2013
- Interactive Graph of the Exponential Distribution in Excel 2010 and Excel 2013
- Interactive Graph of the Beta Distribution in Excel 2010 and Excel 2013
- Interactive Graph of the Gamma Distribution in Excel 2010 and Excel 2013
- Interactive Graph of the Poisson Distribution in Excel 2010 and Excel 2013

- Solving Problems With Other Distributions in Excel
- Solving Uniform Distribution Problems in Excel 2010 and Excel 2013
- Solving Multinomial Distribution Problems in Excel 2010 and Excel 2013
- Solving Exponential Distribution Problems in Excel 2010 and Excel 2013
- Solving Beta Distribution Problems in Excel 2010 and Excel 2013
- Solving Gamma Distribution Problems in Excel 2010 and Excel 2013
- Solving Poisson Distribution Problems in Excel 2010 and Excel 2013

- Optimization With Excel Solver
- Maximizing Lead Generation With Excel Solver
- Minimizing Cutting Stock Waste With Excel Solver
- Optimal Investment Selection With Excel Solver
- Minimizing the Total Cost of Shipping From Multiple Points To Multiple Points With Excel Solver
- Knapsack Loading Problem in Excel Solver – Optimizing the Loading of a Limited Compartment
- Optimizing a Bond Portfolio With Excel Solver
- Travelling Salesman Problem in Excel Solver – Finding the Shortest Path To Reach All Customers

- Chi-Square Population Variance Test in Excel
- Analyzing Data With Pivot Tables
- SEO Functions in Excel
- Time Series Analysis in Excel
- VLOOKUP

The great info! I wanted to thanks for your time for this wonderful read!! thanks for sharing this blog.

ReplyDeleteeCommerce Catalog Management Services