LISREL and PRELIS: Usage Summary

LISREL 8 and PRELIS 2 are available on the UNIX systems. These are stand-alone products, not part of SPSS.

Important new features of the package include a simplified command language for LISREL, imputation of missing values in PRELIS (using the "hotdeck" method), bootstrap resampling, and Monte Carlo simulation.

Running LISREL and PRELIS

To run LISREL, type

lisrel8

You should get a small graphics screen which will ask you for the names of your command file and output file. It looks something like this: 

sample screen shot

After you type the name of your input file (command file), LISREL prompts you for the name of the output file. It also prompts you to correct errors.

The PRELIS command is prelis2, and the PRELIS screen looks essentially the same and operates in the same manner as LISREL.

If you don't want the prompt and the graphics screen, type:

lisrel8 command_file output_file -noquery

LISREL example:

Suppose you have the following commands in a file called model1.lis: (This example is available on the central UNIX systems and is stored in the file /opt/lib/lisrel/examples/ls8ex/ex1.ls8 .)

Hypothetical model estimated by ml 
da ni=11 no=100 
cm sy fi=ex1.cov 
mo ny=4 nx=7 ne=2 nk=3 be=fu ps=sy,fr 
fr ly 2 1 ly 4 2 lx 2 1 lx 3 1 lx 3 2 lx 5 2 lx 7 3 be 2 1 be 1 2 
fi ga 1 3 ga 2 2 
va 1 ly 1 1 ly 3 2 lx 1 1 lx 4 2 lx 6 3 
ou mi rs ef mr ss sc

This command file instructs LISREL to read the covariance matrix from the file ex1.cov. It is one of several LISREL example files in that directory. To run LISREL with these commands and have your output stored in model1.lst, type

lisrel8 model1.lis model1.lst -noquery

 

Any errors from a run using the -noquery flag are stored in a file called lisrel8.log. If there are no errors you should get a message indicating normal execution.

Note: The prelis2.log indicates abnormal termination even when the run ended without errors.

Run PRELIS the same way, except substitute the prelis2 command for lisrel8.

PRELIS output as LISREL input

Many applications use output generated by PRELIS as input to LISREL. The following example uses PRELIS commands modified from /opt/lib/lisrel/examples/simex/simex13.pr2 and LISREL commands modified from /opt/lib/lisrel/examples/simex/simex14.ls8. Suppose the PRELIS command file is called smodel1.pre.

PRELIS commands: 
Generating multivariate normal variables 
with a specified covariance matrix 
da no=200 rp=40 
ne v1=nrand 
ne v2=nrand 
ne v3=nrand
ne v4=nrand 
ne v5=nrand 
ne v6=nrand 
ne x1=v1 ne x2=.378*v1+.925806*v2 
ne x3=.72*v1+.068956*v2+.690540*v3 
ne x4=.324*v1+.321372*v2+.047151*v3+.88855*v4
ne x5=.27*v1+.26781*v2+.039292*v3+.140229*v4+.913329*v5
ne x6=.27*v1+.025858*v2+.063453*v3+.010374*v4+.006818*v5+.960339*v6
co all 
sd v1-v6 
ou cm=smodel1.cm xm ix=123456

Further suppose that the LISREL command file is called smodel1.lis.

LISREL commands: 
Fitting a confirmatory factor analysis model in each of 40 samples 
da ni=6 no=200 rp=40
cm=SMODEL1.CM 
mo nx=6 nk=2 
fr lx (1,1) lx(2,2) lx(3,1) lx(4,2) lx(5,2) lx(6,1) 
ou ad=off pv=simex1.pv sv=simex1.sv gf=simex1.gf xm

To get results from this application, run PRELIS first, so it can produce the file SMODEL1.CM, and then run LISREL. For example:

prelis2 smodel1.pre smodel1a.lst -noquery 
lisrel8 smodel1.lis smodel1b.lst -noquery

Note: Even though the filename of the output file in the PRELIS command file is in lower-case letters, PRELIS outputs a file whose name is all in upper-case letters; hence, you MUST use the upper-case version in the LISREL command file. (If you run examples from the /opt/lib/lisrel/examples/simex directory, you may have to change filenames in the LISREL command files).

The following somewhat cryptic looking alias can be placed in your .localalias file (in your home directory) to run both PRELIS and LISREL, and display the LISREL log file on your screen --

alias pre_lis 'prelis2 \!*.pre \!*a.lst -noquery;' \ 
              'lisrel8 \!*.lis \!*b.lst -noquery;' \ 
              'cat lisrel8.log'

To use this command with the above two example files, type:

pre_lis smodel

Output from the PRELIS run will be put in smodel1a.lst and output from the LISREL run put in smodel1b.lst. The LISREL log file lisrel8.log. will be displayed on your screen.

Example files

Example files are located in /opt/lib/lisrel/examples. There are four directories there - ls8ex, pr2ex, simex, and splex. These contain examples pertaining to:

  • ls8ex -- LISREL command-language examples
  • pr2ex -- PRELIS command-language examples
  • simex -- simulation examples, contains both PRELIS (pr2 extension) and LISREL examples (ls8 extension)
  • splex -- new simplis command-language examples

To use one of the test command files, change (cd) to a directory where you want to store the commands and associated data files, and type

cp /opt/lib/lisrel/examples/ls8ex/* .

This copies all the example files in /opt/lib/lisrel/examples/ls8ex to your current directory. Do likewise for any of the other example directories.

Note: The name of a file in any one of the example directories may match the name of a file in any one of the other example directories. So, if you copy examples from more than one example directory, you may want to construct a unique directory name on your own account to hold examples from each of the LISREL/PRELIS example directories.

Troubleshooting

If you get a message "Command not found" when you type lisrel8 or prelis2, the most likely cause is that you do not have stored in your path the directory where lisrel8 and prelis2 are located. This omission can be remedied by typing

cd unset noglob; ~consult/proto/setup

The second command replaces your current .login and .cshrc files after first making backup copies. (The backup copiess have the current date appended to the filename.) You can copy commands you've added to your earlier "dot" files to the end of your new ones -- aliases to .localalias and environment settings (e.g., defining your PATH) to .localenv.

After issuing these commands, log out and log in again to have them take effect.

More information

For more information, consult

LISREL manuals:

  • Karl G. Joreskog and Dag Sorbom, LISREL 8 User's Reference Guide, Chicago: Scientific Software International, 1993.
  • Karl G. Joreskog and Dag Sorbom, PRELIS 2 User's Reference Guide, Chicago: Scientific Software International, 1993.
  • Karl G. Joreskog and Dag Sorbom, LISREL 8: Structural Equation Modeling with the SIMPLIS Command Language, Chicago: Scientific Software, 1993.

UNIX manual pages: