Categorical Predictors, Moderation and Mediation

Extend multiple regression to three questions that real research data raise. Code groups with dummy and effect codes and compare them in a regression model. Test whether the effect of one predictor depends on another with an interaction term, center predictors so the coefficients make sense, and probe the result with simple slopes, regions of significance and a clear plot. Then estimate how an effect travels through a mediator, test the indirect effect with a bootstrap confidence interval, and report every analysis in a standard format.

IntermediateLesson 3 of 10 in Intermediate Statistics – Regression and ANOVA Course

What you will learn

  1. Turn group membership into dummy or effect codes, read each coefficient as a group mean or a difference between means, and test whether the groups differ, with or without a covariate.
    • Dummy-code a categorical predictor
      Create k − 1 indicator variables around a reference group and read the intercept and slopes as a group mean and differences from it.
    • Use effect coding and other coding schemes
      Code groups as deviations from the average of the group means, and see why every full coding scheme gives the same fit while its coefficients answer different questions.
    • Test group differences with regression
      Test the whole set of group codes with an F test, compare particular groups, adjust a group difference for a covariate and report the result.
  2. Add a product term to test whether the effect of one predictor depends on another, interpret every coefficient correctly, use centering to make the coefficients meaningful, and test whether groups have different slopes.
    • Build and interpret an interaction model
      Write a regression model with a product term, test it, and read the conditional meaning of each coefficient.
    • Center predictors to make coefficients meaningful
      Mean-center continuous predictors before forming the product, and know what centering changes and what it leaves untouched.
    • Test moderation by a categorical variable
      Combine dummy codes with a continuous predictor to test whether groups have different slopes, including moderators with more than two groups.
  3. Follow an interaction with conditional effects at chosen moderator values, find the region where the effect is significant, draw an interaction plot and write a complete report.
    • Calculate and test simple slopes
      Estimate the effect of the focal predictor at chosen values of the moderator, with standard errors, t tests and confidence intervals.
    • Map regions of significance, plot and report an interaction
      Use the Johnson–Neyman technique, draw and read an interaction plot within the data, and write up a moderation analysis.
  4. Split a total effect into a direct effect and an indirect effect through one mediator, test the indirect effect with a bootstrap confidence interval, and judge what the analysis can and cannot show.
    • Specify a mediation model and its paths
      Write the two regressions of a simple mediation model and read the a, b, direct, indirect and total effects in the units of the variables.
    • Test the indirect effect
      Compare the causal steps approach, the Sobel test and the percentile bootstrap, and draw a conclusion from a confidence interval for ab.
    • Interpret and report a mediation analysis
      Describe the size of an indirect effect, recognize inconsistent mediation, check the causal assumptions and write up the results.

Moderation and Mediation study guide

4 chapters

1

Code categorical predictors and compare groups with regression

Group membership can explain differences in an outcome, but group labels need a suitable numerical representation. Start by building indicators and reading predictions for each group. Then change the coding to answer different comparison questions without changing the fitted model. Joint tests and individual comparisons let you separate evidence about the whole categorical predictor from evidence about one particular difference.

1.1 Dummy-code a categorical predictor

A group label tells you which category a case belongs to. It does not measure how much of something the case has. Giving control, video and coached learners the labels 1, 2 and 3 would impose equal steps along one line. The model would treat the move from control to video as the same change as the move from video to coached.

Build indicators around a reference

For three groups, create two dummy variables. Each is 1 for its named group and 0 otherwise. Choose control as the reference:

ConditionVideo dummyCoached dummy
Control00
Video10
Coached01

The reference cases have zeros on every dummy. For a predictor with k categories, use k−1 dummies with an intercept. Including all k dummies creates perfect multicollinearity: every row of dummy values sums to 1, duplicating the intercept column. This is the dummy variable trap. There is then no unique set of coefficients.

Read a group mean from the equation

Suppose 40 learners have these test-score means: control 60 (10 learners), video 64 (10 learners), and coached 71 (20 learners). With group codes as the only predictors, the fitted model is

Y^=60+4Dvideo+11Dcoached.

Substitute the code row for each group. Control gives 60; video gives 60+4=64; coached gives 60+11=71. Every learner in a group receives that group’s fitted mean. The intercept is the reference mean, and each slope is a difference from that mean. The video coefficient 4 means four points above control. It is not a difference from the average of all groups, which is 65 here.

With just two groups, one dummy is enough. Its coefficient is the difference between their means. Under the equal-variance model, its coefficient test is the same independent-samples t test, with n−2 residual degrees of freedom.

Choose a useful reference

A control or standard-treatment group often makes the comparisons easy to explain. A very small reference group gives imprecise comparisons because its mean enters every difference. Check the output labels: software may choose the first or last level by default.

Changing the reference changes the printed coefficients. With video as reference, the intercept becomes 64, control is 60−64=−4, and coached is 71−64=7. The predicted group means, residuals, R2 and overall F stay unchanged. You have rewritten the same model.

For a two-group dummy, reversing 0 and 1 changes the sign of the difference and moves the intercept to the other group’s mean. Name the indicator after the group coded 1 and report the coding so that a reader can interpret the sign.

Key Takeaways

  • Use k − 1 indicators with an intercept.
  • The intercept is the reference mean in a groups-only model.
  • Each dummy slope compares its group with the reference.
  • Changing the reference preserves the model’s fit.

1.2 Use effect coding and other coding schemes

Coding determines the comparison a coefficient expresses. Effect coding compares each group mean with the plain average of the group means. It still represents every group, including the group whose coefficient is not printed.

Build and decode effect codes

For three groups, use two variables. Give video the codes (1, 0), coached (0, 1), and control (−1, −1). The fitted equation is

Y^=b0+b1Evideo+b2Ecoached.

With means 60, 64 and 71, the intercept is (60+64+71)/3=65. The video effect is 64−65=−1 and the coached effect is 71−65=6, giving

Y^=65−Evideo+6Ecoached.

For control, substitute −1 into both variables: 65+1−6=60. Its effect is −5, the negative sum of the printed effects: −(−1+6)=−5. The group effects sum to zero.

Distinguish two averages

The effect-coded intercept gives every group equal weight. It is the unweighted grand mean, even if group sizes differ. Here control and video each contain 10 learners, while coached contains 20. The mean across all 40 cases is

(10×60+10×64+20×71)/40=66.5.

That weighted mean is different from the intercept 65. Weighted effect coding is a separate scheme for comparisons with a mean weighted by group proportions.

SchemeIntercept in the groups-only modelPrinted coefficients
DummyReference group meanDifferences from the reference
EffectAverage of the group meansDeviations from that average
Encode a planned comparison

Contrast codes can express a research comparison directly. Let one code be −2/3 for control and 1/3 for each trained group. Let the second code be 0 for control, −1/2 for video and 1/2 for coached. These give coefficients 7.5 for the average trained-group mean minus control, and 7 for coached minus video. The scaling matters: each code changes by exactly 1 between the sets compared, so the coefficient equals that mean difference.

A full set of independent codes gives the same fitted means, residuals, R2 and overall F as dummy coding. Choosing a coding scheme chooses which comparisons appear in the output; it does not improve fit. “Full” means that the codes retain all the distinctions among the groups.

Interactions make this choice especially visible. With a dummy moderator, the coefficient of another predictor is its slope in the reference group. With effect codes, it is the unweighted average of the group slopes. Read the codes before interpreting the lower-order coefficients. The −1 group remains fully included in the analysis; its effect is recoverable from the others.

Key Takeaways

  • Effect codes compare groups with the unweighted mean of group means.
  • The unprinted effect is minus the sum of the printed effects.
  • Unequal group sizes separate weighted and unweighted means.
  • Contrast scaling determines coefficient meaning.
  • Full independent coding schemes preserve fitted values.

1.3 Test group differences with regression

A categorical predictor contributes several coefficients, but the question “do the groups differ?” concerns the set of codes together. Individual coefficient tests answer narrower questions about particular comparisons.

