|
Page 3 of 5 Later versions of SPSS allowed more flexible naming of this kind: any (combination of) letter(s) could be used at the beginning of the name and the requirement for 3 digits was dropped. Some researchers immediately started calling their variables V1 TO V69 or Q1 TO Q69 and the like, which was certainly an improvement as the names at least bore a more transparent relationship to the questionnaire from which they were purportedly derived! Also the ability to use Vddd instead of VARddd saved a lot of key depressions when specifying analyses. However even this can get cumbersome once we get questionnaires with large classification sections (i.e. no question numbers) and questions with multiple subquestions . So far SPSS does not offer automatic generation of names for variables whose sequence is defined by alphabetical order of their last letter (e.g. Q21a Q21b Q21c etc). The SSRC Survey Unit was attached to the London School of Economics and through the LSE we had access to the CDC2000 at the University of London Computer Centre. It was here (in the early 70's) that we had our first taste of SPSS. Before SPSS we relied on commercial services (eg Donovan Data Systems at Research Services Ltd) which could produce client friendly tables (with labels and full text) or we used LSE's own survey data tabulation program, SDTAB (6). The latter was limited in its facilities, but had a convention of naming variables by their position on an 80-column Hollerith card. SDTAB variables could only consist of a three digit number in which the first digit indicated which card, and the second and third digits which column, the data were to be read from. Thus 151 would be the name of the variable on column 51 of card 1 and 237 would be on card 2, column 37. Remember in those days everything, including SPSS programs, had to be punched on cards and read through a card reader. (Prior to that even the tabulations were performed on a card sorter.) With this program, data was limited to 9 cards per survey. SDTAB's variable naming had the distinct advantage that computer printout could instantly be related to the data layout for a questionnaire, and vice-versa, provided, of course, that the questionnaire had been properly laid out, not just to record respondents' answers, but also for use as a data-entry tool. What we started doing at the SSRC Survey Unit, and developed further at PNL, was to combine the automatic name generating capacity of SPSS with the variable naming logic of SDTAB. We also made one major departure from sequential naming. In our convention the numeric part of the variable name relates, not to its sequential position in the questionnaire, but to its actual location in the coded data. This means that names immediately relate to the line of data within each case, and to the position, or column(s), within each line. In all our variable names, the last two digits tell us which column(s) in a data line contain(s) the coded data for the variable, and the digit (or digits) before them tells us which line of data the variable is on. Thus, to us, V106 indicates the variable which is coded on line 1, column 6 of the data (It does not mean the 106th variable in the file!). Conversely, if we have to name a variable, the data for which is to be entered on line 3 in column 44, we should call it V344. Ah, you may say. But what if it's a variable like age which you have coded as two digits on line 3, columns 14 -15? Well, when a variable is spread across more than one column ( in computer jargon, a "field" more than one column wide) we always call the variable by the first column in the field. In our example, age would be called V314 and there would not be a variable V315. The next variable after age would then be V316. All variables in the final version of the SPSS saved system file will have names beginning with a letter V followed by three digits (or four (7) if there are ten or more records per case). Exceptions will be derived variables such as scores from attitude scales or complex derived variables such as income when it has been computed from several other variables. Even the standard classification variables such as sex, age and income groups will start life in V-form. This positional convention is much preferable to sequential naming for one other important reason. Most decent questionnaires already have printed on them information for the data-preparation people to punch data on to 80 column cards or, more likely these days, keying the data directly into the computer. Either way, the data will appear in the computer as lines in such a way that the coded data for each question appear on the line(s) and in the position(s) indicated by the layout information for data-prep which normally appears down the margins of the questionnaire pages. This gives the immediate and enormous advantage that the original questionnaire can be used as a document for understanding what variables are called and what they are. Thus V528 can immediately be checked by looking for the question that has been coded on line 5 column 28: conversely the question that has been coded on column 28 on line 5 can be expected to be called V528 (at least on most surveys handled by the Survey Research Unit at PNL) To go back to our original example: Variable Codes Line number Column(s) Party support Con, Lab, Lib-Dem, 1 27 Other, None, Refused Union support 1,2,3,4,5,8,9 2 34 Sex M,F 3 07 Age 16 - 90,99 3 08-09 These data have, let's say, been stored on drive A: in a data file called POLY.DAT and there are three data lines per case. We want to read in the data for these four variables and then save them on drive A: in a file called POLY.SAV for future use. Remember, we have coded party support using numeric codes, but left sex with its original alphabetic codes. How do we get SPSS to read these data and save them in a saved system file?
6) SDTAB was written by Peter Wakeford, then Director of Computer Services at LSE 7) For example, the data for the 1989 British Social Attitudes survey, used in the PNL course Survey Analysis Workshop, has 23 records per case.
|