1 LISREL Syntax Structure for a Confirmatory Factor Analysis. This model .... PS (
Psi) matrix Ψ: variances/covariances of the residual variables ζ in the struc-.
Introduction to Structural Equation Modeling with LISREL – Version May 2009 Dipl.-Psych. Christina Werner and Prof. Dr. Karin Schermelleh-Engel – Goethe University, Frankfurt
LISREL Syntax: Structure and Basic Commands
1
LISREL Syntax Structure for a Confirmatory Factor Analysis
This model correspondes to the path diagram on “Variables and Parameters in LISREL”, page 1. The section numbering refers to explanations given on the following pages. (The missing numbers refer to sections not necessary for this confirmatory factor analysis. They will appear in complete structural equation models later.)
!
Example syntax for a confirmatory factor analysis with LISREL
1.
DA NI=4 NO=200 MA=CM
2.
CM SY
3.
1.024 .792 1.077 1.027 .919 1.844 .756 .697 1.244 1.286
4.
LA x1 x2 x3 x4
5.
MO NX=4 NK=2 LX=FU,FI PH=SY,FR TD=DI,FR
6.
LK ksi1 ksi2
7.
FR LX(2,1) LX(4,2)
9.
Title
Description of data
VA 1 LX(1,1) LX(3,2)
11.
PATH DIAGRAM OU ME=ML ND=3 SC RS MI
13. 14.
1
Description of model
Description of output
Introduction to Structural Equation Modeling with LISREL – Version May 2009 Dipl.-Psych. Christina Werner and Prof. Dr. Karin Schermelleh-Engel – Goethe University, Frankfurt
2
LISREL Syntax Structure for a Complete Structural Equation Model
This model corresponds to the path diagram in “Variables and Parameters in LISREL”, page 3. The section numbering refers to explanations given on the following pages.
!
LISREL syntax example for a complete structural equation model
1.
DA NI=9 NO=200 MA=CM
2.
CM SY
3.
1.024 .792 1.077 1.027 .919 1.844 .756 .697 1.244 1.286 .567 .537 .876 .632 .445 .424 .677 .526 .434 .389 .635 .498 .580 .564 .893 .716 .491 .499 .888 .646
4.
Title
Description of data .852 .518 .475 .546 .508
.670 .545 .422 .389
.716 .373 .339
.851 .629
.871
LA x1 x2 x3 x4 x5 y1 y2 y3 y4 SE y1 y2 y3 y4 x1 x2 x3 x4 /
5.
MO NX=4 NK=2 NY=4 NE=2 LX=FU,FI LY=FU,FI BE=FU,FI GA=FU,FR C PH=SY,FR PS=DI,FR TD=DI,FR TE=DI,FR
6.
LK ksi1 ksi2
7.
LE eta1 eta2
8.
FR LX(2,1) LX(4,2) FR LY(2,1) LY(4,2) FR BE(2,1)
9.
FI GA(2,1)
10.
VA 1 LX(1,1) LX(3,2) LY(1,1) LY(3,2)
11.
EQ TD(3,3) TD(4,4)
12.
PATH DIAGRAM OU ME=ML ND=3 SC RS XM
12. 13.
2
Description of model
Description of output
Introduction to Structural Equation Modeling with LISREL – Version May 2009 Dipl.-Psych. Christina Werner and Prof. Dr. Karin Schermelleh-Engel – Goethe University, Frankfurt
3
Explanation of Syntax Sections
It is advisable to adhere to the sequence of commands below. Changing the sequence may not always be possible for logical reasons. 1. Title The first line of a LISREL syntax file may be used for an optional title, which then will appear on every page of output. To be on the safe side, this line may be started with an exclamation mark (indicating a comment; see below at “comments”). 2. Data definition • DA (Data) starts this line. Thereafter follows: • NI (Number of input variables) – number of manifest variables • NO (Number of objects) – sample size • MA (Matrix to be analyzed) – this usually is ◦ MA=CM (Covariance matrix) for a covariance matrix or ◦ MA=KM (Correlation matrix) for a correlation matrix Note: The matrix to be analyzed does not have to be identical with the input data matrix (see number 3, definition of data matrix). If desired, LISREL can internally compute and analyze a correlation matrix even if the input data matrix contains covariances. It can also compute and analyze covariances when a correlation matrix is given as input (and additionally, the standard deviations of the indicator variables). 3. Definition of data matrix There are three possibilities: • CM for a covariance matrix or • KM for a correlation matrix or • RA for raw data Usually, LISREL expects covariance/correlation matrices or raw data in “free” format, i. e. values are separated by spaces or commas. For decimal values, a dot has to be used as decimal separator (not the German comma). Covariances, correlations or raw data may be listed within the syntax file itself, or in a separate file. A separate file can be read in using the command FI=file_name, e. g.: RA FI=example.dat. Covariance and correlation matrices are symmetric by definition. Therefore, they may be entered as complete rectangular matrices, or as triangular matrices: • SY (symmetric) for a lower triangular matrix, i. e. all entries on the diagonal and below the diagonal, or • FU (full) for a complete rectangular covariance/correlation matrix
3
Introduction to Structural Equation Modeling with LISREL – Version May 2009 Dipl.-Psych. Christina Werner and Prof. Dr. Karin Schermelleh-Engel – Goethe University, Frankfurt
4. Data matrix If covariances/correlations or raw data are listed within the syntax file itself, they should appear next. By default, LISREL assumes the y-variables first, followed by the x-variables. 5. Labels for manifest variables For clarity of output, manifest variables should be given appropriate labels. Labels may use up to 8 letters or digits (longer labels will be truncated). Blank spaces are possible, but labels containing spaces must be enclosed in quotes ’ ’ like this: ’TEST A’ It may be easier to use underscores instead: TEST_A The LA command has to appear on an otherwise blank line. The labels themselves follow on the next line. Labels must appear in the same sequence as the variables they are referring to are listed in the covariance/correlation matrix or raw data. Note: Selecting variables and changing their order If not all variables that are part of the data matrix should be included in the model, or if y- and x-variables are not listed in the required sequence (y-variables first), they can be selected and reordered. After the variables have been given labels, use the SE (select) command to reorder them. The command SE appears on an otherwise blank line. The following line then contains the labels of the variables of interest in the desired order. If not all variables are included, the line must be terminated with a forward slash /, e. g.: LA x1 x2 x3 x4 x5 y1 y2 y3 y4 SE y1 y2 y3 y4 x1 x2 x3 x4 / 6. Model specification • MO (model) starts the model specification line. • Next, the numbers of latent and manifest variables are given: ◦ NX (number of x indicator variables) ◦ NY (number of y indicator variables) ◦ NK (number of ksi-variables, i. e. latent exogenous variables ξ) ◦ NE (number of eta-variables, i. e. latent endogenous variables η)
4
Introduction to Structural Equation Modeling with LISREL – Version May 2009 Dipl.-Psych. Christina Werner and Prof. Dr. Karin Schermelleh-Engel – Goethe University, Frankfurt
• The different variables included in the model determine which parameter matrices have to be specified: ◦ LX (Lambda-x) matrix Λx : path coefficients between latent ξ-variables and manifest x-variables ◦ LY (Lambda-y) matrix Λy : path coefficients between latent η-variables and manifest y-variables ◦ GA (Gamma) matrix Γ: path coefficients between ξ-variables and η-variables in the structural model ◦ BE (Beta) matrix B: path coefficients between different η-variables in the structural model ◦ PH (Phi) matrix Φ: variances/covariances of the ξ-variables ◦ PS (Psi) matrix Ψ: variances/covariances of the residual variables ζ in the structural model ◦ TD (Theta-delta) matrix Θδ : variances/covariances of the measurement error variables δ ◦ TE (Theta-epsilon) matrix Θ : variances/covariances of the measurement error variables • Most often, these matrices will be specified in one of the following ways: ◦ FU,FI (full, fixed) All parameters in the respective matrix are fixed to zero (possible starting point, particularly for LX, LY, GA, BE; parameters needed in the model can be set free individually later on, see number 9). ◦ FU,FR (full, free) All parameters in the respective matrix are to be estimated (alternative starting point, particularly for LX, LY, GA; parameters not needed in the model can be fixed to zero individually later on, see number 10). ◦ SY,FR (symmetric, free) The matrix is symmetric, all parameters are to be estimated under this condition (usual starting point for PH in case of correlated ξ-variables). ◦ DI,FR (diagonal, free) Only the matrix’ diagonal parameters are to be estimated, all off-diagonal parameters are fixed to zero (usual starting point for the error/residual covariance matrices TD, TE, PS and for PH in case of uncorrelated ξ-variables). Variables and parameter matrices that are not part of the model can be omitted. 7. Labels for ksi-variables The latent exogenous variables can be given labels to clarify their meanings. The LK command is given on an otherwise blank line. The labels themselves follow on the next line. The meaning of a ξ-variable is determined by the manifest indicator variables that are assigned to it in the factor loading matrix Λx . The order of the labels has to match these assignments.
5
Introduction to Structural Equation Modeling with LISREL – Version May 2009 Dipl.-Psych. Christina Werner and Prof. Dr. Karin Schermelleh-Engel – Goethe University, Frankfurt
8. Labels for eta-variables The latent endogenous variables can be given labels to clarify their meanings. The LE command is given on an otherwise blank line. The labels themselves follow on the next line. The meaning of an η-variable is determined by the manifest indicator variables that are assigned to it in the factor loading matrix Λy . The order of the labels has to match these assignments. 9. Freeing certain parameters If an entire parameter matrix has been specified as fixed to zero (on the MO line), certain parameters in this matrix may subsequently be freed (to be estimated) using an additional FR command followed by a list of the respective parameters. 10. Fixing certain parameters to zero If an entire parameter matrix is specified as free (on the MO line), certain parameters in this matrix may subsequently be fixed to zero (excluded from the estimation) using an additional FI command followed by a list of the respective parameters. 11. Assigning specific values Parameters that have been fixed to zero (either within a matrix that has been specified as fixed, or by a separate command) can subsequently be assigned specific values (different from zero) using the VA command. Usually, this will be VA 1 to assign a value of one, but other values are possible as well. The following example assigns a value of one to the (previously fixed) parameter LX(3,2) = λx32 : VA 1 LX(3,2) This is mostly used to assign scales for latent variables. For this purpose, one factor loading for each latent variable can be fixed to 1 in LX and/or LY, respectively (this equates the latent variable’s variance with the true variance of the respective indicator variable). Alternatively, the variance of a latent variable can be fixed to 1 directly (e. g., to standardize ξ-variables) 12. Equality constraints for certain parameters If certain parameters are assumed to be equal, this can be postulated by equality constraints EQ. The line EQ TE(3,3) TE(4,4) and θ to be equal. Such assumptions may requires the estimates for the error variances θ33 44
be founded on theory (in the case of parallel tests, e. g., factor loadings and error variances may be assumed to be equal), but may also serve as makeshift “solutions” when encountering certain estimation/identification problems (setting parameters equal decreases the number of individually estimated parameters and therefore increases the model’s degrees of freedom). 13. Path diagram If the command PATH DIAGRAM (or simply PD) is given, LISREL generates a graphical representation of the analyzed structural equation model. A pull-down menu in the path diagram viewer allows to switch between the display of unstandardized or standardized parameter estimates, standard errors, t-values, etc. 6
Introduction to Structural Equation Modeling with LISREL – Version May 2009 Dipl.-Psych. Christina Werner and Prof. Dr. Karin Schermelleh-Engel – Goethe University, Frankfurt
14. Output specification • OU (Output) starts this line. Thereafter follows: • ME (Method of estimation) specifies the method to be used for parameter estimation. This frequently will be ◦ ME=ML (Maximum Likelihood estimation) • ND (Number of decimals) for text output • SC (Completely standardized solution) – standardized values for all estimated parameters (both latent and manifest variables are standardized) • RS (Residuals) – diagnostic statistics for residuals (including standardized residuals and Q-plot) • MI (Modification indices) – these may be used as hints for exploratory model modification
General notes • Comments Syntax files may contain user comments. This is especially useful and advisable for complex models, model modifications, and multi-sample analysis. LISREL treats everything following an exclamation mark ! as a comment. A line starting with an exclamation mark will be completely ignored by LISREL: !
Add your comments here...
However, commands may also be followed by an exclamation mark and further comments on the same line. For model modification or testing purposes, this allows to easily “comment out” certain commands and disable them without having to delete and retype them. In the following example, the parameters GA(1,1) = γ11 and BE(2,1) = β21 will be estimated (“free”), but not GA(2,1) = γ21 : FR GA(1,1) BE(2,1) !
GA(2,1)
• Blank lines LISREL ignores blank lines, so they can be used to structure syntax files. • Line length LISREL reads lines up to 127 characters. Overly long lines should be terminated with a blank space followed by the letter C (continue). They can then be continued on the next line. This may often be necessary for the model specification line, e. g.: MO NX=5 NY=4 NK=2 NE=2 LX=FU,FI LY=FU,FI GA=FU,FI BE=FU,FI PH=SY,FR C PS=DI,FR TD=DI,FR TE=DI,FR This notation does not work for all commands, e. g. it is not possible to use it for labels. • Uppercase/lowercase LISREL is case insensitive. Depending on the font, uppercase letters may be preferable to avoid confusing letters with numbers.
7