Test the whole categorical predictor

With group codes alone, the overall F tests equal population group means. It is the same test as the one-way ANOVA F because the fitted model is the same. If covariates are already present, compare a reduced model containing them with a full model that adds every group code. This asks about group differences after adjustment.

F=(Rfull2−Rreduced2)/m(1−Rfull2)/(n−p−1).

Here m is the number of added predictors, p counts all predictors in the full model, and n is the sample size. The degrees of freedom are m and n−p−1. Both fits must use the same cases.

For the 40 learners, the between-group sum of squares is 890. A residual standard deviation of 8 gives a residual sum of squares 82×37=2368. Thus R2=890/(890+2368)=.273 and F(2,37)=6.95, with p=.003. The result supports some difference among the conditions; it does not identify every differing pair.

Estimate particular differences

For group j against the reference, the standard error is s1/nj+1/nref under the common-variance model. Video minus control is 4, with SE=81/10+1/10=3.58. Its t(37)=1.12 and p=.271. The 95% interval is about [−3.2, 11.2], spanning both zero and substantial positive differences. A nonsignificant test leaves uncertainty; it does not establish equal means.

Coached minus control is 11, with SE=3.10, t(37)=3.55 and p=.001. To compare coached with video, make video the reference. The difference is 7, with t(37)=2.26 and p=.030. Plan comparisons or adjust for multiple testing, for example with Holm or Bonferroni.

Keep all codes for the categorical predictor together. Removing a nonsignificant dummy merges its group with the reference. A joint test evaluates the predictor without making the conclusion depend on which group is the reference.

Adjust and report

In Y^=20+5Dcoached+0.6 Pretest, the difference 5 compares coached and control learners with the same pretest score. This model gives both groups one common pretest slope. A group-by-pretest interaction tests that parallel-slopes assumption.

Inspect residuals by group for similar spread, along with independence and approximate residual normality for conventional inference. Unequal spreads combined with unequal group sizes can distort conventional standard errors; heteroscedasticity-consistent standard errors address unequal variance. Report coding, the joint test, relevant differences and intervals, and the covariates. For example: “Condition explained 27% of score variance, F(2, 37) = 6.95, p = .003; coached learners scored 11.00 points above control, 95% CI [4.72, 17.28].”

Key Takeaways

  • Test the categorical predictor with a joint F test.
  • A covariate-adjusted difference compares cases at the same covariate value.
  • Keep all codes together.
  • Plan comparisons or adjust for multiple testing.
  • Report confidence intervals as well as p values.
  • Inspect residual spread within groups.
2

Model moderation with interaction terms

An association can depend on the setting or the people being studied. An interaction model captures that dependence by letting one predictor’s slope change with another predictor. Reading its coefficients requires careful attention to zero points. Work from the model equation to conditional slopes, then use centering and group codes to express the same fitted relationships in ways that answer useful research questions.

2.1 Build and interpret an interaction model

Moderation means that the association between a predictor and an outcome changes with a third variable. Social support might buffer the association between stress and wellbeing: the stress slope could be more negative among people with less support. A moderator answers “when?” or “for whom?”; a mediator concerns the pathway through which an effect occurs.

Let the slope change

The interaction model is

Y=b0+b1X+b2W+b3XW+e.

Compute the product XW for each case. Collecting the terms involving X gives

Y=b0+b2W+(b1+b3W)X+e.

So the slope of X at a given moderator value is b1+b3W. Each one-unit increase in W changes that slope by b3. The same equation gives the slope of W as b2+b3X. Theory determines which predictor you call the moderator; the mathematics treats their interaction symmetrically.

Interpret the signs in context

For 200 adults, suppose stress ranges from 0 to 40, support from 0 to 20, and wellbeing from 0 to 100. The fitted model is

Y^=85−2X−0.5W+0.10XW.

The stress slope is −2+0.10W. At support 6 it is −1.4; at support 10 it is −1.0; at support 14 it is −0.6 wellbeing points per stress point. The positive interaction makes the stress slope less negative as support rises. A positive interaction need not mean that every slope is positive.

The support coefficient −0.5 describes its slope when stress is zero. At stress 20, the support slope is −0.5+0.10(20)=1.5. Reading −0.5 as the overall association of support with wellbeing would miss this dependence. Likewise, −2 is the stress slope specifically at zero support. A zero point outside the data makes the corresponding coefficient an extrapolation.

Test the interaction

The moderation hypothesis is H0:b3=0. With SE(b3)=0.035, the test is t(196)=0.10/0.035=2.86, p=.005. Adding the product increases R2 from .25 to .28. The one-predictor change test gives F=t2≈8.2. The interaction effect size is f2=ΔR2/(1−Rfull2)=.03/.72=.042.

Keep both lower-order terms X and W in the model, even if their coefficient tests are nonsignificant. Omitting one imposes an extra restriction on the fitted lines and changes what the product term tests.

Correlation between the predictors is a different question. Two predictors can be uncorrelated yet interact, or correlated without interacting. Interaction tests often have low power, and measurement error in either predictor can weaken their product. A nonsignificant interaction leaves uncertainty about slope differences; inspect its estimate and confidence interval.

Key Takeaways

  • The product coefficient tests changing slopes.
  • Lower-order coefficients describe slopes at the other predictor’s zero.
  • Keep both lower-order terms in the model.
  • The sign of the interaction describes how a slope changes.

2.2 Center predictors to make coefficients meaningful

The zero point determines where a lower-order coefficient describes a slope. Centering moves that zero to a useful value while preserving the fitted interaction model.

Center before multiplying

Mean centering is Xc=X−Xˉ and Wc=W−Wˉ. The centered variables have mean zero, with unchanged standard deviations and distribution shapes. Form the product XcWc after these subtractions. Subtracting the mean of the raw product XW produces a different variable.

If stress has mean 20 and support mean 10, substitute X=Xc+20 and W=Wc+10 into the raw model:

Y^=85−2(Xc+20)−0.5(Wc+10)+0.10(Xc+20)(Wc+10).

Expanding the product adds 0.10XcWc+Xc+2Wc+20. Collect constants and matching terms to obtain

Y^=60−Xc+1.5Wc+0.10XcWc.

The intercept 60 is predicted wellbeing at both predictor means. The stress coefficient −1 describes the stress slope at mean support. The support coefficient 1.5 describes the support slope at mean stress. These coefficients now answer different questions from the raw coefficients, so their standard errors and tests also change.

Identify what stays fixed
Changes with centeringStays the same
Intercept and lower-order coefficientsInteraction coefficient and its standard error
Questions tested by lower-order testsInteraction t and p
Predictor zero pointsFitted values, residuals, R² and overall F

Check a prediction to see why: raw stress 26 and support 14 are centered values 6 and 4. Both equations predict 62.4. Centering is a reparameterization, a different expression of the same fitted surface.

Centering often reduces correlations between a product and its components, but the joint distribution matters. Those correlations can remain high or even increase. The correlation between X and W themselves stays the same. Centering is useful for interpretation; it is not a way to make the interaction significant.

Choose the zero that answers your question

The mean is one choice. An age of 18, a scale midpoint or another meaningful value may serve the research question better. Subtract that value and rebuild the product. The other predictor’s lower-order coefficient is then its slope at the chosen value.

For a dummy-by-continuous interaction, leave the dummy coded 0/1 to retain a reference group. Centering only the continuous variable makes the dummy coefficient the group difference at its new zero.

Standardization needs the same attention to construction. The standardized score of a product is not the product of standardized scores. To express slope change per standard deviation of a moderator, standardize the component predictors first, form their product, and report the unstandardized coefficients of that fitted model. Standardize the outcome too if you want outcome standard-deviation units.

Key Takeaways

  • Center components before forming their product.
  • Choose zero points for useful coefficient interpretations.
  • Centering leaves the interaction test and predictions unchanged.
  • Centering does not always reduce product correlations.
  • Standardize components before multiplying when interpreting change per SD.

2.3 Test moderation by a categorical variable

