Reference no: EM132390105
SAS Programming I: DATA Step and PROC Fundamentals BIOL-40190
Programming Assignment
You will need to use the data file suppTRP-1062.txt which is located on the server in the directory /courses/dc4508e5ba27fe300/c_629
There are 15 observations in the data file suppTRP-1062.txt. The data are shown in the box below.
J,08,2,1,02/08/1998,74,280,1.9,4.3,6
J,11,1, ,12/14/1997,66,169,3.5,3.3,5.2
R,16,1,1,12/27/1997,70,233,1.6,1.6
R,09,2,2,12/27/1997,74,387,4.4,1.5,2
J,06,1,2,01/03/1998,64,210,4,4.2,4.4
J,10,1,2,01/03/1998,68,258,10.3,9,5.2
R,15,1,2, ,70,172,6.3
J,07,2,3,01/10/1998,74,177,2.3,3.4,4.5
J,09,2,3,01/11/1998,72,185,1.4,1.4,1.4
J,12,2,3,01/17/1998,76,358,3.9,5,7.6
R,08,2,3,01/24/1998,72,386,4,5.1
R,10,2,3,02/21/1998,62,152,6
J,14,1,3,01/04/1998,69,195,7.8,1.3,5.6
R,24,1,3,02/07/1998,67,212,1.8,2.3,2.3
J,13,1,4,01/31/1998,63,204,4.7,7.3,1
The data are comma-delimited and correspond to the following variables and descriptions.
Variable Name Variable Description
Site Study Site
Pt Patient
Sex Patient Sex
Race Patient Race
Dosedate Dose Date
Height Patient Height
Weight Patient Weight
Result1 Lab Result #1
Result2 Lab Result #2
Result3 Lab Result #3
Create a SAS data set called STUDY as follows:
1 - Read in the data in suppTRP-1062.txt.
Create the variable Site with length of 1.
Create the variable Pt as character of length 2.
All other variables should be created as numeric with the default length of 8.
2 - Using if-then statements and date constants, create a new variable called Doselot (Dose Lot).
Note: Do not use functions for this item.
If the dose date is in 1997, then the dose lot is S0576.
If the dose date is in 1998 and on or before 10 January 1998, then the dose lot is P1122.
If the dose date is after 10 January 1998, then the dose lot is P0526.
If the dose date is missing, then the dose lot is missing.
3 - Create two new variables called prot_amend (Protocol Amendment) and Limit (Lower Limit of Detection) that meet the
criteria below. Note: All of the code for this item should be contained within two do-end statements.
If the dose lot is P0526 then the Protocol Amendment is B.
For all other non-missing dose lots, the Protocol Amendment is A.
The Lower Limit of Detection is 0.03 for female patients who received dose lot P0526.
The Lower Limit of Detection is 0.02 for male patients who received dose lot P0526.
The Lower Limit of Detection is 0.02 for patients who received dose lots S0576 and P1122.
If the dose lot is missing, then these new variables are also missing.
4 - Using a select statement, use the variable Site to create a new variable called site_name (Site Name) which contains
the name of the Study Site.
The Site values and associated names are:
J=Aurora Health Associates, Q=Omaha Medical Center, R=Sherwin Heights Healthcare
5 - Create and apply formats to the Sex and Race variables.
The decodes for sex are 1=Female, 2=Male
The decodes for race are 1=Asian, 2=Black, 3=Caucasian, 4=Other
6 - Using the descriptive information provided previously, create labels for these variables:
Site, Pt, Dosedate, Doselot, prot_amend, Limit, site_name
Before submitting your assignment, please ensure that your code and files meet the following criteria:
Your program has one data step which creates one data set.
Your data set has 15 observations and 14 variables.
Your code conforms to the item specifications and coding methodology.
Your code is in sequential order and contains comments clearly identifying by item number the code for each item.
Your code properly accounts for missing values.
Missing values in your data set are left as missing and not artificially populated with values such as the word "Missing".
Your code conforms to good programming practices by using white space, proper indentation, comments, etc.
Your completed program may also need other statements or procedures that are implied but not specified (i.e. filename statements or PROC FORMAT).
You do not need PROC PRINT at the end of your program.
Your log file does not contain any ERROR or WARNING messages.
Your files are flat files with the proper file extensions (.sas and .log).