!!LEUVEN 2008 !!TESTING MEASUREMENT INVARIANCE!! !!Phenotypic Common Factor Model!! #define nvar=4 #ngroups 4 G1: Males: Reference group Data NInput_vars= 5 REctangular file=FACTOR2G1.dat LABELS V1 V2 V3 V4 sex Select if sex = 1 ; ! select males Select V1 V2 V3 V4 ; ! Select variables of interest Begin Matrices; L full nvar 1 free ! Matrix of factor loadings T diag nvar nvar free ! Matrix of residuals P full 1 1 fix ! Variance of latent factor M full 1 nvar free ! Matrix of intercepts End matrices; Value 1 P 1 1 ! Fix scale of the latent factor st .5 all st 0 M 1 1 - M 1 nvar Means M; Covariance L*P*L'+T; End G2: Females: Comparison group Data NInput_vars= 5 REctangular file=FACTOR2G1.dat LABELS V1 V2 V3 V4 sex Select if sex = 2 ; ! select males Select V1 V2 V3 V4 ; ! Select variables of interest Begin Matrices; L full nvar 1 free ! Matrix of factor loadings T diag nvar nvar free ! Matrix of residuals P full 1 1 fix ! Variance of latent factor M full 1 nvar free ! Matrix of intercepts D full 1 1 fix ! Mean difference latent factor End matrices; Value 1 P 1 1 ! Fix scale of the latent factor st .5 all st 0 M 1 1 - M 1 nvar Means M+(L*D)'; Covariance L*P*L'+T; End G3: Compute proportion of common variance males calculation Matrices = Group 1 Begin Algebra; V = L*P*L'+T; ! Variance covariance (cv) F = (L*P*L')%V; ! Standardized factor loadings E = T % V; ! Standardized residuals End Algebra; End G4: Compute proportion of common variance for females calculation Matrices = Group 2 Begin Algebra; V = L*P*L'+T; ! Variance covariance F = (L*P*L')%V; ! Standardized factor loadings E = T % V; ! Standardized residuals End Algebra; Option multiple issat End save phencomfact.mxs !M2. METRIC INVARIANCE: Constrain factor loadings accross males and females eq L 1 1 1 L 2 1 1 eq L 1 2 1 L 2 2 1 eq L 1 3 1 L 2 3 1 eq L 1 4 1 L 2 4 1 end ! If metric Invariance does not hold, stop here. (you can also use a scalar to allow for different variance ! in the latent factor but mantaining the same factor loadings) !M3. STRONG FACTORIAL INVARIANCE: Constrain the intercepts to be equal for males and females eq m 1 1 1 m 2 1 1 eq m 1 1 2 m 2 1 2 eq m 1 1 3 m 2 1 3 eq m 1 1 4 m 2 1 4 end !All difference due to the latent factor free D 2 1 1 st D -0.5 end ! If strong factorial invariance doesn't hold, stop here !M4. STRICT FACTORIAL INVARIANCE: Constrain residuals accross males and females eq T 1 1 1 T 2 1 1 eq T 1 2 2 T 2 2 2 eq T 1 3 3 T 2 3 3 eq T 1 4 4 T 2 4 4 end */