Published on :
Statistical INTERNAL_CREATION

Example of PROC CALIS for Covariance Estimation

This code is also available in: Deutsch Español Français
Awaiting validation
The script begins by creating a 'sales' dataset containing quarterly variables (q1 to q4) with data directly integrated via 'datalines'. Then, PROC CALIS is called twice on this dataset. The first execution specifies the 'pcorr' option to display probability correlations, while the second uses the 'nose' option to suppress the display of convergence information, both applying the 'mstruct' substatement for covariance structure modeling.
Data Analysis

Type : INTERNAL_CREATION


The 'sales' dataset is created directly within the script using a DATA STEP block and the DATALINES statement, thereby integrating the necessary data for the procedure's execution.

1 Code Block
DATA STEP Data
Explanation :
This DATA STEP block creates a dataset named 'sales'. It defines four numeric variables (q1, q2, q3, q4) representing quarterly sales. The data is then read line by line from the DATALINES section, providing 14 observations for each variable.
Copied!
1DATA sales;
2 INPUT q1 q2 q3 q4;
3 DATALINES;
41.03 1.54 1.11 2.22
51.23 1.43 1.65 2.12
63.24 2.21 2.31 5.15
71.23 2.35 2.21 7.17
8 .98 2.13 1.76 2.38
91.02 2.05 3.15 4.28
101.54 1.99 1.77 2.00
111.76 1.79 2.28 3.18
121.11 3.41 2.20 3.21
131.32 2.32 4.32 4.78
141.22 1.81 1.51 3.15
151.11 2.15 2.45 6.17
161.01 2.12 1.96 2.08
171.34 1.74 2.16 3.28
18;
2 Code Block
PROC CALIS
Explanation :
This execution of PROC CALIS analyzes the 'sales' data. The 'pcorr' option requests the display of probability correlations between the variables. The 'mstruct var=q1-q4;' substatement specifies that the analysis focuses on variables q1 to q4 and should estimate a model structure, typically for covariance or correlation model analysis.
Copied!
1 
2PROC CALIS
3DATA=sales pcorr;
4mstruct var=q1-q4;
5RUN;
6 
3 Code Block
PROC CALIS
Explanation :
The second execution of PROC CALIS also uses the 'sales' dataset and the 'mstruct var=q1-q4;' substatement. The 'nose' option is used to suppress the output of convergence information from the estimation algorithm, which can be useful for simplifying the output when these details are not required.
Copied!
1 
2PROC CALIS
3DATA=sales nose;
4mstruct var=q1-q4;
5RUN;
6 
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.
Copyright Info : S A S S A M P L E L I B R A R Y