Data is created directly in the script via a DATA step with a 'datalines' statement. The 'Wheaton' dataset is a covariance matrix (TYPE=COV).
1 Code Block
DATA STEP Data
Explanation : This DATA STEP block creates the 'Wheaton' dataset which is a covariance matrix (TYPE=COV). Data is read in free format from embedded data lines (datalines). Labels are associated with variables for better readability.
Education='Education' SEI='Occupational Status Index';
8
DATALINES;
9
Anomie67 11.834 . . . . .
10
Powerless67 6.9479.364 . . . .
11
Anomie71 6.8195.09112.532 . . .
12
Powerless71 4.7835.0287.4959.986 . .
13
Education -3.839 -3.889 -3.841 -3.6259.610 .
14
SEI -21.899 -18.831 -21.748 -18.77535.522450.288
15
;
16
RUN;
2 Code Block
PROC CALIS
Explanation : First execution of PROC CALIS for covariance structure analysis. The MSTRUCT statement is used to specify model variables. The MATRIX statement explicitly defines the parameters of the _COV_ covariance matrix. Fit indices (Chi-square, degrees of freedom, p-value) are requested and saved in the 'savefit' dataset.
Explanation : This simple procedure prints the content of the 'savefit' dataset, which was created by the previous PROC CALIS block and contains the model's fit indices.
Copied!
proc print data=savefit;
run;
1
PROC PRINTDATA=savefit;
2
RUN;
4 Code Block
PROC CALIS
Explanation : Second execution of PROC CALIS which illustrates a more concise specification method for the covariance matrix. Instead of defining each element one by one, this syntax fills the lower triangular matrix row by row. The fitted model is identical to the previous one.
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.