A categorical moderator gives a different regression line for each group. A product between a group code and a continuous predictor lets the slope vary across those lines.

Derive both group equations

Let D=1 for trained learners and 0 for untrained learners. The model is

Y^=40+2X+5D+1.5DX,

where X is weekly practice hours, observed from 0 to 12. Set D=0 to get the untrained line, Y^=40+2X. Set D=1 to get the trained line, Y^=45+3.5X. The product coefficient 1.5 is the trained slope minus the untrained slope. The dummy coefficient 5 is the group difference at zero hours.

Subtract the lines to get the group difference at any practice value:

Y^trained−Y^untrained=5+1.5X.

At 6 hours the difference is 14 points, and at 10 hours it is 20. The model has no single group difference applying at every practice value.

Move the comparison to mean practice

Mean practice is 6 hours. With Xc=X−6, the same model becomes

Y^=52+2Xc+14D+1.5DXc.

The dummy coefficient now gives the 14-point difference at six hours. Both group slopes and the slope difference remain unchanged. If the trained group becomes the reference, the continuous-predictor coefficient becomes 3.5, with its own standard error and test.

An effect-coded moderator gives another reading. With trained coded +1 and untrained −1, the coefficient of practice is the average slope, (2+3.5)/2=2.75. The product coefficient is 0.75, half the slope difference. The two fitted lines are unchanged.

Test a difference directly

A significant slope in one group and a nonsignificant slope in the other do not establish different slopes. Each test compares one slope with zero. The interaction test compares the slopes with each other. A combined model supplies that direct test and pools residual variance, assuming similar residual spread across groups.

For a moderator with three groups, create two dummies and two products with X. Include X, both dummies and both products. Test the products as a block, because together they represent group differences in slopes. Individual product tests compare particular slopes with the reference slope.

For 120 cases, suppose the products raise R2 from .40 to .43. The full model has five predictors, so residual degrees of freedom are 120−5−1=114. The change test is

F(2,114)=(.43−.40)/2(1−.43)/114=3.00,

with p=.054. It does not cross the .05 threshold. Retain the estimate and uncertainty instead of declaring all slopes equal. Group-by-covariate products also test the parallel-slopes assumption of a covariate-adjusted comparison. When slopes differ, report group differences at named covariate values.

Key Takeaways

  • A dummy interaction coefficient is a difference in slopes.
  • The group difference varies with the continuous predictor.
  • Test slope differences directly.
  • With k groups, jointly test k − 1 product terms.
  • Effect coding changes the coefficient reading, not the fitted lines.
3

Probe, plot and report interactions

A significant interaction tells you that slopes differ, but it leaves open how large they are at meaningful moderator values. Probing supplies those estimates and their uncertainty. A region of significance extends the calculation across a continuous moderator, while a plot shows the fitted pattern in the variables’ original units. Combine these views in a report that distinguishes a changing association from evidence about its cause.

3.1 Calculate and test simple slopes

A simple slope is the estimated change in the outcome for a one-unit increase in the focal predictor at a chosen moderator value. Its estimate and its uncertainty both depend on where you probe the interaction.

Choose meaningful values

Use values that answer the research question and lie within the observed data. The mean and one standard deviation below and above it are common choices. For a skewed moderator, percentiles such as the 16th, 50th and 84th stay inside its observed range. A categorical moderator is probed group by group. Splitting a continuous moderator at its median discards information and changes the model.

For the centered stress–support model,

Y^=60−Xc+1.5Wc+0.10XcWc,

the stress slope is θ=−1+0.10Wc. Support has mean 10 and standard deviation 4. Low support 6 corresponds to Wc=−4, giving a slope of −1.4. Mean support gives −1.0, and support 14 corresponds to Wc=4, giving −0.6. Use the moderator’s centered scale in this equation: inserting 14 would evaluate a different support value.

Carry uncertainty through the combination

A slope combines two estimated coefficients. Its standard error must include their covariance:

SE(θ)=Var⁡(b1)+Wc2Var⁡(b3)+2WcCov⁡(b1,b3).

Suppose Var⁡(b1)=.04, Var⁡(b3)=.001225 and Cov⁡(b1,b3)=.0014. At high support, Wc=4, so the terms inside the square root are .04, .0196 and .0112. Their sum is .0708, and SE=.0708=.266. Leaving out covariance would give the wrong uncertainty even though the estimated slope stayed −0.6.

Divide the slope by its standard error: t(196)=−.6/.266=−2.25, with p=.025. Using the model’s residual degrees of freedom gives a 95% interval of approximately [−1.12, −0.08]. At low support the covariance contribution changes sign, giving SE=.220 and t(196)=−6.36. At mean support, the standard error is .20 and the test statistic is −5.00.

Use a refit as a shortcut

Re-center support at 14, rebuild its product with stress, and fit the model again. The coefficient of stress now directly gives the stress slope at support 14, and the output supplies its standard error. This refit gives the same answer as the covariance formula.

A simple-slope test asks whether one slope differs from zero. The interaction test asks whether slopes differ across moderator values. Here the three probed slopes are all negative and significant, yet moderation is supported because their sizes differ. Do not use a difference in significance labels as a substitute for the interaction test.

Key Takeaways

  • Probe values on the same scale used to fit the model.
  • Simple-slope standard errors include coefficient covariance.
  • Re-centering the moderator gives a direct simple-slope estimate.
  • A slope test and an interaction test answer different questions.

3.2 Map regions of significance, plot and report an interaction

Picking a few moderator values makes an interaction understandable, but it can miss where statistical significance changes. The Johnson–Neyman technique searches the continuous moderator for that boundary. A plot then puts the changing slopes into the outcome’s units.

Find and interpret a boundary

At the boundary, the absolute simple-slope test statistic equals the critical value. Squaring both sides gives

(b1+b3W)2=tcrit2[Var⁡(b1)+W2Var⁡(b3)+2WCov⁡(b1,b3)].

This is a quadratic equation with zero, one or two real solutions. Check which intervals between solutions meet the significance criterion; do not assume significance must always lie above a root.

For the centered stress model, tcrit=1.972 with 196 residual degrees of freedom. Using the coefficient variances and covariance gives roots near Wc=4.51 and Wc=35.77. Add the support mean 10 to return to raw units: support is about 14.5 or 45.8. The second root is beyond the support scale’s 0–20 range and has no practical interpretation.

Within the example’s range, stress has a significant negative slope below support about 14.5. From about 14.5 to 20, its slope is not significantly different from zero. The boundary marks a change in evidence strength at the chosen significance level. It is not where a real-world process suddenly starts or stops. Sample size and precision affect its location. For categorical moderators, probe groups directly.

Draw predictions in original units

Plot predicted wellbeing against stress at support 6, 10 and 14. Across stress 14 to 26, predictions are:

SupportWellbeing at stress 14Wellbeing at stress 26
662.445.6
1066.054.0
1469.662.4

The low-support line falls most steeply. Label axes with raw stress, support and wellbeing units even if calculations use centered values. Nonparallel lines show the fitted interaction pattern; an inferential test assesses its uncertainty. Crossing lines indicate a reversal in which group has the higher prediction.

The support lines would meet at stress 5, where 1.5+0.10Xc=0. That value is far below mean stress, with few cases in this example. Check data coverage in both variables, including whether plotted combinations are well represented. Extending a line far beyond observed combinations can create an unsupported story.

Report the evidence and design

State coding, centering, all coefficient estimates and their uncertainty, the interaction’s change in R2, named simple slopes, any meaningful boundary, and a plot. For the example, report the interaction as b=.10, SE=.035, t(196)=2.86, p=.005, 95% CI [0.03, 0.17], with ΔR2=.03. With observational data, describe the association as weaker at higher support. Causal wording needs a design that supports it.

Key Takeaways

  • Johnson–Neyman boundaries locate changes in statistical significance.
  • Keep only boundaries supported by the data range.
  • Plot predictions with axes in original units.
  • A significance boundary is not a biological or behavioral switch.
  • Report the interaction, conditional effects and design together.
