Path: janda.org/c10 > Syllabus > Outline > Topics and Readings
> Computers in Research > Recording Data--syntax format
Recording Data for
Computer Analysis: Syntax format |
|||
This page describes how to record data in SPSS on the UNIX system that we used in my statistics course last year. |
|||
Go here for a table of selected data for the 50 states and Washington, D.C. |
|||
Here is the first portion of that data set: |
|||
NAME BLACKPOP PCTBLACK CLINTON BILL96 VOTES80 VOTES90 01 ALABAMA 1021 25.3 41 43 9 9 02 ALASKA 22 4.0 32 33 3 3 03 ARIZONA 111 3.0 37 47 7 8 04 ARKANSAS 374 15.9 54 54 6 6 05 CALIFORN 2209 7.4 47 51 47 54 06 COLORADO 133 4.0 40 44 8 8 07 CONNECTI 274 8.3 42 52 8 8 08 DELAWARE 112 16.8 44 52 3 3 09 DIST OF 400 65.9 86 85 3 3 10 FLORIDA 1760 13.6 39 48 21 25 |
|||
Learn these terms as they apply to these data |
|||
CASE |
This is the unit of analysis, the basis of observation
(e.g., the state) |
||
VARIABLE |
properties of the case |
||
VALUES |
scores of the properties (e.g., the 1,021,000 blacks in Alabama constitute 25.3% of the population) |
||
The rectangular shape of this dataset is the basic format of a dataset, also called "flat format"
|
|||
A historical note: recording data on "punchcards"
|
|||
llustrate with data on American states,
Note that numbers are "right-justified"--the units positions are aligned on the right side |
|||
Selecting the cases for entry into a machine readable file
|
|||
Log into hardin again to record your data, using an editing program called qedit under a special menuing script called doit |
|||
doit was written by Bruce Foster. |
|||
It was named after the famous Nike slogan, "Do It!" |
|||
This time type doit at the unix prompt: |
|||
hardin(kjanda) 43% |
doit |
||
|
|||
Name of SPSS syntax file? |
mydata |
||
|
|||
Your task is to enter your ten cases (without the column headings) into this editing space. Follow this format for entering data into columns: |
|||
|
|||
Observe the column locations above the data at the and record your ten cases precisely in the indicated columns. Do not enter the sequence number (01 to 51) for the states. You may wish to insert a row of repeated numbers, 1-9, to help locate the columns: 123456789 123456789 123456789 123456789 Note that a decimal point takes up one column. |
|||
To view editing commands available in qedit type control-k together and then h, and you'll see this screen: |
|||
Note that all these editing commands require use of the
control key, which is also designated ^. Thus,
control-k is equivalent to simultaneously pressing
^ and k. This notation will be used
henceforth. |
|||
Exit the Help Screen by typing ^h k again. You can use the ^h k sequence at any time to toggle into and out of the Help Screen. |
|||
Below is roughly what your file should look like if you had used the first ten states in the list: |
|||
Before you exit, position the cursor on the first line and enter ^y to delete the nine of numbers, if you included one. |
|||
Exit and save the data using ^k x, which will save a file called mydata.sps in your home directory. |
|||
On leaving the editor, you will automatically return to control of doit and see these menu choices: |
|||
C10 doit - Monday 09/27/99 15:32:14 1. Edit syntax (qedit mydata.sps) 2. Run SPSS (spss -m < mydata.sps > mydata.lst) 3. Display results (more mydata.lst) 4. Print results 5. C10 Bulletin (more $CLASS/bull) 6. Getinfo for C10 Datasets (getinfo). 7. Change syntax file 8. Quit this menu. <----choose option 8 |
|||
Enter your choice: 8 |
|||
This takes you out of doit and back to the unix prompt. |
|||
hardin(kjanda) 43% |
|||
Although doit contains an option to print results from an SPSS run, you have only entered some data and haven't run anything yet. So type the following to print your set of ten cases. |
|||
hardin(kjand) 43% lp cresap115 mydata.sps |
|||
request id is cresap115 (1 file) |
|||
hardin(kjanda) 44% logout |
|||
Pick up the output at Cresap Room 115, with your netid printed as the banner identiifying your output. Warning: Due to deregulation, no one is in charge of the printed output. Allow at least a half hour for printing and disposal. |