Format: I[input] [filename [param1 param2 ....] or close]Causes a command file to be read in. Command files contain commands exactly as they would be typed at the keyboard.
Examples:
Enter command - IN comm0911.log Enter command - i Enter name of file to read input from (KEY for keyboard): demoIf you do not initially supply a name for the file then EASISTAT will ask for it.
Enter command - i closeThe keyword CLOSE means finish the command file now, as if the end of the file had been reached.
It is also possible to pass replaceable parameters to a command file as one can with MS-DOS batch files. These parameters are typed on the EASISTAT command line after the file name, and are then substituted wherever ... file called EXAMPLE that contains the following line:
ECHO parm1 %1 parm2 %2 parm3 %3then entering:
Enter command - INPUT EXAMPLE one two testingwill produce the following output:
parm1 one parm2 two parm3 testingThe original purpose of this was to allow you to perform the same set of tests repeatedly on different columns, but it is a very flexible feature and can be used in a variety of other ways as well.
Comments
Command files are a powerful feature of EASISTAT. Long and complex analyses can be prepared in advance on a word processor and then can be run automatically without supervision. As you grow more familiar with EASISTAT you shold learn to use command files extensively.
The file on your disk called demo is a command file. Please study it to see how it works. Note that you can also input a command file when you first run EASISTAT by entering e.g. easistat demo. This causes EASISTAT to read in the command file called demo, exactly as if you had typed INPUT demo instead once EASISTAT was running. This facility means EASISTAT analyses can be run as part of DOS batch files.
Normally if EASISTAT finds an error in a command file it will pause and ask whether to continue or jump to the end of the file or relinquish control to the keyboard. You may want to prevent this happening and for EASISTAT to continue even if it does find errors, perhaps because you wish to perform some long analyses while the computer is unattended. To do this use the -I switch in the command line after the file name:
easistat a-long.job -iIn this mode EASISTAT will not stop for errors or pauses in the command file. It may be wise to put a few blank lines between each command in the command file, so that a mistake in one does not cause the next to be misread.
Command files can be nested up to five deep, that is one command file can contain an INPUT command to read in another, and so on. The second will be read through and when it finishes control is returned to the first file. It is possible for a command file to transfer control temporarily to the keyboard as if the keyboard was another file. To do this the keyword KEY is used:
INPUT KEYSince the keyboard doesn't end the way a file does, the only way to get back to the original file is to type:
INPUT CLOSEUnless the -I switch has been used, every time the command file comes across the PAUSE command or an error is found the user is given the option of taking temporary control at the keyboard by typing K. He or she can later return to the command file by using the INPUT CLOSE command.
Any line in an input file starting with a semi-colon is ignored. This can be used to put explanatory comments and reminders into input files.
Here is an example of a fairly complex command file which takes the names of two columns as parameters and performs Wilcoxon's signed rank sum test to compare them. If the file were called WILCSR.INP then one would run it by entering:
INPUT WILCSR.INP C14 C15to compare columns 14 and 15.
ECHO Command file "WILCSR" to perform signed rank sum test ECHO comparing %1 and %2 LABEL V1 N' LABEL V2 T1 LABEL V3 T2 LABEL V4 VAR LABEL V5 MEAN ; use convenient labels to refer to the first four general ; variables NEW NEXT DIF DERIVE DIF %1 - %2 ; create a new column called DIF, the difference between the ; two columns to be compared NARROW %1 != %2 ; ignore rows in which the values are equal DERIVE DIF ABS DIF DERIVE DIF RANK DIF ; alter DIF to contain the ranks of the absolute magnitudes ; of the differences between the columns BASICS DIF DERIVE N' XNUMBER BASICS DIF IF %1>%2 DERIVE T1 XTOTAL BASICS DIF IF %1<%2 DERIVE T2 XTOTAL ; now N' contains the number of rows used, T1 is the total of ; the ranks of the differences for which the first column is ; larger and T2 of those for which the second is larger DERIVE VAR N'*(N'+1)*(2*N'+1)/24 DERIVE MEAN 0.25*N'*(N'+1) ECHO Here are the values for T1, T2 and N': ARITH T1 ARITH T2 ARITH N' ECHO Standardised normal deviate (with continuity correction) is: ARITH (ABS(T1-MEAN)-0.5)/(VAR POW 0.5) ECHO ECHO Approximate P value (single-tailed) is: ARITH 1-PN((ABS(T1-MEAN)-0.5)/(VAR POW 0.5)) ; the expected mean and variance are used to calculate the ; standardised normal deviate and therefore significance of the ; result (ties are ignored) DEL DIF ; finally, the new column created is deletedThe built-in Wilcoxon's signed rank sum test is somewhat superior to this command file because it takes account of tied ranks. However this example is designed to demonstrate the way in which additional statistical tests not built into EASISTAT can be constructed by hand if desired.
Another way to use command files might be to set up some batch files which will run certain simple tests automatically. For example, the following batch file called CHISQ.BAT can be run from MS-DOS to perform a two-by- two chi-squared test:
rem CHISQ.BAT if exist chisq.out del chisq.out echo output chisq.out > chisq.inp echo chisq n 2 2 >> chisq.inp echo %1 %2 >> chisq.inp echo %3 %4 >> chisq.inp echo quit >> chisq.inp echo y >> chisq.inp easistat chisq.inp type chisq.outThis batch file uses the parameter substitution feature and ECHO command of MS-DOS (not EASISTAT) to produce a command file for EASISTAT called chisq.inp. If the batch file were run from MS-DOS as follows:
CHISQ 6 12 34 10then chisq.inp would contain the following lines:
output chisq.out chisq n 2 2 6 12 34 10 quit yWhen EASISTAT is run the commands in chisq.inp are read in just as if the command INPUT chisq.inp had been given from within EASISTAT. These commands instruct EASISTAT to send its output to a file called CHISQ.OUT, then to perform a chi-squared test on a two-by-two table with the values specified, and then to quit and return to MS-DOS. Control is thus returned to the batch file which uses the MS-DOS TYPE command to display chisq.out on the screen.