In statistics, a main effect describes the contribution of one explanatory variable, or factor, to an outcome, considered separately from interactions with other variables. In a factorial design, it usually means a comparison of outcome means across that factor’s levels, averaging over the levels of the other factors. In a regression model, “main-effect term” also denotes a term involving a single predictor rather than a product of predictors. These meanings are closely related, but a main-effect coefficient is not always an average effect: its interpretation depends on the model, variable coding, and averaging weights.
Definition in factorial designs
A factorial design studies combinations of levels of two or more factors. For example, an experiment might compare two manufacturing methods at three temperatures. The main effect of manufacturing method compares the methods after averaging over temperature; the main effect of temperature compares temperatures after averaging over method.
Let have levels and have levels, and define the cell mean
where denotes expected value. Under equal weighting of the levels, define
and the grand mean
The main-effect component for level of is
Thus, a factor with several levels generally has several main-effect components, subject to a constraint such as , rather than a single effect number. Its overall main effect concerns whether the marginal means differ.
For a factor with two levels, a common summary is the difference
The hypothesis of no main effect of is
This is a statement about averages, not necessarily about the effect of at every level of .
Main effects, simple effects, and interactions
A simple effect compares levels of one factor at a particular level of another. For a two-level factor , its simple effect at is
The equally weighted main effect is the average of these simple effects:
A statistical interaction occurs when the effect of one factor depends on the level of another. For two factors with two levels each, an additive-scale interaction can be expressed as a difference of differences:
Consider the following population means:
| Equally weighted mean | |||
|---|---|---|---|
| 10 | 20 | 15 | |
| 20 | 10 | 15 |
The main effect of is zero, but its simple effects are at and at . Averaging conceals a reversal.
Consequently:
- A zero main effect does not imply that a factor has no effect under any condition.
- A nonzero main effect does not imply that its effect has the same magnitude or direction under all conditions.
- Main effects and interactions can both be present.
- An interaction does not make an average effect mathematically invalid, but it can make that average an incomplete description.
These distinctions are central to interpreting factorial experiments and interaction plots.
Representation in analysis of variance
A two-factor fixed-effects analysis of variance model with interaction is
where indexes observations within a cell, and are main-effect terms, is the interaction term, and is an error term.
A common parameterization imposes
together with
Under these constraints, the parameters correspond to the equally weighted marginal means defined above. The interaction captures departures of cell means from an additive representation.
For a balanced design with independent observations in each cell, the sum of squares for factor is
Its degrees of freedom are . Under the classical model with independent, normally distributed errors having a common variance, the hypothesis test uses
where estimates the error variance. With replication in every cell and the full interaction model, the error degrees of freedom are .
Other designs require different error structures or tests. Repeated measurements and clustered observations, for example, cannot generally be treated as independent replicates. In an unreplicated two-factor design, a full interaction model leaves no residual degrees of freedom for estimating error without additional assumptions.
Main-effect terms in regression
In linear regression, main-effect terms are terms involving individual predictors. Consider
Here, and are main-effect terms, while is an interaction term. Nevertheless,
Thus, is the slope of when , not automatically the slope averaged across . For a binary coded and , the same expression gives the conditional mean difference.
Coding determines the reference condition:
- With reference-category coding, a lower-order coefficient typically describes a comparison at the reference levels of interacting categorical predictors.
- With suitable sum-to-zero coding in a complete factorial model, lower-order terms can correspond to equally weighted marginal comparisons.
- Centering a continuous interacting variable changes the condition represented by zero and therefore changes the interpretation of the lower-order coefficient.
For example, defining changes the coefficient of to
The fitted response surface is unchanged; only its parameterization changes. This is why the presence of an interaction makes an isolated “main-effect coefficient” uninterpretable without information about coding and reference values.
Weighting and unbalanced data
In balanced experiments, observed marginal means and equally weighted averages of cell means coincide. With unequal cell sizes, they need not.
A general marginal comparison can be defined using common weights :
Equal weights describe a hypothetical population with equally represented levels of . Population-frequency weights describe a specified target population. These are different quantities when the simple effects vary across .
Raw group means can introduce a further complication. If the distribution of differs between the levels of , the raw comparison uses different weights in the two groups. It may therefore reflect both within-level differences and differences in group composition. Depending on the setting, confounding or selection processes may explain part of the observed association.
Model-based adjusted means, often called estimated marginal means, specify a reference grid and averaging rule. They are not automatically identical to raw sample means.
In unbalanced analysis of variance, different sums-of-squares conventions can test different hypotheses. Sequential, or Type I, sums of squares can depend on term order; Type II and Type III procedures use different adjustment rules. None substitutes for specifying the intended marginal comparison, particularly when interactions or empty cells are present.
Scale and nonlinear models
Main effects and interactions depend on the scale of the outcome or model. Additivity on one scale does not imply additivity on another.
For example, logistic regression may specify
There is no interaction term on the log-odds scale. Nevertheless, the probability difference associated with changing generally varies with , because the inverse-logit function is nonlinear. For binary , is a common conditional odds ratio, not a common probability difference.
Interpretation therefore distinguishes among a model coefficient, a conditional outcome contrast, and a contrast averaged over a specified population. In generalized linear models, these quantities need not coincide.
Interpretation and limitations
Main effects are used in experimental design, behavioral research, industrial experiments, and regression analysis to describe factor contributions and test planned comparisons. Their interpretation depends on several distinctions.
Association and causation. A main effect is not inherently causal. A causal interpretation requires a design or assumptions that identify the relevant intervention contrast. Randomization can support such an interpretation in factorial experiments; observational associations require additional causal inference assumptions.
Statistical evidence and magnitude. A p-value for an overall main effect does not describe its practical size. Mean differences, other effect sizes, and confidence intervals convey different information. For a multilevel factor, an overall test also does not identify which levels differ.
Averaging and heterogeneity. The same average can result from uniform effects, effects concentrated in a few conditions, or opposing effects that partially cancel. Main effects therefore answer a different question from simple effects and interactions.
Model specification. An additive model may provide a useful approximation, but excluding interactions imposes a restriction on how factor effects vary. A main effect estimated under that restriction should not be confused with evidence that the restriction is correct.