aiwiki.page
English

Main Effect

A main effect describes a factor’s average association with an outcome across other factors’ levels, or its lower-order contribution in a statistical model.

19 keywords1 linked fromWritten by AI
StatisticsFactorial DesignExpected valueStatistical Inte…Analysis of Vari…Degrees of Freed…VarianceStatistical Hypo…Main Effec…

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 AA have aa levels and BB have bb levels, and define the cell mean

μij=E⁡(Y∣A=i,B=j),\mu_{ij}=\operatorname{E}(Y\mid A=i,B=j),

where E⁡\operatorname{E} denotes expected value. Under equal weighting of the levels, define

μi⋅=1b∑j=1bμij,μ⋅j=1a∑i=1aμij,\mu_{i\cdot}=\frac{1}{b}\sum_{j=1}^{b}\mu_{ij}, \qquad \mu_{\cdot j}=\frac{1}{a}\sum_{i=1}^{a}\mu_{ij},

and the grand mean

μ⋅⋅=1ab∑i=1a∑j=1bμij.\mu_{\cdot\cdot} =\frac{1}{ab}\sum_{i=1}^{a}\sum_{j=1}^{b}\mu_{ij}.

The main-effect component for level ii of AA is

αi=μi⋅−μ⋅⋅.\alpha_i=\mu_{i\cdot}-\mu_{\cdot\cdot}.

Thus, a factor with several levels generally has several main-effect components, subject to a constraint such as ∑iαi=0\sum_i\alpha_i=0, 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

ΔA=μ2⋅−μ1⋅.\Delta_A=\mu_{2\cdot}-\mu_{1\cdot}.

The hypothesis of no main effect of AA is

H0:μ1⋅=μ2⋅=⋯=μa⋅.H_0:\mu_{1\cdot}=\mu_{2\cdot}=\cdots=\mu_{a\cdot}.

This is a statement about averages, not necessarily about the effect of AA at every level of BB.

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 AA, its simple effect at B=jB=j is

ΔA(j)=μ2j−μ1j.\Delta_A(j)=\mu_{2j}-\mu_{1j}.

The equally weighted main effect is the average of these simple effects:

ΔA=1b∑j=1bΔA(j).\Delta_A=\frac{1}{b}\sum_{j=1}^{b}\Delta_A(j).

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:

I=(μ22−μ12)−(μ21−μ11).I= (\mu_{22}-\mu_{12}) - (\mu_{21}-\mu_{11}).

Consider the following population means:

B=1B=1 B=2B=2 Equally weighted mean
A=1A=1 10 20 15
A=2A=2 20 10 15

The main effect of AA is zero, but its simple effects are 1010 at B=1B=1 and −10-10 at B=2B=2. 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

Yijk=μ+αi+βj+γij+εijk,Y_{ijk} = \mu+\alpha_i+\beta_j+\gamma_{ij}+\varepsilon_{ijk},

where kk indexes observations within a cell, αi\alpha_i and βj\beta_j are main-effect terms, γij\gamma_{ij} is the interaction term, and εijk\varepsilon_{ijk} is an error term.

A common parameterization imposes

∑iαi=0,∑jβj=0,\sum_i\alpha_i=0,\qquad \sum_j\beta_j=0,

together with

∑iγij=0for each j,∑jγij=0for each i.\sum_i\gamma_{ij}=0\quad\text{for each }j, \qquad \sum_j\gamma_{ij}=0\quad\text{for each }i.

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 nn independent observations in each cell, the sum of squares for factor AA is

SSA=bn∑i=1a(Yˉi⋅⋅−Yˉ⋅⋅⋅)2.SS_A = bn\sum_{i=1}^{a} \left(\bar{Y}_{i\cdot\cdot}-\bar{Y}_{\cdot\cdot\cdot}\right)^2.

Its degrees of freedom are a−1a-1. Under the classical model with independent, normally distributed errors having a common variance, the hypothesis test uses

FA=SSA/(a−1)MSE,F_A=\frac{SS_A/(a-1)}{MS_E},

where MSEMS_E estimates the error variance. With replication in every cell and the full interaction model, the error degrees of freedom are ab(n−1)ab(n-1).

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

E⁡(Y∣X,Z)=β0+βXX+βZZ+βXZXZ.\operatorname{E}(Y\mid X,Z) = \beta_0+\beta_X X+\beta_Z Z+\beta_{XZ}XZ.

Here, βXX\beta_X X and βZZ\beta_Z Z are main-effect terms, while βXZXZ\beta_{XZ}XZ is an interaction term. Nevertheless,

∂E⁡(Y∣X,Z)∂X=βX+βXZZ.\frac{\partial\operatorname{E}(Y\mid X,Z)}{\partial X} = \beta_X+\beta_{XZ}Z.

Thus, βX\beta_X is the slope of XX when Z=0Z=0, not automatically the slope averaged across ZZ. For a binary XX coded 00 and 11, 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 Zc=Z−cZ_c=Z-c changes the coefficient of XX to

βX+βXZc.\beta_X+\beta_{XZ}c.

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 wjw_j:

ΔA(w)=∑j=1bwj(μ2j−μ1j),wj≥0,∑jwj=1.\Delta_A(w) = \sum_{j=1}^{b}w_j(\mu_{2j}-\mu_{1j}), \qquad w_j\geq 0,\quad \sum_jw_j=1.

Equal weights describe a hypothetical population with equally represented levels of BB. Population-frequency weights describe a specified target population. These are different quantities when the simple effects vary across BB.

Raw group means can introduce a further complication. If the distribution of BB differs between the levels of AA, 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

logit⁡Pr⁡(Y=1∣X,Z)=β0+βXX+βZZ.\operatorname{logit}\Pr(Y=1\mid X,Z) = \beta_0+\beta_X X+\beta_Z Z.

There is no interaction term on the log-odds scale. Nevertheless, the probability difference associated with changing XX generally varies with ZZ, because the inverse-logit function is nonlinear. For binary XX, exp⁡(βX)\exp(\beta_X) 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.