4

Estimate and interpret simple mediation

A proposed mechanism connects a predictor to an outcome through an intermediate variable. Simple mediation puts numbers on that proposal with two linked regressions. Follow the units through the paths, estimate the indirect effect, and use resampling to describe its uncertainty. Then consider the design and causal assumptions before deciding how strongly the evidence supports the proposed sequence of events.

4.1 Specify a mediation model and its paths

Mediation represents a proposed sequence: a predictor changes an intermediate variable, and that variable changes the outcome. The mediator carries an indirect pathway from X through M to Y. Estimating that pathway begins with two regressions.

Label the paths before calculating

Fit the mediator model M=iM+aX+eM and the outcome model Y=iY+c′X+bM+eY. A third regression, Y=i+cX+e, estimates the total effect.

Path or effectMeaning
aChange in M per unit of X
bChange in Y per unit of M, holding X constant
c′Change in Y per unit of X, holding M constant
abIndirect effect through M
cTotal effect of X on Y

Path b comes from the outcome model containing both X and M. Regressing Y on M alone mixes their relationship with the association involving X. Keep the label “path b” distinct from the general use of b for any regression coefficient.

Follow the units through the product

Suppose 50 students are divided equally between workshop attendance and no attendance. Code attendance as 1 and nonattendance as 0. The mediator is weekly study hours and the outcome is an exam score from 0 to 100. The estimates are a=3.0 hours, path b=1.5 score points per hour, and c′=2.0 points.

Attendance is associated with three additional study hours, and the outcome model associates each additional hour with 1.5 points at the same attendance status. Multiply along the pathway: ab=3.0×1.5=4.5 points. Add the direct effect to obtain c=2.0+4.5=6.5 points.

The hour units cancel in the product. With binary attendance, 4.5 is the indirect score difference for the change from nonattendance to attendance. With a continuous predictor, the indirect effect is measured per one-unit increase in that predictor.

Understand the decomposition

For simple linear models fitted to the same cases with continuous mediator and outcome, c=c′+ab holds exactly. Different case sets, such as those caused by missing data, can break the identity. Nonlinear outcome models also change the relationship.

The direct effect is the association remaining after adjustment for the measured mediator. Calling it a “pure” effect would overstate the result. Under a valid causal model it includes pathways other than the measured mediator, but its value can also reflect confounding, mediator measurement error or a misspecified model.

The arrows express time order: X precedes M, which precedes Y. Random assignment of X followed by measurement of M and then Y provides stronger evidence than measuring everything at once. Randomizing X still leaves the mediator unrandomized, so common causes of M and Y can distort path b. The numerical decomposition alone cannot establish the causal sequence.

Key Takeaways

  • Estimate path b while controlling for X.
  • The indirect effect is the product ab.
  • For the simple linear same-case model, c = c′ + ab.
  • The units of ab are outcome units per predictor unit.
  • A causal pathway needs evidence about time order and confounding.

4.2 Test the indirect effect

The indirect effect is a product of two estimated paths. Test that product directly and give its confidence interval. Separate tests of total and direct effects cannot describe its uncertainty.

Move beyond causal steps

The causal steps approach checks that X predicts Y, X predicts M, and M predicts Y controlling for X, then looks for a reduction from c to c′. Historically, a nonsignificant direct effect was called “full” mediation and a reduced but significant direct effect “partial” mediation.

This sequence requires several tests to succeed, lowering power, and requires a significant total effect. Direct and indirect effects can cancel, so a small total effect can hide a substantial indirect pathway. The steps also supply neither an estimate nor an interval for ab. Significant paths a and b together are a valid joint significance test, but an interval for the product adds information about magnitude and precision.

Calculate the Sobel approximation

The Sobel standard error is

SEab=b2SEa2+a2SEb2,z=ab/SEab.

For a=3.0, SEa=.8, b=1.5 and SEb=.4, the variance contributions are 2.25(.64)=1.44 and 9(.16)=1.44. Their sum is 2.88, giving SEab=1.70 and z=4.5/1.70=2.65, with p=.008. The corresponding normal interval is about [1.17, 7.83].

The product’s sampling distribution is often skewed in finite samples. The symmetric normal approximation can therefore give inaccurate inference and has relatively low power. A bootstrap estimates the shape of the product distribution by resampling the cases.

Build a percentile bootstrap interval
  1. Draw a sample of n cases with replacement from the original sample, retaining each case’s variables together.
  2. Fit both mediation regressions to that resample and store the product of the two path estimates.
  3. Repeat many times, commonly 5,000 or more.
  4. Use the 2.5th and 97.5th percentiles of the stored products for a 95% percentile interval.

Suppose the workshop estimate ab=4.5 has an illustrative bootstrap interval [1.6, 8.3]. Zero lies outside it, supporting a nonzero indirect effect at the .05 level. Its unequal distances below and above 4.5 reflect the skewed distribution. An interval containing zero leaves a zero indirect effect compatible with the data; it does not establish absence.

Report the percentile method and resample count, and fix and report the seed for reproducibility. More resamples reduce random run-to-run variation in the endpoints. Bias-corrected intervals are an alternative, but can inflate false-positive rates in some small-sample settings. Monte Carlo intervals simulate path estimates from their estimates and standard errors. None of these interval methods resolves confounding or an incorrect causal sequence.

Key Takeaways

  • Test the indirect product directly.
  • The Sobel test uses a normal approximation.
  • Resample whole cases and refit both regressions for each bootstrap sample.
  • A percentile interval can be asymmetric.
  • Report the method, resample count and seed.
  • An interval containing zero indicates uncertainty.

4.3 Interpret and report a mediation analysis

A mediation report should describe the size and uncertainty of the pathways and the design that supports their interpretation. Significance labels alone lose information about both magnitude and causal credibility.

Recognize cancellation

If a=2, b=−1.5 and c′=4, then ab=−3 and c=4−3=1. This is inconsistent mediation: the indirect and direct effects point in opposite directions. Requiring a significant total effect before examining the indirect pathway can miss this pattern.

Avoid basing the interpretation on “full” versus “partial” mediation. The significance of c′ depends on sample size and precision. Report direct and indirect estimates with confidence intervals so that readers can judge their possible sizes.

Put the indirect effect on a useful scale

For a binary predictor, the partially standardized effect is ab/SDY. The workshop example has ab=4.5 points and SDY=9.35, giving 4.5/9.35=.48 outcome standard deviations for the attendance contrast. For a continuous predictor, the completely standardized effect is ab×SDX/SDY, expressing the pathway for a one-standard-deviation increase in X.

The proportion mediated is ab/c. In the workshop example it is 4.5/6.5=.69. This ratio becomes unstable when the total effect is close to zero; opposing effects can make it negative or greater than 1. Use it only with same-signed effects and a large sample.

Check the causal proposal

A causal interpretation needs the right time order and no unmeasured confounding of the predictor–mediator, predictor–outcome and mediator–outcome relations. Randomizing the predictor addresses its confounding, but does not randomize the mediator. Reliable measurement of the mediator also matters: measurement error tends to shrink path b and the indirect effect, leaving some of the pathway in the estimated direct effect.

Simple mediation also assumes the mediator’s outcome slope does not depend on X. Add XM to the outcome model to test that assumption, and check the regression assumptions in both equations. A bootstrap improves the interval calculation; it cannot repair an incorrect model.

With cross-sectional measurements, the temporal order of M and Y remains unresolved. Describe a significant indirect estimate as consistent with the proposed mechanism. Successive measurements or a further experiment manipulating the mediator strengthen the design. A mediator follows X in the causal proposal; a confounder is a common cause of X and Y; a moderator changes their association. Theory and design distinguish these roles.

Write a complete result

For the workshop analysis, report path a=3.00, SE=.80 and path b=1.50, SE=.40, then the indirect effect of 4.50 points with its 95% percentile interval [1.6, 8.3] from 5,000 resamples. Report the direct estimate c′=2.00, SE=2.52, t(47)=.79, p=.43, and the total estimate c=6.50, SE=2.50, t(48)=2.60, p=.012. Include intervals for direct and total effects, the coding, software, seed, measurement timing and design limitations.

