Stats >> Training >> Stats #01: Practice exercises

1. On your floppy disk, you will find a file: bf.xls. This file is a Microsoft Excel spreadsheet that has been stored in version 3.0 format. Import this data into SPSS.

2. On your floppy disk, you will find a file: practice.mdb. This file is a Microsoft Access database. Import data from the demographics table into SPSS.

3. Define a variable named "Race" in SPSS. Set the type to numeric with zero decimal places. Use "Race/Ethnicity" as the variable label. Use the following value labels:

Set the value of 9 to represent missing data.

4. Use the data from Table 1. Create five columns of data in SPSS following the general form shown above.

There are five variables in the data set

Select brief names for each of these variables.

Define the five variables with the following format types

Be sure to add the following variable labels (use the list shown above)

Leave the value labels undefined for the first, third, and fifth columns. Define the following value labels for the second column:

Define the following value labels for the fourth column

Declare missing values for the last four columns as

The first column does not have any missing values.

After you have documented this information, but before you have entered any data, save the file. Then enter the data as it appears in Table 1, and save the file again.

5. Table 2 shows the dates of birth and dates of admission to the hospital for the first ten infants in a study of jaundice in infants. Enter this data into SPSS. Add variable labels to each variable. Enter the data from Table 2 into SPSS. Compute the age at admission by using the formula

(adm_date-bir_date)/(24*60*60)


Table 1. Use this data for exercise #4.

     J760223         0        18       1       1.550
     J676434         0        33       0       1.990
     J689673         0        34       1          -1
     J785310         0        36       1       1.640
     J785827         1        26       1       2.060
     J562494         9        28       1       1.685
     J675320         9        -1       9       2.435

Table 2. Use this data for exercise #5.

     id bir_date   adm_date
     11 03/10/1998 03/16/1998
     12 01/26/2001 02/01/2001
     13 07/18/2000 07/23/2000
     14 07/11/2002 07/15/2002
     15 01/17/2001 01/20/2001
     16 02/06/2001 02/20/2001
     17 08/20/2002 08/24/2002
     18 01/15/2001 01/21/2001
     19 09/19/2001 09/23/2001
     20 12/05/2002 12/08/2002