Published on :
Statistical INTERNAL_CREATION

Example 8 of documentation for PROC CALIS

This code is also available in: Deutsch Español Français
Awaiting validation
This script creates an internal 'measures' dataset and performs a series of analyses to demonstrate the specification of measurement error models. It compares a simple path analysis (equivalent to OLS regression), a regression via PROC REG, and several structural models with PROC CALIS incorporating known error variances on exogenous and endogenous variables.
Data Analysis

Type : INTERNAL_CREATION


Data is generated directly in the script via the DATA step 'measures' using datalines.

1 Code Block
DATA STEP Data
Explanation :
Creation of the 'measures' dataset containing variables x and y via continuous reading (Reading multi-column and multi-line data).
Copied!
1DATA measures;
2 INPUT x y @code_sas_json/8_SAS_Intro_ReadFile_MultiCol_@@.json;
3 DATALINES;
4 7.91736 13.8673 6.10807 11.7966 6.94139 12.2174
5 7.61290 12.9761 6.77190 11.6356 6.33328 11.7732
6 7.60608 12.8040 6.65642 12.8866 6.26643 11.9382
7 ...
8;
2 Code Block
PROC CALIS
Explanation :
Simple path analysis estimating the linear relationship between x and y without assuming measurement error.
Copied!
1PROC CALIS DATA=measures;
2 path
3 x ===> y;
4RUN;
3 Code Block
PROC REG
Explanation :
Standard linear regression (OLS) used as a comparison point for PROC CALIS results.
Copied!
1PROC REG DATA=measures;
2 model y = x;
3RUN;
4 Code Block
PROC CALIS
Explanation :
Path analysis including mean structure (the 'meanstr' option), allowing estimation of intercepts and variable means.
Copied!
1PROC CALIS DATA=measures meanstr;
2 path
3 x ===> y;
4 pvar
5 x y;
6RUN;
5 Code Block
PROC CALIS
Explanation :
Model with measurement error on the independent variable x. 'x' is defined as a manifestation of the latent variable 'Fx' with an error variance fixed at 0.019.
Copied!
1PROC CALIS DATA=measures;
2 path
3 x <=== Fx = 1.,
4 Fx ===> y;
5 pvar
6 x = 0.019,
7 Fx, y;
8RUN;
6 Code Block
PROC CALIS
Explanation :
Complete measurement error model on both variables. x and y are indicators of the latent variables Fx and Fy, with error variances fixed at 0.019 and 0.022 respectively.
Copied!
1PROC CALIS DATA=measures;
2 path
3 x <=== Fx = 1.,
4 Fx ===> Fy ,
5 Fy ===> y = 1.;
6 pvar
7 x = 0.019,
8 y = 0.022,
9 Fx Fy;
10RUN;
7 Code Block
PROC CALIS
Explanation :
Structural model with error variances forced to zero. This theoretical model should produce results identical to standard OLS regression.
Copied!
1PROC CALIS DATA=measures;
2 path
3 x <=== Fx = 1.,
4 Fx ===> Fy ,
5 Fy ===> y = 1.;
6 pvar
7 x = 0.,
8 y = 0.,
9 Fx Fy;
10RUN;
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 : SAS SAMPLE LIBRARY