Introduction
To help introduce the basic concepts we start with the following example.
Example 1: A new fertilizer has been developed to increase the yield on crops, and the makers of the fertilizer want to better understand which of the three formulations (blends) of this fertilizer are most effective for wheat, corn, soybeans and rice (crops). They test each of the three blends on one sample of each of the four types of crops. The crop yields for the 12 combinations are as shown in Figure 1.
Figure 1 – Data for Example 1
We interrupt the analysis of this example to give some background, after which we will resume the analysis.
Definitions
Definition 1: We define the structural model as follows.
A factor is an independent variable. A k factor ANOVA addresses k factors.
A level is some aspect of a factor; these are what we called groups or treatments in the one-factor analysis discussed in Basic Concepts for ANOVA.
In Example 1 there are two factors: blends and crops. The blend factor has 3 levels and the crop factor has 4 levels.
In general, suppose we have two factors A and B. Factor A has r levels and factor B has c levels. We organize the levels for factor A as rows and the levels for factor B as columns. We use the index i for the rows (i.e. factor A) and the index j for the columns (i.e. factor B). Thus we use an r × c table where the entries in the table are
We use terms such as x̄i (or x̄i.) as an abbreviation for the mean of {xij: 1 ≤ j ≤ c}. Similarly, we use terms such as x̄j (or x̄.j) as an abbreviation for the mean of {xij: 1 ≤ i ≤ r}.
We estimate the level means from the total mean for factor A by μi = μ + αi where αi denotes the effect of the ith level for factor A (i.e. the departure of the ith level mean μi for factor A from the total mean μ). We have a similar estimate for the sample of x̄i = x̄ + ai.
Note that
Similarly, we estimate the level means from the total mean for factor B by μj = μ + βj where βj denotes the effect of the jth level for factor B (i.e. the departure of the jth level mean μj for factor B from the total mean μ). We have a similar estimate for the sample of x̄j = x̄ + bj.
As for factor A,
Null Hypotheses
The two-way ANOVA will either test for the main effects of factor A or factor B, namely
H0: μ1. = μ2. =⋯= μr. (Factor A)
or
H0: μ.1 = μ.2 =⋯= μ.c (Factor B)
If testing for factor A, the null hypothesis is equivalent to
H0: αi = 0 for all i
If testing for factor B, the null hypothesis is equivalent to
H0: βj = 0 for all j
Finally, we can represent each element in the sample as xij = μ + αi + βj + εij where εij denotes the error (or unexplained amount). As before we have the sample version xij = x̄ + ai + bj + eij where eij is the counterpart to εij in the sample.
Observation
Since
Definition 2: Using the terminology of Definition 1, define
Properties
Property 1:
Proof: Clearly
If we square both sides of the equation, sum over i, j and then simplify (with various terms equal to zero as in the proof of Property 2 of Basic Concepts for ANOVA), we get the first result. For the second,
Property 2: If a sample is made as described in Definition 1, with the xij independently and normally distributed and with all (or ) equal, then
Proof: The proof is similar to that of Property 1 of Basic Concepts for ANOVA.
Property 3: Suppose a sample is made as described in Definitions 1 and 2, with the xij independently and normally distributed.
If all μi are equal and all are equal then
If all μj are equal and all are equal then
Proof: The result follows from Property 2 and Property 1 of F Distribution.
Property 4:
Test Assumptions
We use the following tests:
Recall that the assumptions for using these tests are:
- All samples are drawn from normally distributed populations
- These samples were drawn independently from each other
- All populations have a common variance
- Within each sample, the observations were sampled randomly and independently of each other
We should also use Tukey’s Test for Additivity to make sure that the interaction between the two factors is not significant.
Example
We now return to Example 1 and show how to conduct the required analysis using Excel’s Anova: Two-factor Without Replication data analysis tool.
Example 1 (continued): The output from the data analysis tool is shown in Figure 2.
Figure 2 – Two factor ANOVA w/o replication data analysis tool
There are two null hypotheses: one for the rows and the other for the columns. Let’s look first at the rows:
H0: there is no significant difference in yield between the (population) means of the blends
Since the p-value for the rows = .0068 < .05 = α (or F = 12.83 > 5.14 = F-crit) we reject the null hypothesis, and so at the 95% level of confidence we conclude there is significant difference in the yields produced by the three blends.
The null hypothesis for the columns is
H0: there is no significant difference in yield between the (population) means for the crop types
Since the p-value for the columns = .1446 > .05 = α (or F = 2.63 < 4.76 = F-crit) we can’t reject the null hypothesis, and so at 95% level of confidence we conclude there is no significant difference in the yields for the four crops studied.
Worksheet Formulas
Although the analysis in Figure 2 was produced automatically by Excel’s data analysis tool, the same result can be produced using Excel formulas, just as we were able to do in Basic Concepts of ANOVA for one-way ANOVA. The most interesting cells are the ones corresponding to the four sum squares. We show how to calculate the values for each of those cells in Figure 3.
Figure 3 – Key formulas for analysis from Figure 2
The formulas for calculating SSRow and SSCol in Definition 2 involve taking squared deviations of the group means. E.g. SSRow can be calculated via the formula =DEVSQ(I6:I8)/H6. Alternatively, we can take squared deviations from the sums of each group, as is done in Figure 3.
Real Statistics Capabilities
The Real Statistics Resource Pack contains a number of functions and the Two Factor ANOVA data analysis tool that support Two Factor ANOVA without Replication. You can get more information about these in Two Factor ANOVA with Replication.
References
Psychological scales (2023) Is ANOVA with or without replication different?
https://scales.arabpsychology.com/stats/is-anova-with-or-without-replication-different/
Zar. J. H. (2010) Biostatistical analysis 5th Ed. Pearson
Hi Charles,
I don’t know how I can do a two-way ANOVA with the data that I have, but my supervisor tells me it’s possible. I have three different types of flowers (sunflower, tulip and lilies). Each group is getting infested with 40 different insects. My dependant variable is the number of a certain insect found in the flower for Day X. Basically, for every day (Day 1, 2, 3, 4, etc.), we look at only one type of flower over time and we count how many insects there are.
For example, for Day 4, the sunflower type will have 4 ladybugs, 0 caterpillars, 10 beetles, and so on for 37 more insects. Then, for Day 4, the tulip type will have the same kind of insects but different count, and so is the lily. Then we do this again for the other days.
I am mostly interested in the variation of insects between the 3 flower types. Is it possible to do a two-way ANOVA with replication ? I would consider my 40 types of insects as my 40 replicates, but the only issue is, that theoritically, it’s not really “replicates” since it’s not the same insect. Or should I do without replication since I only have one replicate for each Day/insect type (e.g. 4 ladybugs for Day 4 in Tulip).
Dear Charles,
Thank you for such a helpful website which I learned a lot from. Regarding interaction of two factors without repeated measurements, can I use Tukey’s one df test for nonadditivity? I used R to perform that test and got p = 0.28, which means no interaction between blend and crop.
Ching-Ho WANG, National Taiwan University
Dear Chingho Wang,
I am pleased that you have found the Real Statistics website to be helpful.
Yes, you can use Tukey’s Additivity Test in this case. p = .28 would indicate no interaction.
The Real Statistics website doesn’t explain how to perform this test. I plan to add this to the website in the next couple of days.
Thank you for your question, which has prompted me to add the test to the website.
Charles
sir i am Rafael may i kindly ask sir
1) what is ANOVA two way WITH replication, i need a long definition
where and when should be used
2) what is ANOVA two way WITH replication long definition too
3) what is the difference between the two and where and when should they be used
Hi Rafael,
1) Two-way ANOVA means that there are two factors. Each factor can have multiple levels. With replication means that for every combination of levels from the two factors, there are more than one sample element. See the following webpage for more details:
https://real-statistics.com/two-factor-anova-with-replication/
2) 1) Two-way ANOVA means that there are two factors. Each factor can have multiple levels. Without replication means that for every combination of levels from the two factors, there is exactly one sample element.
3) The with replications version is the more commonly used version. The without replications version is used when there are no replications. It can also be used for Repeated Measures ANOVA and Randomized Complete Block Design.
Charles
sir what kind of element in without replication is?
Sorry, but I don’t understand your question.
Charles
sir thank you for answering my mistake on another replication, it is without replication,
anyway can i know what is the formula for (with) replication and can i have the definition per sign same with (without) replication formula?
I have now added an explanation of Tukey’s Additivity Test to the website. See
Tukey’s Additivity Test
I plan to add support for this test to the Real Statistics software in the next release.
Charles
i mean what is the formula of two way anova with replication and without replication sir?
Very good article, however, I would like to ask you about how we can measure normality and homogeneity tests for ANOVA two factors without replication. Should we measure them one-by-one factor? Thank you
Yes, that is correct.
Charles
Hello Charles.
Why didnt you include the interaction between levels of different factors into the systematic variability? Isnt the interaction part of the general variability of x,ij?
Thank you,
Severin
Hello Severin,
Since we are considering the case where there is no replication, the interaction between levels of the two factors consists of one element. In this case, there is no variability (e.g. VAR.S(R1) is undefined when R1 consists of one cell).
There is interaction variability when there is replication. This case is discussed at
Two Factor ANOVA with Replication.
Charles
Why is this not chi-square?
Hello Mark,
The data for the chi-square test of independence consists of counts (i.e. non-negative integers such as 30). The data for Two Factor ANOVA without Replications uses decimal values (such as 30.65 or -3.4). The null-hypothesis is also different.
Charles
Dear Charles,
Thank you for the quick and clear clarification. And thank you for such a helpful website?
Best wishes,
Mark
Hi. So I am evaluating, if the checks done by my colleagues are are significantly different for a specific equipment. I have 5 lab mates and each did 3 trials. So would it be one way anova?
It sure sounds like a fit for ANOVA, but, as they say, “the devil is in the details”.
Charles
Hello Charles,
I have two independent variables (time and temperature) then one dependent variable (starch content). There are 3 levels of time and 2 levels of temperature. I have only done 2 trials for the six combinations. What type of ANOVA should I use? And Can I use Tukey’s Method afterwards?
Thank you!
Hello Riana,
It depends on what hypotheses you want to test. You might use two-factor ANOVA, although one factor ANOVA or a t-test may be applicable.
Charles
Hi Charles, I did my two way ANOVA without replication and I am wondering whether I can do post hoc analysis on it? If yes, which post hoc analysis should I use?
Hello Fransiska,
See https://www.real-statistics.com/two-way-anova/follow-up-analyses-for-two-factor-anova-w-o-replications/
Which post hoc test to use depends on what hypothesis or hypotheses you want to test.
Charles
Hi Charles.
Thank you for the example. I have a questions. My data is about STEM students between girls and boys in 4 fields which are science, engineering, technology and mathematics. So, do I have to perform the test year by year?
Fiza,
I need additional information to be able to address your question. What hypothesis (or hypotheses) are you trying to test?
Charles What sort of data have you gathered? (or are you preparing to gather?)
Dear Charles,
I found negative values in my ss for interaction in the two way Anova. Is this possible? Is something wrong with my data?
Best regards
Werner
Werner,
SS should never be negative. I can think of two reasons for getting a negative value: (1) it is a negative value near zero, in which case you should interpret it as zero and (2) you have an unbalanced model and need to use the Regression option. Perhaps it could also happen if there are no interactions.
If you email me an Excel file with your data and test results, I will try to figure out what is going wrong.
Charles
Sir i want to test the effect of three priming techniques each with two levels on four maize hybrids which anova should i use kindly tell me.
You need to supply additional information. E.g. (1) what hypothesis or hypotheses are you trying to test? (2) Are the priming techniques applied to the same maize hybrids or different hybrids? (3) What are the levels? E.g. they are different dosages of the priming techniques.
Charles
I have nine treatments of different types of manure and have to test all these treatments on one crop . Which test I will use for my experiment?
Neetu,
What hypothesis or hypotheses are you trying to test? Do you have any constraints on your data?
Charles
Hi Charles,
Is there a way to perform a post hoc on a two factor ANOVA without replicates? if so what post hoc is best? I had been trying to use a post hoc t test because i didnt think that i needed anything much more complicated than that, however, at times i found that the ANOVA would come back saying that there was significance when the t test said that there was not. Just looking for some help as this is my first time doing two factor ANOVAs.
Hello Margaret,
See the following webpage:
Charles
Dear Charles,
I have 3 batches of the same product, 9 samples were withdrawn from each batch during the manufacturing process. I am looking to assess to inter & Intra batch variability. Can you please advise if Anova Two factors w/o replications will be suitable for this case?
Regards Daniel
Hello Daniel,
I am not familiar with the term “inter & Intra batch variability”. The following is an article that you might find helpful.
https://www.tandfonline.com/doi/pdf/10.1080/17453670710014004
Charles
Dear Charles,
First thank you for this magnificent side.
In the example you concluded a significant difference between the yields produced by the three blends, but if I were to find out if they all differed or only two of them did. What kind of post-test should I use?
Best Regards Sander
See https://real-statistics.com/two-way-anova/follow-up-analyses-for-two-factor-anova-w-o-replications/
Charles