Question: A research project at a college department has collected data on athletes. A subset of the data is given below. We will construct a single
A research project at a college department has collected data on athletes.
A subset of the data is given below. We will construct a single SAS program to do the tasks described in the itemized parts below.
Systolic Diastolic blood blood Heart IdNo Age Race pressure pressure rate 4101 18 W 130 80 60 4102 18 W 140 90 70 4103 19 B 120 70 64 4104 17 B 150 90 76 4105 18 B 124 86 72 4106 19 W 145 94 70 4107 23 B 125 78 68 4108 21 W 140 85 74 4109 18 W 150 82 65 4110 20 W 145 95 75 Write SAS code to accomplish all of the tasks described below in a single SAS program. Put appropriate titles on each listing produced (i.e., use appropriate title statements in the proc steps) for the purpose of identifying parts of the output clearly. Execute the complete program.
a. Write SAS statements necessary to create a SAS data set named athlete. Name your variables as IdNo, Age, Race, SPB, DBP, and HR, respectively. Include a label statement for the purpose of describing the variables SPB, DBP, and HR. Enter the data instream, leaving a blank between fields and use the list input style to read the data in. [This is the first data step in your program]
b. Average blood pressure is defined as a weighted average of systolic blood pressure and diastolic blood pressure. Since heart spends more time in its relaxed state (diastole), the diastolic pressure is weighted two-thirds, and the systolic blood pressure is weighted one-third.
Add a SAS programming statement to the data step to create a new variable named ABP which contains values of average blood pressure computed for each athlete. Label this variable also. [This modifies the first data step.]
c. Add a PROC step to obtain a SAS listing of the data set athlete.
[This would be the first proc step in your program]
d. Add SAS statements to create a new data set named project containing a subset of observations from the above data set. This subset will consist of only those athletes with a value greater than or equal to 100 for average blood pressure and a heart rate greater than 70 and provide a SAS listing of this data set. Omit the observation number from this listing; instead identify the athletes in the output by their ID numbers. [You will add a second data step and a second proc step to do this part.]
e. Obtain the same listing as in part (d), but without creating a new SAS data set to do it. Instead use the SAS statement where within the proc print step to select the subset of observations to be processed. [ This would require a third proc step.]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
