SPSS Instructions for Reading Data
-
0. Download the file "lead.dat" from the web page,
and put it somewhere on your computer where you can find it later.
I suggest making a folder on your C: drive called 960:532, and putting
it there.
- 1. If you don't already have SPSS up and running,
- click on SPSS icon, and obtain a menu entitled "What would
you like to do?"
- Select "Open an existing data source" and click "OK".
- Skip to step 3.
-
2. If you already have SPSS up and running, do File->Open->Data, or
File->Read Text Data
- 3. In the file browser, select the data file that
you want to examine. To run the lead example, we'll open "lead.dat".
Change to the folder with this file, and then under "files of type"
select "all files".
-
4. Select the file "lead.dat". This will open an import wizard.
The import wizard will run you through multiple steps.
-
a. In step 1, you'll be asked whether the file has a predetermined type.
Select no, and hit next.
-
b. In step 2, you'll be asked whether the file is delimited. Our file
is delimited by spaces, so select "yes". You'll be asked whether the
file contains names in the first line. Select "no". click next.
-
c. In step 3, you'll be asked which line the first case begins on, whether
each line represents a case, and how many cases you want to import.
Select "1", "each line represents a case", and "all". Click next.
-
d. In step 4, you'll be asked for a delimiter, and a text qualifier.
The delimiter is what separates data values. Common values are space,
comma, semicolon, and tab. Others are also possible. Select space.
A text qualifier surrounds text, so that the text can contain whatever
would otherwise be interpreted as the delimiter. Common values are
quote and none. Select none.
-
e. In step 5, select names for your variables. You should see a
box at the top labeled "Variable Name", and a box at the bottom
labeled "Data Preview". SPSS has already given generic names to the
columns (something beginning with V and followed by numbers).
Give names to columns by clicking on the box in the appropriate data column
of the data preview window
containing the generic name, and typing the name you want. Repeat as necessary,clicking the appropriate column and typing in the variable name box.
The first column contains
log blood lead levels. Call it lblood. Type lblood in the variable
name box. You will also get a spread sheet with the data set in it.
Click on the tops of the columns to input names for the other columns.
Give them the names interven, rent, demog, lfloor, lsill, lsoil, and soil.
These represent intervention (0 for control, 1 for intervention group),
1 if rents home and 0 if owns home, a demographic variable that we
won't use, log lead levels on the floor, window sill, and soil outside,
respectively, and an indicator of whether soil is accessible to children.
Once you've named these columns, click "next".
-
-
f. In step 6, you can modify the steps that you've just typed.
Select the box marked "yes" when asked whether you want to past syntax,
and hit finish.
Back to course page