Key Takeaways

  • Direct and indirect effects can oppose each other.
  • Choose standardization to match a binary or continuous predictor.
  • A near-zero total effect makes the proportion mediated unstable.
  • Randomizing X leaves mediator–outcome confounding unresolved.
  • Check both regression models and the no-interaction assumption.
  • Report effect estimates and intervals instead of relying on full/partial labels.

Moderation and Mediation examples

4 Walkthroughs

1

Turn group membership into fitted comparisons

13 steps
Build codes, recover group means and choose tests that match the comparison.
  1. 1
    IntroductionCompare three training conditions

    A researcher records test scores after control, video or coached training. The group labels identify different conditions; they do not measure an amount. Regression handles such a categorical predictor with coded indicators, such as dummy codes that compare each group with a reference group. You will encode those labels, recover the fitted means, and distinguish an overall group test from an individual comparison.

  2. 2
    ExplanationChoose control as the reference

    Use two indicators: video is 1 only for video learners, and coached is 1 only for coached learners. Control learners have zero on both. With an intercept, two codes preserve all three groups. A third indicator would sum with the others to the constant column and create perfect multicollinearity.

    The case data stay in their original rows; only the two code columns are added. A control row therefore contributes to estimating the model even though both of its indicator entries are zero.

  3. 3
    ExampleRecover the reference mean

    The fitted model is Y^=60+4Dvideo+11Dcoached. For control, substitute zero for each indicator. Both group terms disappear, leaving a predicted score of 60. This is why the intercept is the reference mean in a model containing only group indicators.

    The equation selects a group adjustment through the code row. It never adds both adjustments for the same learner, because a case belongs to only one of these conditions.

  4. 4
    ExampleRead the two group differences

    For video, the code row is (1, 0), so the prediction is 60+4=64. For coached, it is (0, 1), so the prediction is 60+11=71. The slopes 4 and 11 describe differences from control. They are not the group means themselves or differences from an overall average.

  5. 5
    ChallengeMove the reference

    If coached becomes the reference, what are the new intercept and the video coefficient?

    ---reveal---

    The intercept is 71 and the video coefficient is 64 − 71 = −7. The video prediction is still 64. Changing the reference rewrites the comparisons while leaving the fitted group means and model fit unchanged.

  6. 6
    ExampleCompare with the average group

    The plain average of the means is (60+64+71)/3=65. Effect coding gives video (1, 0), coached (0, 1) and control (−1, −1). The equation becomes Y^=65−Evideo+6Ecoached. Its coefficients compare video and coached with the average group mean.

    For video, substitute (1, 0) to obtain 64; for coached, substitute (0, 1) to obtain 71. The new intercept changes what the coefficients compare, while preserving all three fitted means.

  7. 7
    Key InsightKeep the unprinted group in view

    Control has no printed coefficient, but it remains in the fitted model. Its effect is the negative sum of the others: −(−1+6)=−5. Substituting its two −1 codes gives 65+1−6=60. “Unprinted” therefore describes the parameter display, not the cases included in the analysis.

  8. 8
    ChallengeSeparate the two averages

    Control and video each have 10 learners; coached has 20. Is 65 also the mean across all cases?

    ---reveal---

    No. The case-weighted mean is (10 × 60 + 10 × 64 + 20 × 71)/40 = 66.5. Ordinary effect coding gives each group equal weight, so its intercept remains 65 despite the larger coached group.

  9. 9
    ExplanationAsk whether any groups differ

    The two indicators form one categorical predictor. Test them together. With no covariates, the overall F tests equal population group means. Here R2=.273 and F(2,37)=6.95, p=.003. This supports a difference somewhere among the conditions, without establishing every pairwise difference.

    The two numerator degrees of freedom correspond to the two indicators. The 37 residual degrees of freedom come from 40 cases minus the intercept and those two predictors.

  10. 10
    ExampleRead one comparison with uncertainty

    Video minus control is 4 points. With residual SD 8 and 10 cases per group, SE=81/10+1/10=3.58. Thus t(37)=1.12, p=.271. The interval of about [−3.2, 11.2] includes both zero and a sizable positive difference, so the result leaves uncertainty about the population difference.

    The uncertainty combines variation in both estimated means. A small reference group can therefore make several comparisons imprecise, because every one of them uses that same estimated reference mean.

  11. 11
    ChallengeChoose the adjusted test

    Pretest score is added before the group indicators. What test now isolates the contribution of training condition?

    ---reveal---

    Compare the covariate-only model with the model adding both indicators using the change F test. An overall test of all predictors also includes pretest. Keep both indicators together; deleting one would merge its group with control.

  12. 12
    TipReport what the comparisons mean

    State the coding and any covariates, then report the joint test and the relevant differences with confidence intervals. Plan comparisons or adjust for multiple testing. Inspect residuals by group: uneven spreads can make conventional uncertainty estimates unreliable, especially with unequal group sizes.

  13. 13
    RecapMatch codes and tests to the question

    Read coefficients through their coding: dummy codes compare with a reference; effect codes compare with the average group. Use a joint test for the categorical predictor and targeted comparisons for particular differences. Before reporting an adjusted difference, check whether the common-slope model is appropriate.

2

Build an interaction and read its coefficients

14 steps
Work from a continuous interaction to centered coefficients and group-specific lines.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionLet an association depend on context
  2. 2
    ExplanationMake the slope depend on support
  3. 3
    ExampleRead a less negative slope
  4. 4
    ChallengeInterpret the support coefficient
  5. 5
    ExampleTest the changing slope
  6. 6
    ExplanationMove zero to the means
  7. 7
    ExampleTranslate the fitted equation
  8. 8
    ChallengePredict what changes
  9. 9
    TipChoose meaningful scales
  10. 10
    ExampleWrite a line for each group
  11. 11
    ChallengeMove the group comparison
  12. 12
    ConnectionExtend the moderator to three groups
  13. 13
    ChallengeCombine coding and moderation
  14. 14
    RecapRead the equation before the table
3

Probe an interaction and draw the fitted pattern

12 steps
Calculate a conditional slope, carry its uncertainty, then interpret a significance region and plot.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionGo beyond one interaction coefficient
  2. 2
    ExplanationChoose values within the data
  3. 3
    ExampleCalculate the high-support slope
  4. 4
    ExampleCalculate the uncertainty
  5. 5
    ChallengeForm the conditional test
  6. 6
    TipGet the slope directly from a refit
  7. 7
    ExplanationSearch for the significance boundary
  8. 8
    ExampleReturn the boundary to raw support
  9. 9
    ChallengeInterpret what a boundary means
  10. 10
    ExampleDraw the three prediction lines
  11. 11
    ChallengeConnect the plot with the test
  12. 12
    RecapBuild a report from complementary views
4

Estimate and assess an indirect pathway

15 steps
Follow one mediator through path estimates, resampling and a design-aware report.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionPut numbers on a proposed mechanism
  2. 2
    ExplanationFit the mediator regression
  3. 3
    ExampleFit the outcome regression
  4. 4
    ExampleMultiply along the pathway
  5. 5
    ChallengeDiagnose the wrong path estimate
  6. 6
    ConnectionTest the product directly
  7. 7
    ExampleInspect the normal approximation
  8. 8
    ExplanationResample whole cases
  9. 9
    ExampleRead the percentile interval
  10. 10
    ChallengeRead an interval that includes zero
  11. 11
    Key InsightAllow pathways to oppose each other
  12. 12
    ExampleChoose an effect-size scale
  13. 13
    ChallengeSeparate interval evidence from causal evidence
  14. 14
    TipCheck before writing the claim
  15. 15
    RecapReport the pathway and its evidence

Moderation and Mediation practice questions

40 Practice Questions in 4 sets

Set 1: Read group codes and conditional effects10 Practice Questions

