Console data entry



NEWVAR
 NEWVAR [vlist] | [DICT_ONLY | NODIC ]
                [NCAS=n_case_to_read] [CENTER{=value}]
                [DMISS | DMIN | DMAX ]
NEWVAR lets you type in data from the keyboard. For each variable on the variable list EDA will query for the data values and then for the label and descriptor. The <vlist> may be omitted (no implied variable list). In this case EDA will ask for a single new variable, stored into the next free location in the WA. (Note that with DICT_ONLY a variable list is required).

NEWVAR prompts for values to be entered by showing the next case to be entered (case number as well as casid in parenthesis). Each line you type in may contain as many values as you like (a single value or several values separated by blanks or commas) as long as they fit on a single line. Data items (cases) conform to the definition of simple expressions (excluding casid and case substitution). Up to MCAS cases may be entered per variable. Query for data items is terminated either by a blank line or - if the NCAS option is present - if a sufficient number of items have been supplied. (It is also possible to terminate data input by specifying the // mark at the end of a data list, BUT NOT in columns 1-2, where // means cancel, i.e. do not continue and do not create a variable).

Errors on the item list are diagnosed and the user is asked to replace the value in error by a correct value (simple expression) or to cancel the command (not in macro mode). Note that, if you have specified several values on the same line, only the values in error are diagnosed and are replaced by the value you supply. There is no need to re-enter correct values, only the incorrect ones are diagnoes indidually and as they appear in your data list.

When entering data security may be important, i.e. you often do wish to be able to recover from any error. EDA protects you against accidental deletion of variables by setting them to "protected", as well as the whole WA, i.e. you may not overwrite a variable or WA, unless you say explictely so. See the SET WAPROTECTION and REVERT, as well as the QUIT command for additional information.

These security features cannot prevent system problems (e.g. power failure), user interruption (most computers have a way of aborting a program immediately) or other unforseen problems. When entering a large amount of data it is advisable to turn command logging on, i.e. all input entered on the keyboard will be recorded to a file; this file may later be edited and re-submitted as a command file. See the SET LOG command for more details.

Range checking
Data entered may be subject to range checking, if range checking is active, i.e. values outside the allowable range are considered in error (see SET CRANGE for more information).
Options
CENTER: The center option will cause NEWVAR to ask for a center (reference) value with each variable entered. The alternative form CENTER=value makes only sense with a single variable; as usually the center values are different for each variables CENTER=value would set the center values for all variables to the same <value>.

The DMISS/DMIN/DMAX parameters define the default value for a value not supplied by the user. The only way of doing this is typing to consecutive commas with no data item inbetween. Default is not to accept "empty" values. DMISS replaces them by the system default (replacement) value, DMIN by the minimum range (SET CRANGE or default) and DMAX the range maximum.

If the NODICT option is present or if the user response to the label/descriptor query is a blank line, a default label and descriptor is created, the label is the position of the variable in the WA preceded by a V, e.g. V0010, the descriptor contains data and time, when the variable has been entered, plus a '*' mark to signal that the documentation of the variable is incomplete.

DICT_ONLY option
The DICT_ONLY option queries only for labels and descriptors (e.g. to add this to variables read from a raw data file or by NEWVAR NODICT, which suppresses the query for dictionary information).
Alternatives
The EDIT module offers alternatives to the NEWVAR command, namely there is a NEWVAR command within EDIT which lets you enter data case-wise for several variables, i.e. values entered on each data line are for the same case, but for different variables. Furthermore there are commands you may use to insert cases, delete cases and to append cases to an existing variable.

Note also that EDA does not have a fully designed interactive data entry system. In many situations it might therefore be advisable to use some data entry system (for instance the Data Entry module available with SPSS-PC), a spreadsheet program (like Lotus 123 or EXCEL) or a filer (like Reflex, PC-File etc.) and then export the data using the Lotus WK1/WKS format. See below (*READ SPREADSHEET) for information on how to read these files into EDA.

A commented example
    >NEWVAR 3 4                                             (1)
    >>> Terminate with a blank line                         (2)
    Enter variable #  3
    Case 1 (ZH) :1,4,2,1,2,3,4,1,2,1                        (3)
    Case 11(SO) :2
    Case 12(BS) :3
    Case 13(BL) :3 5 1 2 1 2    2 3 1  1,2 3
    Case 24(NE) :3 3 29                                     (4)
    Case 27(27) :3 3 29                                     (4)
    Label   Descriptor                                   .  (5)
    demo1   demo variable for NEWVAR
    Enter variable #  4                                     (6)
    Case 1 (ZH) :1 2 3 0 O 1 2 3                            (7)
    < 54> O    not found or defined
    >>> Correct or cancel with //:0
    Case 9 (ZG) :21 21 aa bb cc 12 2                        (8)
    < 54> aa   not found or defined
    >>> Correct or cancel with //:1
    < 54> bb   not found or defined
    >>> Correct or cancel with //:2
    < 54> cc   not found or defined
     >>> Correct or cancel with //:5
    Case 16 (AR) :1,1,2,1,12,,12,12,12                      (9)
    <  4> s-expression missing
    >>> Correct or cancel with //:12
    Case 25(GE) :21 11
    Case 27(27) :
    Label   Descriptor                                    .
    demo2   Second demo variable
    >
Comments:

(1) This command request to variables to be entered, i.e. variables 3 and 4. You will enter variable 3 completely, before going on with variable 4.

(2) In addition to this information the status line will guide you with more information.

(3) Enter the data items without any constraints. Separate items either by a space (or several spaces) or a (single) comma. Note the prompt in front of the date items: "Case 1 (ZH) :". The (ZH) is a case id. This example use Swiss canton ids, i.e this means either you have loaded previously a WA containing these ids or you have issued a CASID DEFINE CH before the NEWVAR command. Not that with default (numerical) case ids the prompt would look like "Case 1 (1) :", i.e. the parentheses contain the numerical case id "1".

(4) An empty line terminates the current variable.

(5) EDA then asks you to enter a descriptor and label (unless the NODICT option has been specified).

(6) EDA then proceeds to the next variable.

(7) Here the user entered a 'O' (upper case 'O'), i.e. an error. EDA asks for a replacement. No need to retype the other values.

(8) Here several errors occur, which are corrected in turn.

(9) The error here is more subtle: two consecutive commas tell EDA that a value has not been supplied. This is not allowed, unless you use a DMIN/MAX DMISS option.