The script begins by creating a 'scores' dataset containing six variables. Then, it performs three distinct analyses with PROC CALIS on this data. Each analysis tests a different measurement model for two latent factors ('verbal' and 'math'), imposing various constraints on factor loadings and error variances. This demonstrates the flexibility of the procedure for specifying structural equation models, ranging from a simple model with strong constraints to more complex models with freely estimated parameters.
Data Analysis
Type : CREATION_INTERNE
The 'scores' dataset is created directly in the script via a DATA step and the 'datalines' statement. There are no dependencies on external data.
1 Code Block
DATA STEP Data
Explanation : This block creates the 'scores' table in memory (WORK library). Data is directly embedded in the code using the 'datalines' statement, which is common for examples or small datasets.
Explanation : This procedure performs a factor analysis on the 'scores' table. The 'FACTOR' statement defines a two-factor model ('verbal' and 'math'). The 'PVAR' statement imposes equality constraints: the three variables of the 'verbal' factor have the same error variance ('evar1'), and similarly for the 'math' factor ('evar2'). Factor variances are fixed to 1 for model identification.
Explanation : This second factor analysis is a variant of the first. The 'PVAR' statement is simplified to only fix the variance of the latent factors to 1. The error variances of the observed variables (x1-x3, y1-y3) are now freely estimated by the procedure, without equality constraints.
Explanation : This third analysis specifies a more complex model. In the 'FACTOR' statement, some factor loadings are freely estimated ('alpha', 'beta') while others are constrained. Similarly, in 'PVAR', some error variances are freely estimated ('phi', 'theta') and others are constrained to be equal. This shows how to specify models with partial constraints.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.