Comparing two effects in SEM with clustered data
Two significant coefficients do not establish that they differ. Ordinary bootstrapping also does not, by itself, account for dependence among respondents in the same class, work team, or assessment unit.
Testing an individual effect, testing a difference between effects, and checking robustness to clustering answer different questions. This article explains how to identify clusters, choose the bootstrap resampling unit, and define contrasts in AMOS 28. It states the limits of each conclusion alongside the relevant result.
The setting, variable names, sample sizes, and numerical tables below were constructed for teaching. They are not survey data or empirical software output. The assumed coefficients, standard errors, confidence intervals, and p-values illustrate interpretation and must not be used as research evidence.
1. Separate three statistical questions
A study may include several predictors and ask which has the stronger association with an outcome. A common mistake is to inspect two estimates, select the larger one, and describe this as established superiority. Point estimates alone do not support that conclusion.
Gelman and Stern (2006) explain that the difference between a significant result and a nonsignificant result is not itself necessarily significant. A direct contrast is needed. The same reasoning applies when both effects are significant but one estimate is larger.
| Question | Quantity to inspect | Permitted conclusion |
|---|---|---|
| Does each effect differ from zero? | The estimate, SE, confidence interval, or p-value for that effect. | Evidence concerning an individual effect. |
| Do the two effects differ? | The estimated contrast and its confidence interval or p-value. | Evidence concerning a difference in the prespecified direction. |
| Is the conclusion robust to clustering? | Inference that accounts for dependence within clusters. | Sensitivity of the relevant conclusion to how the data structure is handled. |
Based on Gelman and Stern (2006) and Cameron and Miller (2015). SE: standard error.
A robustness table for individual paths does not replace a table testing contrasts. Conversely, a contrast bootstrapped by resampling individuals does not establish that its conclusion survives cluster-level resampling. Identify the question before selecting the relevant output.
2. The illustrative model and setting
Suppose an educational study includes 432 students in 54 classes, with 8 sampled students per class. Students report their learning experiences, while the teacher responsible for each class rates proactive learning. This is a hypothetical design, not a description of a completed survey.
| Code | Variable | Meaning in this example |
|---|---|---|
| PF | Development-oriented feedback | Perceived feedback that helps a student improve how tasks are addressed. |
| HT | Learning support | Perceived support during learning. |
| TT | Problem-solving self-efficacy | Belief in the ability to handle tasks, rather than a direct measure of actual ability. |
| CD | Proactive learning | The outcome rated by the teacher responsible for the class. |
| AT | Psychological safety | Each student's perception of being able to express views and ask questions. |
The variables and their roles are hypothetical. These descriptions are not validated measurement scales. Codes are retained across the Vietnamese and English editions.
The model hypothesizes that PF and HT are associated with CD through TT. AT moderates the PF → TT and HT → TT paths. The resulting indirect associations may therefore vary with AT: a model of first-stage moderated mediation. Hayes (2015) presents an index for testing linear variation in an indirect effect.
Simplified structural diagram; measurement models and covariances are omitted. Path labels denote parameters.
Two predictors
PF: development-oriented feedback. HT: learning support.
Mediator and outcome
PF and HT → TT → CD. Direct PF → CD and HT → CD paths remain in the model.
Moderator
AT moderates the two predictor-to-TT paths.
Level of measurement
AT is an individual student's perception. Class membership does not automatically make it a class-level variable.
In this example, AT is an individual-level variable. Shared class membership does not automatically turn it into a class characteristic. Testing a class-level characteristic, or separating within-class from between-class relationships, requires a research question and model that explicitly address those levels.
3. What is a cluster and why does it matter?
A cluster is a group of observations that share data-generating conditions and may consequently be dependent. Here, the cluster is the class. Students in a class share a learning environment and a teacher who rates CD. A variable such as ClassID identifies membership. This structure exists before analysis; it is not an output of a clustering algorithm.
Class A
One class teacher rates the sampled students. Students also share the classroom context.
Class B
A different class teacher rates another group. Their observations constitute another cluster.
A teacher may rate more strictly than another teacher. Students in a class may also share resources or a timetable. Their errors may therefore be correlated. Cameron and Miller (2015) explain why ignoring within-cluster correlation can make conventional standard errors overstate precision.
Other examples include employees reporting to one manager, patients in one facility, or participants at one study site. Cluster selection should follow the data-generating process. Do not try several grouping variables and retain the one producing favorable p-values. If one teacher covers several classes, or classes share a school, assess the wider dependence structure rather than assuming that class-level adjustment resolves it.
In a simple random-intercept model, the ICC is the between-cluster variance divided by total variance. A near-zero ICC indicates low similarity for the variable examined, but it is not an automatic license to ignore clustering. Consequences for inference also depend on cluster sizes, the number of clusters, and predictor structure (Cameron & Miller, 2015).
A nonsignificant test of between-class variance does not demonstrate independent observations. Use the ICC as additional descriptive information alongside the study design, rather than turning one cutoff into a universal decision rule for SEM.
4. Cluster adjustment or multilevel modeling?
Cluster-adjusted standard errors and multilevel models do not serve identical purposes. The former primarily changes inference for the pooled relationship being estimated. The latter models structure at multiple levels. They should not be treated as interchangeable options selected according to which yields more attractive results.
| Approach | Primary purpose | Limitation |
|---|---|---|
| Cluster-robust SEs | Allow errors within a cluster to be dependent when constructing SEs and tests, commonly through sandwich adjustment. | Do not automatically separate within- and between-cluster relationships or correct misspecification and measurement bias. |
| Cluster bootstrap | Construct a sampling distribution by resampling whole clusters and re-estimating the model. | Requires sufficient cluster-level information and scrutiny of failed or inadmissible estimates; suitability depends on the design. |
| Multilevel model | Explicitly represent components and relationships at specified levels. | Requires level-appropriate questions, variables, and assumptions; complexity increases data demands. |
Based on Cameron and Miller (2015), Field and Welsh (2007), and Gelman (2006).
If the question concerns variation in the PF–TT relationship across classes, a class-robust SE alone does not answer it. If the target remains a pooled coefficient but dependence may exaggerate precision, cluster-aware inference deserves consideration. Gelman (2006) describes multilevel modeling as incorporating group structure in the model rather than merely adjusting an SE.
Many individuals in a few clusters do not provide the same independent information as the same number spread across many clusters. Report both individuals and clusters. Few clusters or highly unequal cluster sizes require attention to the selected correction and resampling method; no single cluster-count threshold guarantees valid inference for every application (Cameron & Miller, 2015).
One-way cluster-robust inference still relies on independence across clusters at the level being considered. If classes within a school remain dependent, reassess that structure. Class-level adjustment does not automatically resolve every relationship among schools, teachers, and classes.
5. Choose the bootstrap resampling unit
A bootstrap constructs repeated samples from the available data and estimates the target in each sample. The resampling unit is part of the method. Field and Welsh (2007) describe resampling clusters with replacement. In a whole-cluster bootstrap, observations inside a selected cluster are retained together.
| Feature | Ordinary bootstrap | Whole-cluster bootstrap |
|---|---|---|
| Resampling unit | An individual student. | A class. |
| Hypothetical design | Draw 432 rows with replacement per replicate. | Draw 54 classes with replacement and retain the 8 sampled students from each selected class. |
| A class is selected twice | No whole-class selection is performed. | All its records appear once for each selection. |
| Unequal cluster sizes | The number of individuals is normally fixed by the row-resampling setup. | The total number of individuals may vary across replicates. |
The counts 432 and 54 belong only to the hypothetical design. With 8 sampled students in every class, each whole-cluster replicate still has 432 records. Unequal class sizes need not preserve that total.
When a cluster is drawn twice, its copies must be handled as separate draws in the chosen workflow. If the re-estimated model also uses a cluster identifier, check how replicated clusters are relabeled. Otherwise, the implemented procedure may differ from the one described.
The number of replicates, resampling unit, and interval construction method are separate specifications. “5,000 replications” does not reveal whether students or classes were resampled. Percentile, bias-corrected (BC), and bias-corrected and accelerated (BCa) intervals must also be named accurately. BCa adds acceleration to bias correction; not every bootstrap interval is BCa (Efron, 1987).
The ordinary Perform bootstrap settings in AMOS 28 do not provide a ClassID selector for whole-class resampling or an option producing cluster-robust MLR output. Report ordinary bootstrap results within that scope. A cluster-aware analysis needs a separate supported workflow. User-defined estimands define the target; they do not change the resampling unit (Amos Development Corporation, n.d.).
Increasing the number of replicates does not repair an inappropriate resampling unit. Establish the design first, then examine convergence, inadmissible solutions, usable replications, and the stability of the resulting distribution.
6. Define the quantity being compared
Consider a linear model with two predictors, one shared mediator, and first-stage moderation. The equations omit the measurement model and controls to focus on coefficient interpretation. Coefficients refer to the unstandardized scales in use.
CD = γ + bTT + c′PFPF + c′HTHT + εCD
At AT = w, the PF slope is aPF + uPFw and the HT slope is aHT + uHTw. If b is not moderated, their conditional indirect effects are (aPF + uPFw)b and (aHT + uHTw)b. Their indices of moderated mediation are uPFb and uHTb, expressing linear change in an indirect effect with AT (Hayes, 2015).
Contrast between interaction coefficients
This asks whether the rate at which the predictor-to-mediator slope changes with AT differs across predictors. It does not directly compare the slopes at one particular AT value.
Contrast between indices of moderated mediation
This contrasts changes in the indirect effects as AT changes. The simplified expression applies because both branches share TT and the same b coefficient. Different mediators, different b paths, or second-stage moderation require expressions reflecting those structures.
Contrast between indirect effects at a specified AT value
This is a different question. Similar indices can coexist with different indirect effects at AT = 0 when the a coefficients differ. To state which predictor has the larger indirect effect at low AT, define and bootstrap that particular conditional contrast.
Changing the unit of PF changes its coefficient and the coefficient of PF × AT. An unstandardized comparison therefore applies to the specified scales and identification choices. For latent variables, state how their scales are fixed. A larger coefficient is not automatically evidence of greater overall importance. A standardized comparison requires defining and estimating uncertainty for the corresponding standardized contrast.
7. Obtain the contrasts in AMOS 28
The following workflow obtains ordinary bootstrap results for the defined targets. Do not split the sample into PF and HT groups: both predictors enter one model. The official user-defined estimand documentation supports functions of model parameters with bootstrap SEs, intervals, and significance tests (Amos Development Corporation, n.d.).
Check the model and label paths
Start with a converged model and an acceptable solution. Double-click an arrow, open Object Properties → Parameters → Regression weight, and enter a unique label. Reusing one label for two paths can impose equality rather than merely naming them.
Define the estimands
Click the estimand status bar at the bottom of the AMOS window and choose Define new estimands, or edit the existing estimand file. If needed, enable View → Interface Properties → Misc → Show the status bar. Enter the formulas below, check syntax, and save.
Request and inspect bootstrap results
In View → Analysis Properties → Bootstrap, select Perform bootstrap and specify a planned count, for example 5,000. Select Bias-corrected confidence intervals at 95%. After Calculate Estimates, open Text Output. For User-defined estimands, inspect Estimates for the contrast, Bootstrap standard errors for SE, and Bias-corrected percentile method for Estimate, Lower, Upper, and P. Verify the usable count in Summary of Bootstrap Iterations.
| Path | Regression weight label | Meaning |
|---|---|---|
| PF → TT | aPF | The PF a path. |
| HT → TT | aHT | The HT a path. |
| PF × AT → TT | intPF | The PF interaction. |
| HT × AT → TT | intHT | The HT interaction. |
| TT → CD | b | The shared b path. |
These labels support the example workflow. Constructing product terms and specifying interactions must remain consistent with the selected model. Labels do not replace checking the measurement model or latent interaction specification.
Index_PF = p.intPF * p.b
Index_HT = p.intHT * p.b
Diff_Interaction = p.intPF - p.intHT
Diff_Index = (p.intPF * p.b) - (p.intHT * p.b)Use parameter labels so AMOS recomputes each target within each bootstrap sample. Do not substitute rounded constants such as 0.140 and 0.100: that would remove the variability of interest. Do not subtract two individual SEs or interval endpoints to construct the SE or interval for a difference.
Retain the model, estimand definitions, and output from the same run. Intervals can differ across bootstrap runs even when point estimates coincide. Report the software version, planned and usable replication counts, interval method, resampling unit, and contrast direction.
8. Read two hypothetical results tables
The following tables contain assumed teaching values, not results from AMOS or another package. They illustrate different questions and a situation where inferential methods do not agree completely. In an empirical analysis, replace every numerical entry with traceable output.
Sensitivity of individual effects
| Path or effect | Assumed B | Assumed cluster-robust MLR p | Assumed cluster-bootstrap 95% BC CI |
|---|---|---|---|
| PF → TT | 0.320 | .004 | [0.110, 0.510] |
| HT → TT | 0.240 | .012 | [0.060, 0.430] |
| PF × AT → TT | 0.140 | < .001 | [0.050, 0.240] |
| HT × AT → TT | 0.100 | .003 | [0.020, 0.180] |
| TT → CD | 0.450 | .006 | [0.190, 0.700] |
| PF → CD | 0.120 | .041 | [−0.010, 0.250] |
| HT → CD | 0.090 | .063 | [−0.020, 0.200] |
| PF → TT → CD | 0.144 | .021 | [0.041, 0.286] |
| HT → TT → CD | 0.108 | .057 | [0.016, 0.241] |
Hypothetical design: 432 students, 54 classes, and 5,000 planned whole-class resamples. MLR: maximum likelihood with robust inference. B is unstandardized. Indirect effects refer to AT = 0; call this the mean only when the actual scaling and centering support that interpretation. All SEs, intervals, and p-values in the example are assumed, not calculated from data.
For PF → CD, the assumed MLR p is .041 while the assumed cluster-bootstrap interval includes zero. For the HT indirect effect, p is .057 while the interval excludes zero. These columns use different inferential procedures and need not agree exactly. In a real analysis, first verify that they concern the same parameter, model, and data. Then report method sensitivity rather than selecting the favorable column.
Do not call an MLR p-value the p-value corresponding to a BC interval from another procedure. Preserve the method labels. This table also cannot establish differences between predictors because it contains no direct contrast.
Direct contrasts
| Quantity | PF | HT | Difference | Assumed bootstrap SE | Assumed 95% BC CI | Assumed p |
|---|---|---|---|---|---|---|
| Interaction effect on TT | 0.140 | 0.100 | 0.040 | 0.055 | [−0.065, 0.149] | .472 |
| Index of moderated mediation | 0.063 | 0.045 | 0.018 | 0.026 | [−0.029, 0.079] | .506 |
Suppose Table 7 uses ordinary student-level bootstrapping within the same model and run. The illustrative point products are consistent: 0.140 × 0.450 = 0.063 and 0.100 × 0.450 = 0.045. SEs, intervals, and p-values are assumed teaching values, not software output.
PF is numerically larger, but both contrast intervals include zero. The appropriate statement is that the chosen procedure does not provide sufficient evidence of a difference. It does not establish that PF is more effective. To assess robustness of the contrasts themselves, resample whole classes and recompute Diff_Interaction and Diff_Index within each replicate. The individual-effect results in Table 6 do not supply that test.
Failure to detect a difference also does not establish equivalence. Lakens (2017) explains that equivalence testing requires prespecified bounds for differences considered practically negligible and an appropriate testing procedure. A large p-value for a zero-difference test is insufficient.
9. Reporting templates
Replace the placeholders below with actual study information. Methods should identify the unit of analysis, resampling unit, and bootstrapped target. Results should state the estimate, uncertainty, and inferential limits.
Cluster structure and robustness
The data comprised [N] individuals in [G] [cluster units]. To address within-cluster dependence, we used [method, software, and version]. The bootstrap resampled [unit] with replacement, with [planned count] replications and [usable count] acceptable solutions. The [level] confidence intervals used the [exact interval method].
Comparing two effects
The contrast was defined as [A minus B] and estimated directly within the same model. For [quantity], Δ = [value], bootstrap SE = [value], [level] CI [lower, upper], p = [value]. This result [provided/did not provide] evidence of a difference under the selected procedure. The contrast [was/was not] additionally examined with cluster-level resampling.
If methods disagree, identify the affected path and procedures. Avoid describing all findings as fully robust when an important effect changes conclusion. Neither one p-value nor one interval warrants causal language unsupported by the design.
10. Common mistakes
| Statement or practice | Problem | Correction |
|---|---|---|
| A is significant and B is not, so A is stronger. | Compares significance classifications instead of effects. | Define A − B and estimate uncertainty for that contrast. |
| Bootstrapping has already handled the clusters. | The resampling unit is unspecified. | State whether individuals or whole clusters were resampled and match the design. |
| The ICC is low, so clustering can be ignored. | Turns a descriptive statistic into a universal rule. | Consider design, cluster count, cluster sizes, and the inferential target. |
| Subtract two SEs or interval endpoints. | Ignores the joint distribution of estimates. | Compute the contrast in each bootstrap replicate or use a corresponding direct test. |
| Call the index contrast an indirect-effect contrast at low AT. | These are different quantities. | Write the conditional indirect contrast at the specified AT value. |
| Nonsignificance proves equivalence. | Failure to reject zero difference is not equivalence evidence. | Prespecify meaningful equivalence bounds and an appropriate procedure when equivalence is the target. |
| Retain every converged bootstrap fit. | Convergence can coexist with inadmissibility, such as a negative variance. | Specify acceptable-solution criteria and examine exclusions. |
Based on Gelman and Stern (2006), Cameron and Miller (2015), Hayes (2015), Lakens (2017), and the official AMOS estimand guidance.
11. Before publication
- Identify clusters from sampling, organization, or assessment, and report both N and the cluster count.
- Distinguish individual effects, effect contrasts, and robustness of those contrasts.
- State scales, centering, and contrast direction; verify each estimand against the model.
- Keep the model, data, missing-data handling, and estimation settings aligned when comparing methods.
- Report the resampling unit, interval type, planned and usable counts, and admissibility criteria.
- Retrieve SEs, intervals, and p-values from the correct output sections; preserve their method labels.
- Check cluster-aware robustness for the contrasts themselves when they are central to the study.
- Disclose method-sensitive conclusions and do not interpret a large p-value as proof of equivalence.
Conclusion
In a model with multiple predictors, asking which is stronger requires a clearly defined contrast. With clustered data, uncertainty for that contrast must also be evaluated through a procedure appropriate for the data structure. An appealing set of point estimates does not replace either requirement.
AMOS 28 supports user-defined estimands with ordinary bootstrapping. Cluster-aware inference must be identified and implemented through a suitable separate workflow, then described according to what was actually done.
References
Cluster structure and resampling
- Cameron, A. C., & Miller, D. L. (2015). A practitioner’s guide to cluster-robust inference. Journal of Human Resources, 50(2), 317–372. https://doi.org/10.3368/jhr.50.2.317
- Efron, B. (1987). Better bootstrap confidence intervals. Journal of the American Statistical Association, 82(397), 171–185. https://doi.org/10.1080/01621459.1987.10478410
- Field, C. A., & Welsh, A. H. (2007). Bootstrapping clustered data. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 69(3), 369–390. https://doi.org/10.1111/j.1467-9868.2007.00593.x
- Gelman, A. (2006). Multilevel (hierarchical) modeling: What it can and cannot do. Technometrics, 48(3), 432–435. https://doi.org/10.1198/004017005000000661
Effect comparisons and AMOS guidance
- Amos Development Corporation. (n.d.). User-defined estimands [Tutorial]. Official user-defined estimand tutorial.
- Gelman, A., & Stern, H. (2006). The difference between “significant” and “not significant” is not itself statistically significant. The American Statistician, 60(4), 328–331. https://doi.org/10.1198/000313006X152649
- Hayes, A. F. (2015). An index and test of linear moderated mediation. Multivariate Behavioral Research, 50(1), 1–22. https://doi.org/10.1080/00273171.2014.962683
- Lakens, D. (2017). Equivalence tests: A practical primer for t tests, correlations, and meta-analyses. Social Psychological and Personality Science, 8(4), 355–362. https://doi.org/10.1177/1948550617697177
Academic note: Tables and diagrams use a hypothetical example for teaching. This is not an empirical report, scale-validation document, or evidence of causal relationships. Match the AMOS workflow to the actual model, version, and output.
