Structural Equation Models for Comparing Dependent Means and Proportions Jason T. Newsom How to Do a Paired t-test with Structural Equation Modeling Jason T. Newsom Overview • Rationale • Structural equation model equivalents of conventional tests • Continuous • Binary variables • Multiple indicators • Multiple time points • Mixed factorial tests Why Use SEM to Compare Repeated Means or Proportions? • Many longitudinal designs only have a few time points (e.g., pre, post, follow-up) • Mean or proportion change hypotheses common • Understand underpinnings of more complex longitudinal models and how they relate to ANOVA • Statistical advantages • Lots of interesting extensions Statistical Advantages • Robust estimation • Same general models for binary, ordinal, other discrete variables • Account for measure error with multiple indicators • Ensure measurement invariance • Include correlated error structures • Convenient missing data estimation • Easily linked to random effects ANOVA SEM Regression ANOVA t-test Several Equivalent SEMs to Compare Dependent Means • Single difference score 2003) (e.g., Rovine & Liu, 2012; Rovine & Molenaar, • Mean equality constraint (invariance) test • Growth curve specification (Newsom, 2002; Voelkle, 2007) • Latent difference score approach (McArdle, 2001) Single Difference Score • Consider test of single observed repeated measure • Comparison of average difference to 0 is equal to paired (dependent) t-test comparing two dependent means y21 y2 y1 / N t y21 / SE y21 • Which is equivalent to repeated measures ANOVA t2 F Single Difference Score • Equivalently, intercept-only regression y2 1 0 Single Difference Score • Restated as SEM with mean structure (Rovine & Molenaar, 2003) y21 1 1 • Test of average difference in OLS (t-test) and ML (z-test) are asymptotically equivalent as N • OLS model suggests simple SEM model for repeated measures test Single Difference Score Equality Constraint • Nested models compared M 0 : 1 2 M 1 : 1 2 • Likelihood ratio test, where 2 M2 0 M2 1 with df df M 0 df M1 Equality Constraint Contrast Coding Model • ANOVA noted as special case of latent growth curve model from the beginning (e.g.,McArdle & Epstein, 1987; Meredith & Tisak, 1990) • Growth specification for comparing two dependent means or repeated measures (Newsom, 2002, 2015; Voelkle, 2007) • Slope factor mean used to test mean difference Contrast coding model Contrast Coding Model Two time points, omit i subscripts y1 111 212 y2 121 222 If intercept loadings equal 1, slope loadings equal 0 and 1 E y1 E 1 1 E 2 0 E y2 E 1 1 E 2 1 Contrast Coding Model Simplifying, E y1 E 1 E y2 E 1 E 2 Substitute and rearrange, E 2 E y2 E y1 E y2 y1 or, 2 E y2 E y1 E y2 y1 Contrast Coding Model • Generally, growth curve model with common time codes (0, 1, 2, ... T-1) gives baseline mean plus average change (e.g., Bollen & Curran, 2006) E yti 1 2 where 1 is intercept mean and 2 is slope mean Latent Difference Score Model • McArdle’s (2001) latent difference score model also tests mean difference • Autoregressive model with constraints • Additional factor used to capture repeated measures difference Latent Difference Score Model • Autoregression model y2 2 21 y1 2 • Set autoregression coefficient, 21, to 1, the structural intercept, 2, to 0, the disturbance, 2, to 0, and add a new difference score factor, 3, with loading equal to 1 and mean and variance estimated y2 2 21 y1 23 3 2 y2 0 1 y1 13 0 3 y2 y1 E 3 3 E y2 y1 E y2 E y1 Latent Difference Score Model Relation to ANOVA • Use the contrast coding model to illustrate Relation to ANOVA • Because the general growth model can be stated as E yti 1 2 • It is the same as the repeated measures ANOVA model (e.g., Winer, 1971) Yti m p i t t ti E Yti m t t Here, m represents the grand mean, pi represents the average score deviation for each case, tt represents the deviation of the mean at each time point from the grand mean, and ti represents the error. Relation to ANOVA • With two time points, dfA = 1, so MS A SS A Y2 Y1 2 2 22 2 When 2 is the contrast factor mean with loadings set to 0 and 1 Relation to ANOVA • In repeated measures ANOVA (Winer, 1971), Var y1 Var y2 Cov y1 , y2 2 • Using path tracing rules • If constant slope factor variance assumed, fixed at 0, then the intercept factor variance is equal to the covariance of observed variables MSerror Cov( y1 , y2 ) 1121Var 1 1222Var 2 Cov( y1 , y2 ) 1 1 Var 1 1 1 0 Cov( y1 , y2 ) Var 1 Relation to ANOVA • And because the variance of the measurement residual is a function of the observed measures, loadings, and factor variances Var ( ti ) Var yti tk2 kk • Assuming • constant measurement residual variance, Var(), • and loadings for the intercept factor are equal to 1, 2 so that tk 1, • and Cov( y1 , y2 ) Var 1 from above • Then Var y1 Var y2 Var ( ) tk2Var k 2 Var y1 Var y2 Var ( ) Cov y1 , y2 MSerror 2 Example • Average of five items from the positive affect measure (self-rated feelings of "happy," "enjoying yourself," "satisfied," "joyful," and "pleased") • Measured twice, 6 months apart • N = 574 • Means: y2 2.925 y1 3.034 y2 y1 .109 • Conventional repeated measures ANOVA and three model specifications (single-variable difference score model, equality constraint model, contrast coding model, latent difference score model) Example Conventional tests: t (573) = -3.90, (-3.90)2 = 15.21, F(1,573) = 15.24 SEM Results Mean difference Est Single-variable difference score model -.109 Equality constraint model NA Parameter test (z) -3.907 LR Test, 2(1) 15.063 15.063 Contrast coding model -.109 -3.907 15.063 Latent difference score model -.109 -3.907 15.063 Binary Variables • Conventional test of two dependent proportions conditional logistic (e.g., Agresti, 2013) and McNemar’s chisquare (McNemar, 1947) among others SEM GLIM Regression Logistic ANOVA t-test Chi-square Binary Variables Time 2 Time 1 Yes No Yes p11 p12 p1. No p21 p22 p2. p.1 p.2 where p1. and p.1 are marginal probabilities for the first row (Time 1 response) and column (Time 2 response), respectively, and p12 and p21 are discordant (“yes”-”no” and “no-yes”) cell probabilities Binary Variables Time 2 Time 1 Yes No Yes p11 p12 p1. No p21 p22 p2. p.1 p.2 Binary Variables Time 2 Time 1 Yes No Yes p11 p12 p1. No p21 p22 p2. p.1 p.2 Binary Variables • Common SEM estimation with DWLS or full ML • Same models can be used for any discrete variables that can be analyzed with SEM programs (e.g., binary, ordinal, count, categorical, zero-inflated) • Will focus on full ML to highlight equivalence to conventional tests Contrast Coding with Binary Variables Full ML, with each threshold, tt=0 Binary Variables The subject specific form of the conditional logistic model (Cox, 1958; Rasch, 1961) for binary variables logit P yit 1 ai bxt Parallels the growth curve model give above E yti 1 2 For the contrast coding model with variance of 1 freely estimated and full ML estimation logit P yit 1 1 2 Binary Variables Because subject-specific conditional logistic coefficient is p b ln 21 p12 It suggests p21 p12 2 ln So the difference in marginal probabilities or discordant cell probabilities is given by exp 1 2 exp 1 p.1 p1. 1 exp 1 exp 1 2 1 Binary Variables • The score test can be stated in terms of difference of two marginal probabilities (population average) p.1 p1. p21 p12 z p21 p12 / N p21 p12 / N • and it’s square is the McNemar test for df = 1 2 p.1 p1. p21 p12 / N 2 where p1. and p.1 are marginal probabilities for the first row (Time 1 response) and column (Time 2 response), respectively, and p12 and p21 are discordant (“yes”-”no” and “no-yes”) cell probabilities Example Self-report of major health event, N = 574, in national survey of older adults Time 1 Health Event Yes = 1 No = 0 Yes = 1 21 (.037) 119 (.207) 140 (.244) Time 2 Health Event No = 0 21 (.037) 413 (.720) 434 (.756) Total 42 (.073) 532 (.927) Example • Conventional tests • p.1 – p1. = .171 • Conditional logistic = 53.707, p < .001 • McNemar’s test = 68.600, p < .001 • SEM model • 1 = -3.250, 2 = 1.735 • Which is the log of probability ratio p .207 ln 21 ln 1.735 .037 p12 • 2 /SE2= 7.329, p < .001; and (7.329)2=53.714, same as conventional conditional logistic test • LR test constraining (Pearson chi-square fit from Mplus) 2 = 68.596, p < .001, same as McNemar’s test Example • Conventional tests • p.1 – p1. = .171 • Conditional logistic = 53.707, p < .001 • McNemar’s test = 68.600, p < .001 • SEM model • 1 = -3.250, 2 = 1.735 • Which is the log of probability ratio p .207 ln 21 ln 1.735 .037 p12 • 2 /SE2= 7.329, p < .001; and (7.329)2=53.714, same as conventional conditional logistic test • LR test constraining (Pearson chi-square fit from Mplus) 2 = 68.596, p < .001, same as McNemar’s test Latent Variables with Multiple Indicators Latent Variables with Multiple Indicators • No advantage for estimating means, because random measurement error does not bias means • Identification important for mean interpretation • referent variable • single occasion (e.g., Byrne, 1994; Widaman & Reise, 1997), second or third • effects coding (Little, Slegers, & Card, 2006), gives weighted means for each time point • With equality constraints, statistical tests are equal across identification approaches Latent Variables with Multiple Indicators • No advantage for estimating means, because random measurement error does not bias means • Identification important for mean interpretation • referent variable • single occasion (e.g., Byrne, 1994; Widaman & Reise, 1997), second or third • effects coding (Little, Slegers, & Card, 2006), gives weighted means for each time point • With equality constraints, statistical tests are equal across identification approaches Latent Variables with Multiple Indicators • No advantage for estimating means • Consider classical test theory, if expected value of measurement error, E(e) = 0, then the observed mean and true mean are equal. E ( X ) E (T ) E (e) E ( X ) E (T ) 0 E ( X ) E (T ) Latent Variables with Multiple Indicators • But significance tests may be improved because of reduced error variance compared with observed variable (Hancock, 2003) • Standardized effect size for measured variables for between-subjects comparison dy m1 m2 sy • For latent variables for between-subjects comparison d m1 m2 s • Where s < sy, if y has measurement error Multiple Time Points Multiple Time Points • Equality constraint, contrast coding model, or latent difference score model possible • Contrast coding model requires T – 1 difference factors to test T time points • can investigate Helmert contrast (e.g., 2, -1,-1 and 0, -1, 1), forward differencing (-1, 1, 0 and 0, -1, 1), or trend analysis (e.g., -1, 0, 1 and 1, 0, 1), among others • Default specifications resemble MANOVA rather than repeated measures ANOVA in terms of assumptions • Assumptions can be tested, however • Sphericity and compound symmetry can be assessed through equality constraints on difference factor variances and covariances Mixed ANOVA Designs • MIMIC or multigroup approach • For MIMIC approach, predication of difference factor, tests the between by within interaction • For multigroup approach, equality constraints on difference factor tests interaction Mixed ANOVA Designs • Simple difference score Mixed ANOVA Designs • Equality constraint approach Mixed ANOVA Designs • Contrast coding model Mixed ANOVA Designs • Latent difference score model SEM Extensions • Mixed between and within ANOVA models including covariates, with advantage of latent variable covariates • Mixed between and within factorial designs with binary or ordinal variables not presently conveniently tested with conventional tests • Incorporate into larger models with differences as predictors, outcomes, mediators • Readily extends to random effects interpretations Limitations/Cautions • Alternative reference distribution for small N (e.g., < 120) • critical ratio correct, p-values incorrect • Sample size requirements larger for: • robust estimates, bootstrapping, estimation for noncontinuous, or missing data used • Sometimes a structural equation model is just a paired ttest Why consider structural equation modeling approaches to comparing dependent means or proportions? • Understand underpinnings of more complex longitudinal models and how they relate to ANOVA • Estimate measure error with multiple indicators • Ensure measurement invariance • Include correlated error structures • Generalize to binary, ordinal, other discrete variables • Mixed between and within by including covariates, with advantage of latent variable covariates • Incorporate into larger models with differences as predictors, outcomes, mediators • Convenient missing data estimation References Hancock, G. R. (2003). Fortune cookies, measurement error, and experimental design. Journal of Modern Applied Statistical Methods, 2, 293–305. McArdle, J. J. (2001). A latent difference score approach to longitudinal dynamic structural analysis. In R. Cudeck, S. du Toit, & D. Sorbom (Eds.), Structural equation modeling: Present and future (pp. 342– 380). Lincolnwood, IL: Scientific Software International. McArdle, J. J., & Epstein, D. (1987). Latent growth curves within developmental structural equation models. Child Development, 58, 110–133 McNemar, Q. (June 18, 1947). Note on the sampling error of the difference between correlated proportions or percentages". Psychometrika 12, 153–157. Meredith, W., & Tisak, J. (1990). Latent curve analysis. Psychometrika, 55, 107–122. Newsom, J.T. (2002). A multilevel structural equation model for dyadic data. Structural Equation Modeling, 9, 431-447. Newsom, J.T. (2015). Longitudinal Structural Equation Modeling: A Comprehensive Introduction. New York: Routledge. Rovine, M. J., & Molenaar, P. C. M. (2003). Estimating analysis of variance models as structural equation models. In B. Pugesek, A. Tomer, & A. von Eye (Eds.), Structural equation modeling: Applications in ecological and evolutionary biology research (pp. 235–280). New York: Cambridge. Rovine, M. J., & Liu, S. (2012). Structural equation modeling approaches to longitudinal data. In J.T. Newsom, R. N. Jones, & S. M. Hofer (Eds.). Longitudinal data analysis: A practical guide for researchers in aging, health, and social science (pp. 243–270). New York: Routledge. .Voelkle, M. C. (2007). Latent growth curve modeling as an integrative approach to the analysis of change. Psychology Science, 49, 375. Thank you [email protected] Computer code for Mplus and lavaan (R package) available from the author or download from www.longitudinalSEM.com (coming soon)
© Copyright 2026 Paperzz