Contents Up << >>

Narrow

Format: N[arrow] condition
The NARROW command narrows down the data set to include only those rows for which the given condition applies. All operations will subsequently only apply to the reduced data set except the following: EDIT, TITLES, NEW, DELETE, FORMAT. The data set remains narrowed until a WIDEN command is issued.

Examples:

Enter command -  NARROW C3=1
Only the rows whose first value is 1.

Enter command -  n row<50
The first 49 rows.

Enter command -  n c3!=9 & c4!=9
The rows which do not have a 9 in either the third or fourth column.

Example output:

Narrowing data set to include only lines for which C3=1
Comments

Note that you must supply the condition in the command line. A NARROW command on its own will just be ignored.

The NARROW command has a similar function to the IF option available for some commands, except that it can be used before commands which do not have an IF option.

If a second NARROW command is used on a data set which has already been narrowed down, then the narrowed data set is narrowed still further, so that the only rows remaining are those for which both conditions are true.

Note that NARROW affects all commands except those specified above. In particular the DERIVE command will only change values in rows which remain in the narrowed down data set and other rows will remain unchanged. An example of the way this can be used to code groups of values has been shown in the section on the DERIVE command.

This feature also provides the only way to produce an absolute reference to individual cells in the table from commands rather than from the data editor, by narrowing the table down to just one row. Then one can set a given column of that row to a certain value using the DERIVE command, or can read a value from that column. Suppose for example you wished to find the mean of the means of columns 1, 2 and 3:

Enter command -  wid
Enter command -  sum c1
Enter command -  n row=1
Enter command -  der c4 xmean
Enter command -  wid
Enter command -  sum c2
Enter command -  n row=2
Enter command -  sum c4 xmean
Enter command -  wid
Enter command -  sum c3
Enter command -  n row=3
Enter command -  der c4 xmean
Enter command -  wid
Enter command -  n row<=3
Enter command -  sum c4
The mean of c1 is put in the first row of c4, the mean of c2 in the second and the mean of c3 in the third. Finally the SUMMARY command is applied to all three values. This example is just to show the kind of things that can be done with EASISTAT if necessary.

EASISTAT does not have built in support for missing data values. It is up to you to code a special value to indicate that data is missing in some rows of a given column. For example if the value of 9 is used for this and you wish to perform tests on the column but to exclude those subjects (rows) for whom data is missing, you would use the NARROW command to use only the rows having a value other than 9:

Enter command -  n c4!=9