Question 1 of 10

A nominal predictor has five categories. How many dummy variables belong in a regression with an intercept?
  1. 5
  2. 3
  3. 4
  4. 6
Show answerHide answer
Answer: C
Five groups require four indicators, leaving one group as the reference. Including all five indicators with an intercept makes their sum duplicate the constant column, so the coefficients would not have a unique solution.

Question 2 of 10

For three delivery methods, Y^=48−3DB+8DC, with method A as reference. What is the predicted mean for method B?
  1. 45
  2. 48
  3. 51
  4. −3
Show answerHide answer
Answer: A
Method B has its own indicator equal to one and the C indicator equal to zero, giving 48 − 3 = 45. The coefficient −3 is a difference from method A’s mean, not method B’s predicted mean by itself.

Question 3 of 10

Three groups have means 20, 26 and 35, and sample sizes 10, 10 and 40. What is the intercept under ordinary effect coding in a groups-only model?
  1. 31
  2. 20
  3. 35
  4. 27
Show answerHide answer
Answer: D
The effect-coded intercept is the plain average of the three means: (20 + 26 + 35)/3 = 27. The case-weighted mean is 31 because the largest group has the highest mean, but ordinary effect coding gives each group equal weight. A change in group sizes would change the case-weighted mean without changing this equal-weight average, as long as the three group means remained fixed.

Question 4 of 10

A regression includes pretest score and three indicators for a four-group program. What test addresses whether the program groups differ after pretest adjustment?
  1. The t test for the first indicator alone
  2. The joint change F test for the three indicators
  3. The overall F test for all four predictors
  4. The t test for the pretest coefficient
Show answerHide answer
Answer: B
Compare the pretest-only model with the model adding all three group indicators. The overall F for every predictor also tests the pretest contribution, so it does not isolate whether the groups differ after adjustment for pretest score. The reduced and full fits must use the same observations so that the change measures added predictors, rather than a change in the sample.

Question 5 of 10

In Y^=10+2X+4W−0.3XW, what happens to the slope of X when W increases by one unit?
  1. It increases by 0.3.
  2. It decreases by 0.3.
  3. It decreases by 4.
  4. It stays at 2.
Show answerHide answer
Answer: B
The X slope is 2 − 0.3W, so increasing W by one subtracts 0.3 from that slope. The coefficient 4 describes the W slope at X = 0; it is not the change in the X slope as W increases.

Question 6 of 10

A workload scale has mean 18. What is the mean-centered value of a score of 23?
  1. 23
  2. 41
  3. −5
  4. 5
Show answerHide answer
Answer: D
Subtract the sample mean from the observed score: 23 − 18 = 5. Centering moves the zero point to the mean; reversing the subtraction would produce −5 and would reverse the meaning of above-mean and below-mean scores.

Question 7 of 10

A model is Y^=30+1.2X+4D+0.8DX, where D = 1 for mentoring and 0 for control. What is the mentoring group’s slope for X?
  1. 2.0
  2. 1.2
  3. 0.8
  4. 5.2
Show answerHide answer
Answer: A
For mentoring, substitute D = 1 and collect the X terms: 1.2X + 0.8X = 2.0X. The product coefficient 0.8 is the difference between the mentoring and control slopes, not the mentoring slope itself. The separate group equation is obtained by substituting the group code and collecting like X terms; its intercept is 34 but its slope is 2.0.

Question 8 of 10

For a centered moderator, b1=1.6 and b3=−0.2. Its raw mean is 8. What is the simple slope at raw moderator value 11?
  1. −0.6
  2. 2.2
  3. 1.0
  4. 1.4
Show answerHide answer
Answer: C
The raw value 11 corresponds to a centered value of 3, so the slope is 1.6 − 0.2(3) = 1.0. Substituting raw 11 into the centered equation would give −0.6 and evaluate the slope at the wrong moderator value.

Question 9 of 10

An onboarding group has mean confidence 10 and mean performance 60; control has means 6 and 50. The same-case simple linear outcome model gives path b = 1.5. What is the direct effect of onboarding, coded 1 versus control 0?
  1. 6 points
  2. 10 points
  3. 16 points
  4. 4 points
Show answerHide answer
Answer: D
The confidence difference gives a = 10 − 6 = 4, while the performance difference gives total effect c = 60 − 50 = 10. The indirect effect is 4 × 1.5 = 6, leaving direct effect c′ = 10 − 6 = 4 points. Reporting 6 would confuse the indirect pathway with the remaining direct difference.

Question 10 of 10

An indirect effect is estimated as 1.8 with a 95% percentile bootstrap interval [−0.4, 4.2]. What conclusion follows at the .05 level?
  1. A zero indirect effect remains compatible with the data.
  2. The indirect effect is significantly positive.
  3. The indirect effect is established as zero.
  4. The direct effect is significantly positive.
Show answerHide answer
Answer: A
The interval includes zero, so this interval-based test does not support a nonzero indirect effect at .05. It also includes sizable positive effects, so treating the result as evidence that the indirect effect equals zero discards its uncertainty.
Set 2: Fit and test the models10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

In an effect-coded three-group model, the two printed effects are −4 and 7. What is the unprinted group’s effect?
  1. 3
  2. −3
  3. 11
  4. −11
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A study has 90 cases and a continuous covariate. Adding two group indicators raises R² from .20 to .28. What change test evaluates the categorical predictor?
  1. F(2,87)=4.83
  2. F(3,86)=11.15
  3. F(2,86)=3.44
  4. F(2,86)=4.78
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

An interaction coefficient is −0.24 with SE = 0.08. What is the equivalent one-product change F statistic?
  1. 9
  2. −3
  3. 3
  4. 0.09
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

The raw model is Y^=12+3X−2W+0.5XW. X is centered at 4 and W at 6. What are the new intercept and X coefficient?
  1. 24 and 3
  2. 12 and 6
  3. 24 and 6
  4. 36 and 5
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A four-group moderator interacts with one continuous predictor. How many product terms form the moderation block?
  1. 4
  2. 1
  3. 3
  4. 6
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A centered model has b1=0.6, b3=0.2, variances .09 and .01, and covariance −.015. What are the simple slope and its SE at moderator value 2?
  1. 1.0 and 0.265
  2. 1.0 and 0.361
  3. 0.8 and 0.265
  4. 1.0 and 0.300
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A Johnson–Neyman root is 29, but observed moderator values range from 2 to 18. How should that root be interpreted?
  1. It marks a change within the observed sample.
  2. It proves that no moderation was detected.
  3. It is the point where the slope equals zero.
  4. It is outside the data-supported moderator range.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A simple linear mediation model fitted on the same cases gives a = −2, b = 1.5 and c′ = 5. What is the total effect?
  1. 8
  2. 2
  3. −3
  4. −7
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A researcher independently resamples the X, M and Y columns before estimating each bootstrap product. What should be changed?
  1. Resample whole rows so each case’s variables stay together.
  2. Resample each column without replacement instead.
  3. Resample only the mediator and hold other columns fixed.
  4. Average the three resampled columns before fitting.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A predictor is randomized, but the mediator is only measured. Which causal relation remains vulnerable to unmeasured confounding?
  1. The predictor–mediator relation
  2. The predictor–outcome relation
  3. The mediator–outcome relation
  4. The assignment–predictor relation
Show answerHide answer

Save this lesson to see this answer.

Set 3: Diagnose interpretation errors10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Group means are A = 32, B = 37 and C = 29. A regression is refitted with B as the reference. What are the intercept and C coefficient?
  1. 32 and −3
  2. 37 and 8
  3. 29 and −8
  4. 37 and −8
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Two indicators compare programs B and C with A. The B coefficient has p = .64. A researcher deletes B’s indicator but keeps C’s indicator. What restriction has the researcher imposed?
  1. Programs B and C have the same prediction at equal covariates.
  2. Programs A and B have the same prediction at equal covariates.
  3. Program B is excluded from every fitted prediction.
  4. All three programs have the same prediction at equal covariates.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A product coefficient is positive while the focal predictor’s slopes are negative throughout the observed moderator range. How do those slopes change as the moderator rises?
  1. They become more negative.
  2. They stay equally negative.
  3. They become less negative.
  4. They immediately become positive.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A researcher centers both continuous predictors, rebuilds their product and obtains the same fitted values but a different product p value. What should be investigated first?
  1. Whether the same cases and equivalent model terms were used.
  2. Whether centering made the product more reliable.
  3. Whether centering increased the sample information.
  4. Whether the new zero is closer to the outcome mean.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

