*! version 1.0.0 29aug2026

Title

minvar -- Longitudinal measurement invariance testing with effects-coded sem

Syntax

minvar [if], k1(varlist) k2(varlist) [k3(varlist) ... k16(varlist)]
name(stub) [options]

Description

minvar tests whether a latent construct is measured equivalently across
repeated measurements (or any set of parallel indicator lists in wide format).
It fits a sequence of nested models and compares them:

configural same items load on the same factor at each timepoint; all loadings and intercepts free

weak (metric) loadings constrained equal across timepoints

strong (scalar) loadings and intercepts constrained equal across timepoints

strict (residual) optional fourth step (the strict option): each item's residual variance also equated across timepoints

There is no limit on the number of indicators, and up to 16 timepoints/groups
are accepted. Effects coding is used for identification (Little, Slegers, &
Card 2006): each factor's loadings sum to the number of indicators and its
intercepts sum to 0, so the latent variables keep the metric of the items and
factor means are estimated at every timepoint. The residual of each item is
allowed to covary with the residual of the same item at every other
timepoint. Estimation is by method(mlmv) (full-information ML under
missing data) unless overridden.

Iteration logs are suppressed; each model instead prints a start time before
estimation and its elapsed time after (use the log option to watch the
iterations live). After each model, fit statistics
(estat gof, stats(all)) and modification indices are shown. At the end
you get a reporting table in the format recommended by Putnick & Bornstein
(2016): each model's chi2(df), CFI, TLI, RMSEA with its 90% CI, and SRMR,
followed by the nested comparisons (Dchi2, Ddf, p, DCFI, DRMSEA, DSRMR),
the estimation sample size, and a note stating the conventional criteria for
concluding invariance. SRMR (and therefore DSRMR) is unavailable under
mlmv when data contain missing values.

Options

k1(varlist) ... k16(varlist) indicator variables at each
timepoint/group. Every list must contain the same items in the same order.
k1() and k2() are required. t1()-t16() are accepted as synonyms.

name(stub) required. Names the latent variables (stub1,
stub2, ...) and, with save(yes), the saved factor-score variables.

save(yes) saves factor scores from the strong model as
stub1, stub2, ... (existing variables with those names are
replaced; scores come from the strong model even when strict is also
specified). If the weak-to-strong DCFI is worse than -.010, the scores are
still saved but a warning is printed, since latent mean comparisons presuppose
(at least partial) scalar invariance.

strict additionally fits a fourth model that equates each item's
residual variance across timepoints (cross-time residual covariances stay
free), with its own row and comparison in the fit table. Per Putnick &
Bornstein (2016), this step is not required for latent mean comparisons.
Cannot be combined with strongonly.

factors(#) number of timepoints/groups. Optional: it is
inferred from how many k#() lists you fill in. If specified and smaller
than the number of lists given, only the first # lists are used.

cov(stata code) extra covariances passed straight to
sem, written as complete options, e.g.
cov(cov(e.x1*e.x2) cov(e.x3*e.x4)). cov2()-cov8() are also
accepted and simply appended.

strongonly fits only the strong model. Combine with
save(yes) to save the factor scores.

method(name) estimation method passed to sem; default mlmv.

semopts(options) any additional options passed straight to sem,
e.g. semopts(iterate(200) vce(robust)).

nomindices skips estat mindices after each model (faster, shorter log).

log shows the maximization iteration logs, which are suppressed by default.

indnum(#) optional integrity check: minvar exits with an
error if # does not match the number of variables in k1().

Examples

Test whether anxiety is measured equivalently across three timepoints and save the factor scores:

. minvar, save(yes) name(anxiety) ///

k1(anx1_1 anx2_1 anx3_1 anx4_1 anx5_1) ///

k2(anx1_2 anx2_2 anx3_2 anx4_2 anx5_2) ///

k3(anx1_3 anx2_3 anx3_3 anx4_3 anx5_3) ///

cov(cov(e.anx2_2*e.anx4_2) cov(e.anx1_2*e.anx4_2))

All four invariance steps, restricted sample, no modification indices:

. minvar if girl==1, strict nomindices name(warm) k1(...) k2(...) k3(...) k4(...)

Stored results

minvar stores the following in r():

r(cfi_config), r(cfi_weak), r(cfi_strong), r(cfi_strict) CFI of each fitted model (likewise tli_*, rmsea_*, srmr_*, chi2_*, df_*)

r(dcfi_weak), r(dcfi_strong), r(dcfi_strict) change in CFI from the previous model (negative = worse fit; likewise drmsea_*, dsrmr_*)

r(lrchi2_weak), r(lrdf_weak), r(lrp_weak) LR test of that model against the previous one (likewise _strong, _strict)

r(N) estimation sample size

r(factors), r(indnum) number of timepoints and indicators

r(latent) names of the latent variables

With strongonly, only the _strong scalars (plus r(N),
r(factors), r(indnum), and r(latent)) are returned; the
_config/_weak scalars, the change statistics, and the LR-test
results are not. The _strict results exist only when strict was
specified.

The fitted models are left as stored estimates config, weak,
strong, and (if requested) strict, and can be brought back with
estimates restore; their _est_ marker variables are removed from
the dataset, so a restored model's e(sample) is no longer tracked.

References

Chen, F. F. 2007. Sensitivity of goodness of fit indexes to lack of
measurement invariance. Structural Equation Modeling 14: 464-504.

Cheung, G. W., and R. B. Rensvold. 2002. Evaluating goodness-of-fit
indexes for testing measurement invariance. Structural Equation Modeling
9: 233-255.

Little, T. D., D. W. Slegers, and N. A. Card. 2006. A non-arbitrary
method of identifying and scaling latent variables in SEM and MACS models.
Structural Equation Modeling 13: 59-72.

Putnick, D. L., and M. H. Bornstein. 2016. Measurement invariance
conventions and reporting: The state of the art and future directions for
psychological research. Developmental Review 41: 71-90.

Author

Justin Dyer

Brigham Young University

justindyer@byu.edu

Last updated: 29 August 2026