In PROC TCALIS, you can use many different modeling languages to specify the same model. The choice of modeling language depends on personal preferences and the purposes of the analysis. See the section Which Modeling Language? for guidance. In this example, the data and the model in Example 88.1 are used to illustrate how a particular model can be specified by various general modeling languages.
RAM Model Specification
In Example 88.1, the PATH modeling language was used. The PATH modeling language is closely related to the RAM modeling language. The following RAM model specification shows similar syntax to that of the PATH model specification.
proc tcalis nobs=932 data=Wheaton;
ram
path Anomie67 <- Alien67 1.0,
path Powerless67 <- Alien67 0.833,
path Anomie71 <- Alien71 1.0,
path Powerless71 <- Alien71 0.833,
path Education <- SES 1.0,
path SEI <- SES lambda,
path Alien67 <- SES gamma1,
path Alien71 <- SES gamma2,
path Alien71 <- Alien67 beta,
pvar Anomie67 theta1,
pvar Powerless67 theta2,
pvar Anomie71 theta1,
pvar Powerless71 theta2,
pvar Education theta3,
pvar SEI theta4,
pvar Alien67 psi1,
pvar Alien71 psi2,
pvar SES phi,
pcov Anomie67 Anomie71 theta5,
pcov Powerless67 Powerless71 theta5;
run;
In the RAM model, a list of parameter locations are specified in the RAM statement. In each entry of the list, the parameter type, the variables involved, and the parameter are specified in order. These entries are separated by commas.
The parameter type is listed first in each list entry. In this example, three parameter types are specified: PATH, PVAR, and PCOV. These types correspond to the PATH, PVAR, and PCOV statements in the PATH model specification. There are other parameter types you can use for the RAM model specification, but they are not shown in this example. See the RAM statement for more details.
The variables involved are specified after the parameter type in each list entry. Depending on the parameter type, the number of variables required is either one or two. For entries with the PATH parameter type, two variables must be specified—one for the outcome and one for the predictor. In this example, the two variables involved in the PATH entries are separated by arrows "<–" that indicate the prediction directions. When the arrows are not specified, the first variable is assumed to be the outcome variable, and the second one is the predictor variable. For the PVAR entries, which stand for partial variance, only one variable is required after the parameter type specification. For the PCOV entries, which stand for partial covariance, two variables are required. The order of these two variables in the PCOV entries is not important, however.
The last specification in each list entry is the parameter. The parameter can either be a fixed value (a numerical value alone), a free parameter without an initial value (a name alone), or a free parameter with an initial value (a name followed by a parenthesized numerical value). In this example, you specify five fixed values for the path coefficients (or effects) in the first five entries. In the next four paths and all other PVAR and PCOV entries, you specify free parameters without initial values.
When comparing with the PATH model specification, the RAM specification is quite similar. Certainly, the model fit would be the same because both specifications are mathematically equivalent. Unlike the PATH model that uses different tables for displaying different types of estimates, all estimates of the RAM model are displayed in a single table as shown in Output 88.6.1.
Output 88.6.1
RAM Model Estimates
|
1.00000 |
|
|
|
0.83300 |
|
|
|
1.00000 |
|
|
|
0.83300 |
|
|
|
1.00000 |
|
|
lambda |
5.36883 |
0.43371 |
12.37880 |
gamma1 |
-0.62994 |
0.05634 |
-11.18092 |
gamma2 |
-0.24086 |
0.05489 |
-4.38836 |
beta |
0.59312 |
0.04678 |
12.67884 |
theta1 |
3.60796 |
0.20092 |
17.95717 |
theta2 |
3.59488 |
0.16448 |
21.85563 |
theta1 |
3.60796 |
0.20092 |
17.95717 |
theta2 |
3.59488 |
0.16448 |
21.85563 |
theta3 |
2.99366 |
0.49861 |
6.00398 |
theta4 |
259.57639 |
18.31151 |
14.17559 |
psi1 |
5.67046 |
0.42301 |
13.40500 |
psi2 |
4.51479 |
0.33532 |
13.46394 |
phi |
6.61634 |
0.63914 |
10.35190 |
theta5 |
0.90580 |
0.12167 |
7.44472 |
theta5 |
0.90580 |
0.12167 |
7.44472 |
These RAM model estimates match the set of estimates using the PATH model specification.
LINEQS Model Specification
Another way to specify the model in Example 88.1 is to use the LINEQS modeling language, which is shown in the following:
proc tcalis nobs=932 data=Wheaton;
lineqs
Anomie67 = 1.0 f_Alien67 + E1,
Powerless67 = 0.833 f_Alien67 + E2,
Anomie71 = 1.0 f_Alien71 + E3,
Powerless71 = 0.833 f_Alien71 + E4,
Education = 1.0 f_SES + E5,
SEI = lambda f_SES + E6,
f_Alien67 = gamma1 f_SES + D1,
f_Alien71 = gamma2 f_SES + beta f_Alien67 + D2;
std
E1 = theta1,
E2 = theta2,
E3 = theta1,
E4 = theta2,
E5 = theta3,
E6 = theta4,
D1 = psi1,
D2 = psi2,
f_SES = phi;
cov
E1 E3 = theta5,
E2 E4 = theta5;
run;
In the LINEQS model, all paths in the PATH model are now specified in equations. In each equation, you list an outcome variable on the left-hand-side of the equation and all its predictors (including the error or disturbance variable) on the right-hand-side of the equation. Because each outcome variable can only be specified in exactly one equation, the number of equations in the LINEQS model and the number of paths in the corresponding PATH model do not match necessarily. In this example, there are eight equations in the LINEQS statement, but there would be nine paths specified in the corresponding PATH model.
In addition, in the LINEQS model, you need to follow a convention of naming latent variables. Names for latent variables that are neither errors nor disturbances must start with either 'F' or 'f.' Names for errors must start with either 'E' or 'e,' while names for disturbances must start with either 'D' or 'd.' Recall that in the PATH model specification, no such convention is imposed. For example, f_Alien67, f_Alien71, and f_SES are latent factors in the LINEQS model. They are not error terms, and so they must start with the 'f' prefix. However, this prefix is not needed in the PATH model. Furthermore, there are no explicit error terms that need to be specified in the PATH model, let alone specific prefixes for the error terms.
The PVAR statement in the PATH model is now replaced with the STD statement in the LINEQS model, and the PCOV statement with the COV statement. Recall that the PVAR and PCOV statements in the PATH model are for the partial variance and partial covariance specifications. The partial variance or covariance concepts are used in the PATH or RAM model specification because error terms are not named explicitly. But for the LINEQS model, errors or disturbances are named explicitly as exogenous variables so that the partial variance or covariance concepts are no longer necessary. In this example, the variances of the errors ("E"-variables) and disturbances ("D"-variables) specified in the STD statement of the LINEQS model correspond to the partial variances of the endogenous variables specified in the PVAR statement of the PATH model. Similarly, covariances of errors specified in the COV statement of the LINEQS model correspond to the partial covariances of endogenous variables specified in the PCOV statement of the PATH model. The estimation results of the LINEQS model are shown in Output 88.6.2. Again, they are essentially the same estimates obtained from the PATH model specified in Example 88.1.
Output 88.6.2
LINEQS Model Estimates
Anomie67 |
= |
|
1.0000 |
|
f_Alien67 |
+ |
1.0000 |
|
E1 |
|
|
|
|
Powerless67 |
= |
|
0.8330 |
|
f_Alien67 |
+ |
1.0000 |
|
E2 |
|
|
|
|
Anomie71 |
= |
|
1.0000 |
|
f_Alien71 |
+ |
1.0000 |
|
E3 |
|
|
|
|
Powerless71 |
= |
|
0.8330 |
|
f_Alien71 |
+ |
1.0000 |
|
E4 |
|
|
|
|
Education |
= |
|
1.0000 |
|
f_SES |
+ |
1.0000 |
|
E5 |
|
|
|
|
SEI |
= |
|
5.3688 |
* |
f_SES |
+ |
1.0000 |
|
E6 |
|
|
|
|
Std Err |
|
|
0.4337 |
|
lambda |
|
|
|
|
|
|
|
|
t Value |
|
|
12.3788 |
|
|
|
|
|
|
|
|
|
|
f_Alien67 |
= |
|
-0.6299 |
* |
f_SES |
+ |
1.0000 |
|
D1 |
|
|
|
|
Std Err |
|
|
0.0563 |
|
gamma1 |
|
|
|
|
|
|
|
|
t Value |
|
|
-11.1809 |
|
|
|
|
|
|
|
|
|
|
f_Alien71 |
= |
|
-0.2409 |
* |
f_SES |
+ |
0.5931 |
* |
f_Alien67 |
+ |
1.0000 |
|
D2 |
Std Err |
|
|
0.0549 |
|
gamma2 |
|
0.0468 |
|
beta |
|
|
|
|
t Value |
|
|
-4.3884 |
|
|
|
12.6788 |
|
|
|
|
|
|
theta1 |
3.60796 |
0.20092 |
17.95717 |
theta2 |
3.59488 |
0.16448 |
21.85563 |
theta1 |
3.60796 |
0.20092 |
17.95717 |
theta2 |
3.59488 |
0.16448 |
21.85563 |
theta3 |
2.99366 |
0.49861 |
6.00398 |
theta4 |
259.57639 |
18.31151 |
14.17559 |
psi1 |
5.67046 |
0.42301 |
13.40500 |
psi2 |
4.51479 |
0.33532 |
13.46394 |
phi |
6.61634 |
0.63914 |
10.35190 |
theta5 |
0.90580 |
0.12167 |
7.44472 |
theta5 |
0.90580 |
0.12167 |
7.44472 |
LISMOD Specification
You can also specify general structural models by using the LISMOD modeling language. See the section The LISMOD Model and Submodels for details.
Four types of variables must be recognized before you can specify a LISMOD model. The -variables (eta-variables) are latent factors that are endogenous, or predicted by other latent factors. The -variables (xi-variables) are exogenous latent variables that are not predicted by any other variables. The -variables are manifest variables that are indicators of the -variables, and the -variables are manifest variables that are indicators of the -variables. In this example, Alien67 and Alien71 are the -variables, and SES is the -variable in the model. Manifest indicators for Alien67 and Alien71 include Anomie67, Powerless67, Anomie71, and Powerless71, which are the -variables. Manifest indicators for SES include Education and SEI, which are the -variables.
After defining these four types of variables, the parameters of the model are defined as entries in the model matrices. The _LAMBDAY_, _LAMBDAX_, _GAMMA_, and _BETA_ are matrices for the path coefficients or effects. The _THETAY, _THETAX_, _PSI_, and _PHI_ are matrices for the variances and covariances.
The following is the LISMOD specification for the model in Example 88.1:
proc tcalis nobs=932 data=Wheaton;
lismod
yvar = Anomie67 Powerless67 Anomie71 Powerless71,
xvar = Education SEI,
etavar = Alien67 Alien71,
xivar = SES;
matrix _LAMBDAY_
[1,1] = 1,
[2,1] = 0.833,
[3,2] = 1,
[4,2] = 0.833;
matrix _LAMBDAX_
[1,1] = 1,
[2,1] = lambda;
matrix _GAMMA_
[1,1] = gamma1,
[2,1] = gamma2;
matrix _BETA_
[2,1] = beta;
matrix _THETAY_
[1,1] = theta1-theta2 theta1-theta2,
[3,1] = theta5,
[4,2] = theta5;
matrix _THETAX_
[1,1] = theta3-theta4;
matrix _PSI_
[1,1] = psi1-psi2;
matrix _PHI_
[1,1] = phi;
run;
In the LISMOD statement, you specify the four lists of variables in the model. The orders of the variables in these lists are not arbitrary. They are the orders applied to the row and column variables in the model matrices, of which the parameter locations are specified.
The estimated model is divided into three conceptual parts. The first part is the measurement model that relates the -variables with the -variables, as shown in Output 88.6.3:
Output 88.6.3
LISMOD Model Measurement Model for the Eta-Variables
3.6080 |
0.2009 |
17.9572 |
[theta1] |
|
|
0.9058 |
0.1217 |
7.4447 |
[theta5] |
|
|
|
3.5949 |
0.1645 |
21.8556 |
[theta2] |
|
|
0.9058 |
0.1217 |
7.4447 |
[theta5] |
|
0.9058 |
0.1217 |
7.4447 |
[theta5] |
|
|
3.6080 |
0.2009 |
17.9572 |
[theta1] |
|
|
|
0.9058 |
0.1217 |
7.4447 |
[theta5] |
|
|
3.5949 |
0.1645 |
21.8556 |
[theta2] |
|
The _LAMBDAY_ matrix contains the coefficients or effects of the -variables on the -variables. All these estimates are fixed constants as specified. The _THETAY_ matrix contains the error variances and covariances for the -variables. Three free parameters are located in this matrix: theta1, theta2, and theta5.
The second part of the estimated model is the measurement model that relates the -variable with the -variables, as shown in Output 88.6.4:
Output 88.6.4
LISMOD Model Measurement Model for the Xi-Variables
|
5.3688 |
0.4337 |
12.3788 |
[lambda] |
|
2.9937 |
0.4986 |
6.0040 |
[theta3] |
|
|
|
259.5764 |
18.3115 |
14.1756 |
[theta4] |
|
The _LAMBDAX_ matrix contains the coefficients or effects of the -variable SES on the -variables. The effect of SES on Education is fixed at one. The effect of SES on SEI is represented by the free parameter lambda, which is estimated at . The _THETAX_ matrix contains the error variances and covariances for the -variables. Two free parameters are located in this matrix: theta3 and theta4.
The last part of the estimated model is the structural model that relates the latent variables and , as shown in Output 88.6.5:
Output 88.6.5
LISMOD Structural Model for the Latent Variables
|
|
0.5931 |
0.0468 |
12.6788 |
[beta] |
|
|
-0.6299 |
0.0563 |
-11.1809 |
[gamma1] |
|
-0.2409 |
0.0549 |
-4.3884 |
[gamma2] |
|
5.6705 |
0.4230 |
13.4050 |
[psi1] |
|
|
|
4.5148 |
0.3353 |
13.4639 |
[psi2] |
|
6.6163 |
0.6391 |
10.3519 |
[phi] |
|
The _BETA_ matrix contains effects of -variables on themselves. In our example, there is only one such effect. The effect of Alien67 on Alien71 is represented by the free parameter beta. The _GAMMA_ matrix contains effects of the -variable, which is SES in this example, on the -variables Alien67 on Alien71. These effects are represented by free parameters gamma1 and gamma2. The _PSI_ matrix contains the error variances and covariances in the structural model. In this example, psi1 and psi2 are two free parameters for the error variances. Finally, the _PHI_ matrix is the covariance matrix for the -variables. In this example, there is only one -variable so that this matrix contains only the estimated variance of SES. This variance is represented by the parameter phi.
The estimates obtained from fitting the LISMOD model are the same as those from fitting the equivalent PATH, RAM, or LINEQS model. To some researchers the LISMOD modeling language might be more familiar, while for others modeling languages such as PATH, RAM, or LINEQS are more convenient to use.