For Y^=22+4X+6D−2DX, X ranges from 0 to 5. At what X do the group predictions cross, and which group is higher at X = 4?
  1. They cross at 3; the D = 1 group is higher at 4.
  2. They cross at 3; the D = 0 group is higher at 4.
  3. They cross at 1.5; the D = 0 group is higher at 4.
  4. They cross at 1.5; the D = 1 group is higher at 4.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

At W = 5, the X slope is significant; at W = 9, it is nonsignificant. The interaction has p = .31. What is supported at the .05 level?
  1. The slopes differ because only one reaches significance.
  2. The slope is zero at 9 and nonzero at 5.
  3. The interaction is significant because one slope is significant.
  4. The slope differs from zero at 5, without evidence here of changing slopes.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A centered moderator has mean-zero coding based on raw mean 15. Its meaningful Johnson–Neyman boundary is −3 on the centered scale. What raw value should the report give?
  1. −3
  2. 18
  3. 12
  4. −18
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A linear mediation analysis uses 100 cases for the total-effect model and 82 complete cases for the mediator and outcome models. Its estimates do not satisfy c = c′ + ab. What should be checked first?
  1. Refit all models on the same complete-case sample.
  2. Force the direct estimate to equal c minus ab.
  3. Reverse path b so the indirect effect changes sign.
  4. Add bootstrap samples until the identity appears.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A 95% percentile interval for ab is [−5.1, −0.7], while the total effect has p = .28. What does the interval support?
  1. No indirect effect because the total is nonsignificant.
  2. A negative indirect effect differing from zero.
  3. A positive indirect effect differing from zero.
  4. A direct effect equal to the total effect.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

An indirect effect is 4 and the direct effect is −3.8 in a same-case simple linear model. Why would reporting a proportion mediated of 20 be misleading?
  1. The ratio should use the direct effect as its denominator.
  2. The indirect effect must have the direct effect’s negative sign.
  3. The ratio must be capped at one before reporting it.
  4. The near-zero total and opposing signs make the ratio unstable.
Show answerHide answer

Save this lesson to see this answer.

Set 4: Connect models, uncertainty and design10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Two groups have X slopes 1 and 5. The moderator is coded −1 for the first group and +1 for the second. What are the X and product coefficients?
  1. 3 and 2
  2. 1 and 4
  3. 3 and 4
  4. 5 and 2
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

An adjusted group difference is 3.4 points with 95% CI [−1.1, 7.9]. What interpretation respects the interval?
  1. The groups have equal adjusted population means.
  2. The adjusted difference must be positive in the population.
  3. The data allow both zero and appreciable positive differences.
  4. The interval rules out differences larger than 3.4 points.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Study A adds an interaction, raising R² from .30 to .34. Study B raises R² from .60 to .63. Which interaction has the larger incremental f², and by how much approximately?
  1. Study A, by .010.
  2. Study B, by .020.
  3. Study A, by .020.
  4. Study B, by .010.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

What happens to the standard deviation of X when the same constant is subtracted from every score?
  1. It decreases by that constant.
  2. It becomes one.
  3. It becomes zero.
  4. It stays unchanged.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A three-group moderator uses effect codes A = (1, 0), B = (0, 1), C = (−1, −1). The X coefficient is 3 and its two product coefficients are 1 and −2. What are the group slopes?
  1. A = 4, B = 1, C = 3.
  2. A = 1, B = −2, C = 1.
  3. A = 4, B = 1, C = 4.
  4. A = 2, B = 5, C = 2.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A researcher wants the X slope at raw W = 30 directly in the output. How should W be recoded before rebuilding the product?
  1. W + 30
  2. W − 30
  3. W ÷ 30
  4. 30 − W
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

An observational model is Y^=10+3X+8D−DX, with D coded 0/1. Observed X ranges from 1 to 6. What does its implied crossing support?
  1. A crossing at X = 8, beyond the observed range.
  2. A crossing at X = 8 that establishes a causal reversal.
  3. A crossing at X = 2.67 within the observed range.
  4. A crossing at X = 2.67 that establishes a causal reversal.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A cross-sectional mediation model gives a = −2, b = 3 and c′ = 7, with a 95% bootstrap interval for ab of [−9, −2]. What conclusion combines the model and design evidence?
  1. Indirect = −6, total = 13; temporal mediation remains unresolved.
  2. Indirect = −6, total = 1; the causal sequence is established.
  3. Indirect = 6, total = 13; the causal sequence is established.
  4. Indirect = −6, total = 1; temporal mediation remains unresolved.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

For continuous X, ab = 2 outcome units per predictor unit, SD_X = 3 and SD_Y = 12. What is the completely standardized indirect effect?
  1. 0.17
  2. 6.00
  3. 0.50
  4. 0.06
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A researcher reports “full mediation” because c′ has p = .12, while its 95% interval is [−2, 9]. What should replace that interpretation?
  1. Report c′ and its interval alongside the indirect estimate and interval.
  2. Set c′ to zero and give all credit to the indirect path.
  3. Conclude that the mediator accounts for every causal route.
  4. Remove X from the outcome model and estimate b alone.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

53 Key Terms, each with its definition

A

Adjusted group difference
An adjusted group difference compares predicted group outcomes while holding the covariates in the regression model constant.
When pretest is a covariate, an adjusted group difference of five points compares learners at the same pretest score.

B

Bootstrap resample
A bootstrap resample draws the original number of cases with replacement, so some cases can appear repeatedly and others not at all.
Both mediation regressions are refitted to each bootstrap resample before its product is stored.

C

Categorical predictor
A categorical predictor assigns cases to distinct groups whose numeric labels need not represent amounts or equally spaced steps.
Training method is a categorical predictor with control, video and coached categories.
Change in R²
The change in R² is the additional proportion of outcome variance explained when predictors are added to a reduced model.
The change in R² from adding group codes measures their contribution after pretest adjustment.
Coefficient covariance
A coefficient covariance describes how two coefficient estimates vary together across repeated samples and enters a combined slope’s variance.
The coefficient covariance contributes to the simple-slope standard error away from moderator zero.
Completely standardized indirect effect
A completely standardized indirect effect multiplies ab by the predictor SD and divides by the outcome SD for continuous predictors.
A completely standardized indirect effect describes the pathway for a one-SD predictor increase.
Conditional group difference
A conditional group difference is the difference in fitted group outcomes at a specified value of another predictor.
In a model with unequal group slopes, the conditional group difference is 14 points at six hours and 20 points at ten hours.
Confounder
A confounder is a common cause of variables whose relationship is being studied, potentially distorting an estimated causal pathway.
An unmeasured confounder of study hours and scores can distort the estimated mediator–outcome path.
Contrast coding
Contrast coding represents planned group comparisons through chosen numerical codes whose scaling determines coefficient meaning.
Contrast coding can compare control with the average of two training methods in one coefficient.
Cross-sectional data
Cross-sectional data measure variables at one time, leaving the order of the proposed mediator and outcome unresolved.
Cross-sectional data on confidence and performance leave their proposed causal time order unresolved.
Crossover interaction
A crossover interaction has fitted lines that cross, reversing which group or moderator condition predicts the higher outcome.
A crossover interaction reverses which group predicts the higher score on opposite sides of the crossing.

D

