
Biostat 510
Homework 9
Due Tuesday, April 10, 2007
1. Create an SPSS data set from the raw data file, afifi.dat, on my web page. Please
do this using syntax. Remember that you have two records (2 rows of raw data)
per person in this file. You can get the data description for the Afifi data at the
end of this homework assignment, along with starter commands for reading in the
raw data and creating new variables.
a) You should read in all variables.
b) Create value labels for SHOKTYPE, SEX, and SURVIVE. Check the
coursepack for information on the meaning of each shock type.
c) Create new variables:
i. SHOCK: Dummy Variable: 0=no shock 1=shock, and assign value
labels to this variable.
ii. DIED: Dummy Variable: 0=lived 1=died, and assign value labels
to this variable.
iii. SHOCK_DUM2 - SHOCK_DUM7: Dummy variables for each
shock type (shock types go from 2 through 7).
iv. SBPDIFF: The difference between SBP at time2 and SBP at time1.
Calculate by subtracting SBP1 from SBP2.
2. Get a table of simple descriptive statistics for all variables in the data set. Include
this output in your writeup.
3. Get oneway frequency tables for SHOKTYPE, SHOCK, SURIVE, DIED, and
SEX. Include these tables in your writeup. The value labels should appear in the
output.
4. Get a histogram of SBP1 for those who died and did not die.
a) Make the histogram so we can see the distribution of SBP1 separately for
those who died and did not die (use SURVIVE as the Row variable in the
histogram).
b) Include the histograms in your writeup.
5. Carry out an independent samples t-test to compare the means of SBP1 and
SBPDIFF for those who lived and those who died. Include the output from these
t-tests in your writeup.
6. Carry out a paired t-test to compare the mean of SBP1 vs. SBP2 for all patients.
Redo this paired t-test separately for those who lived and those who died. Include
the output from these tests in your writeup.
1