Published on :
Statistical CREATION_INTERNE

Example 25 for PROC CALIS - Latent Growth Curve Model

This code is also available in: Deutsch Español Français
Awaiting validation
The script starts by creating a 'growth' dataset via a DATA step with embedded data (datalines), representing repeated measures (y1 to y5). Then, it executes two distinct analyses with PROC CALIS. The first analysis fits a latent growth curve model with an equality constraint on error variances. The second analysis fits a similar model but without this constraint, allowing for the estimation of different error variances for each measurement time. The objective is to model growth using a latent intercept (f_alpha) and slope (f_beta).
Data Analysis

Type : CREATION_INTERNE


Data is generated and contained within the script itself using a DATA step and the 'datalines' statement, creating the 'growth' table.

1 Code Block
DATA STEP Data
Explanation :
This DATA STEP block creates the 'growth' table by reading 5 variables (y1 to y5) from data embedded directly in the code via the 'datalines' statement.
Copied!
1DATA growth;
2 INPUT y1 y2 y3 y4 y5;
3 DATALINES;
417.6 21.4 25.6 32.1 37.7
513.2 14.3 18.9 20.3 25.4
611.6 13.5 17.4 22.1 39.6
710.7 11.1 13.2 18.2 21.4
818.7 23.7 28.6 31.5 34.0
918.3 19.2 20.5 23.2 25.9
10 9.2 13.5 17.8 19.2 21.1
1118.3 23.5 27.9 30.2 34.6
1211.2 15.6 20.8 22.7 30.4
1317.0 22.9 26.9 31.9 35.6
1410.4 13.6 18.0 25.6 29.3
1517.7 19.0 22.5 28.5 30.7
1614.5 19.4 21.1 28.8 31.5
1720.0 21.4 28.9 30.2 35.6
1814.6 19.3 21.7 28.5 32.0
1911.7 15.2 19.1 23.7 28.7
20;
21 
2 Code Block
PROC CALIS
Explanation :
This block uses PROC CALIS to fit a latent growth curve model by maximum likelihood (method=ml). It defines linear equations (LINEQS) for observed variables as a function of a latent intercept (f_alpha) and slope (f_beta). A constraint is imposed so that the variances of the five error terms (e1-e5) are equal (5 * evar).
Copied!
1PROC CALIS method=ml DATA=growth nostand noparmname;
2 lineqs
3 y1 = 0. * Intercept + f_alpha + e1,
4 y2 = 0. * Intercept + f_alpha + 1 * f_beta + e2,
5 y3 = 0. * Intercept + f_alpha + 2 * f_beta + e3,
6 y4 = 0. * Intercept + f_alpha + 3 * f_beta + e4,
7 y5 = 0. * Intercept + f_alpha + 4 * f_beta + e5;
8 variance
9 f_alpha f_beta,
10 e1-e5 = 5 * evar;
11 mean
12 f_alpha f_beta;
13 cov
14 f_alpha f_beta;
15 fitindex on(only)=[chisq df probchi];
16RUN;
3 Code Block
PROC CALIS
Explanation :
This second PROC CALIS block fits a model similar to the previous one, but removes the constraint on error variances. The 'variance e1-e5;' statement allows for the estimation of a distinct variance for each error term, offering greater model flexibility.
Copied!
1PROC CALIS method=ml DATA=growth nostand noparmname;
2 lineqs
3 y1 = 0. * Intercept + f_alpha + e1,
4 y2 = 0. * Intercept + f_alpha + 1 * f_beta + e2,
5 y3 = 0. * Intercept + f_alpha + 2 * f_beta + e3,
6 y4 = 0. * Intercept + f_alpha + 3 * f_beta + e4,
7 y5 = 0. * Intercept + f_alpha + 4 * f_beta + e5;
8 variance
9 f_alpha f_beta,
10 e1-e5;
11 mean
12 f_alpha f_beta;
13 cov
14 f_alpha f_beta;
15 fitindex on(only)=[chisq df probchi];
16RUN;
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