Direct effect
A direct effect is the predictor’s outcome coefficient after adjustment for the measured mediator in the simple mediation model.
An attendance direct effect of two points means attendees score two points higher than nonattendees with the same measured study hours.
Dummy variable
A dummy variable is a group indicator equal to 1 for cases in its named category and 0 for every other case.
The coaching dummy variable equals 1 for coached learners and 0 for everyone else.
Dummy variable trap
The dummy variable trap is perfect multicollinearity caused by including all group indicators together with an intercept.
Including every condition indicator alongside the intercept creates the dummy variable trap.

E

Effect coding
Effect coding represents groups with codes whose coefficients express deviations from the unweighted average of group means.
With effect coding, if the video group mean is 64 and the average group mean is 65, the video effect is one point below average.
Extrapolation
Extrapolation extends a fitted relationship beyond the predictor values or combinations supported by the observed data.
Interpreting a support boundary of 45.8 on a scale ending at 20 would be extrapolation.

I

Inconsistent mediation
Inconsistent mediation occurs when direct and indirect effects have opposite signs, causing partial cancellation in the total effect.
Inconsistent mediation leaves a total of 1 when the indirect effect is −3 and the direct effect is 4.
Incremental f²
The incremental f² divides the increase in R² from added terms by the variance proportion unexplained by the full model.
The incremental f² is about .042 when the interaction adds .03 to a full-model R² of .28.
Indirect effect
An indirect effect is the product of paths a and b in simple mediation, expressing the pathway through the measured mediator.
The indirect effect is 4.5 points when three extra study hours each predict 1.5 exam points.
Interaction plot
An interaction plot shows predicted outcomes against a focal predictor at chosen moderator values to display changing fitted slopes.
An interaction plot shows fitted stress–wellbeing lines at support values of 6, 10 and 14.
Interaction term
An interaction term is a product of predictor values that allows the regression slope of one predictor to depend on another.
The stress-by-support interaction term allows the fitted stress slope to change with support.

J

Johnson–Neyman technique
The Johnson–Neyman technique finds values of a continuous moderator where a conditional-effect test reaches its significance boundary.
If the stress slope’s test reaches significance at a support score near 14.5, the Johnson–Neyman technique locates that boundary.
Joint F test
A joint F test evaluates several regression coefficients together, such as every indicator representing a categorical predictor.
The joint F test evaluates two program indicators together, even if only one of their individual coefficients is significant.
Joint significance test
A joint significance test uses significant paths a and b together as evidence of a nonzero indirect product, without an interval for it.
The joint significance test supports a nonzero indirect product when paths a and b are significant.

L

Lower-order term
A lower-order term is a component predictor retained alongside its product, with its slope evaluated at the other component’s zero.
The stress lower-order term describes its slope at zero support in the raw interaction model.

M

Mean centering
Mean centering subtracts the sample mean from every score, shifting the predictor’s zero without changing its spread or shape.
Mean centering at 20 changes a stress score of 26 to 6 before the interaction product is formed.
Median split
A median split divides a continuous variable into lower and higher groups, discarding differences within each new group.
A median split would replace continuous support scores with two groups and discard within-group variation.
Mediator
A mediator is an intermediate variable proposed to carry an effect from a predictor to an outcome in a causal sequence.
Study hours are the proposed mediator between workshop attendance and later exam performance.
Moderation
Moderation occurs when the size or direction of a predictor’s association with an outcome depends on another variable.
Moderation is present in the fitted pattern when the stress slope varies with support.
Moderator
A moderator is a variable across whose values the association between a focal predictor and its outcome changes.
Social support is the moderator when the fitted stress slope changes as reported support rises.
Multiple testing
Multiple testing means performing several tests, increasing the opportunity for at least one false positive across the tests.
Testing every group pair creates a multiple testing issue that can be addressed with Holm adjustment.

P

Parallel slopes
Parallel slopes are equal predictor slopes across groups, so the fitted difference between groups is constant across that predictor.
The parallel slopes assumption gives two groups the same pretest slope in a model adjusted for pretest.
Partially standardized indirect effect
A partially standardized indirect effect divides the indirect product by the outcome SD, retaining the predictor’s original unit.
The partially standardized indirect effect is .48 when the indirect difference is 4.5 and the outcome SD is 9.35.
Path a
Path a is the regression coefficient predicting the mediator from the predictor, measured in mediator units per predictor unit.
Path a = 3 represents three additional study hours for workshop attendees compared with nonattendees.
Path b
Path b is the mediator’s outcome coefficient in a model that also includes the predictor, so the predictor is held constant.
Path b = 1.5 predicts exam points per extra study hour at the same attendance status.
Percentile bootstrap
The percentile bootstrap forms an interval from percentiles of estimates obtained by repeatedly resampling cases with replacement.
A percentile bootstrap interval uses the 2.5th and 97.5th percentiles of stored indirect estimates.
Pick-a-point analysis
A pick-a-point analysis probes an interaction by estimating and testing conditional effects at selected moderator values.
A pick-a-point analysis estimates stress slopes at low, average and high levels of support.
Product block
A product block is the set of group-by-continuous terms tested together to assess moderation by a multicategory variable.
A three-term product block tests moderation by a four-group variable interacting with X.
Product of z scores
A product of z scores multiplies two already standardized predictors and is different from standardizing their raw product.
The product of z scores for stress and support is constructed after each component is standardized.
Proportion mediated
The proportion mediated is ab divided by the total effect c, a ratio that becomes unstable when the total effect approaches zero.
The proportion mediated becomes 20 when opposing pathways leave an indirect effect of 4 and total of .2.

R

Random seed
A random seed initializes a random-number sequence so that the same resampling analysis can be reproduced under the same setup.
The reported random seed permits the same bootstrap draws to be reproduced under the same setup.
Reference category
A reference category is the group coded zero on every dummy, supplying the baseline for the printed group comparisons.
When the control group is the reference category, a video dummy’s coefficient compares video learners with control learners.
Region of significance
A region of significance is a moderator interval over which the simple-slope test rejects a zero effect at the chosen level.
When the significance boundary for a negative stress slope is support about 14.5, the region of significance extends below that value.
Reparameterization
A reparameterization expresses the same fitted model with a different set of coefficients, preserving its predictions and fit.
Centering is a reparameterization: the new coefficients reproduce the same wellbeing predictions.
Robust standard error
A robust standard error can account for unequal residual variances when estimating uncertainty in a regression coefficient.
A robust standard error is considered when residual spreads differ across the training groups.

S

Simple slope
A simple slope is the estimated change in the outcome per unit of a focal predictor at one specified moderator value.
A simple slope of −0.6 at support 14 predicts 0.6 fewer wellbeing points per additional stress point at that support level.
Slope difference
A slope difference subtracts one group’s regression slope from another’s and is tested by their dummy interaction coefficient.
A slope difference of 1.5 means practice predicts 1.5 more points per hour in a trained group than in an untrained group.
Sobel test
The Sobel test assesses an indirect product with a normal approximation using a standard error built from both path estimates.
The Sobel test gives z = 2.65 when the indirect estimate is 4.5 and its approximate SE is 1.70.
Standardization
Standardization subtracts a variable’s mean and divides by its standard deviation to express scores in standard-deviation units.
Standardization puts each of two predictors in SD units before the product of the two is constructed.
Sum-to-zero constraint
A sum-to-zero constraint requires the group effects under ordinary effect coding to add to zero across the categories.
The sum-to-zero constraint makes the missing group effect −5 when the printed effects are −1 and 6.

T

Total effect
A total effect is the predictor’s outcome coefficient without mediator adjustment, combining the simple model’s direct and indirect paths.
The total effect of 6.5 points combines a two-point direct and a 4.5-point indirect contribution.

U

Unweighted grand mean
The unweighted grand mean is the plain average of the group means, giving equal weight to groups of different sizes.
The unweighted grand mean of group means 60, 64 and 71 is 65, regardless of their sample sizes.

W

Weighted mean
A weighted mean gives values influence in proportion to specified weights, such as the numbers of cases in each group.
A case-weighted mean is pulled toward the highest-scoring group’s mean when that group contains twice as many learners as each other group.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started