MidTerm Project SAS Code for Problem 1

.txt

School

University Of Arizona *

*We aren’t endorsed by this school

Course

5A

Subject

Mechanical Engineering

Date

Dec 6, 2023

Type

txt

Pages

3

Uploaded by CaptainApe3549

Report
/* BIOS 576D Midterm Project_Rev C 1) (10 points) Injury Severity Score (ISS). Abbreviated Injury Scale (AIS) measurement on six variables representing six areas on or near the upper body. Each body area has an injury measurement ranging from 0 (no injury) to 6 (nonsurvivable injury). Raw data file ais_iss.csv is provided and contains measurements for 6964 UMC patients with traumatic injuries. Generate annotated SAS code that reads and inspects ais_iss.csv and performs the tasks in (a) through (e) below Read ais_iss.csv and inspect the dataset contents */ PROC IMPORT datafile='~/bios576d/ais_iss.csv' out=work.ais_iss dbms=csv replace; /* Read the raw data file => SAS data set */ datarow=2; delimiter=','; getnames=yes; guessingrows=max; run; proc contents data=work.ais_iss; /* Use this to inspect the SAS data set */ title 'AIS_ISS Dataset'; run; /* 6964 observations on 7 numeric variables (patient ID + 6 AIS measurements) */ /* 1a) (2 points) Calculate, report and interpret appropriate descriptive statistics for each variable in the data set representing an area of the body and its AIS measurement. For which body area(s) were nonsurvivable injuries measurements recorded? */ title '1a) Descriptive Statistics for AIS_ISS Dataset'; proc freq; tables Abd_AIS Head_AIS Extrem_AIS External_AIS Chest_AIS Face_AIS; proc means; var Abd_AIS Head_AIS Extrem_AIS External_AIS Chest_AIS Face_AIS; run; title; /* Interpretation: In this data set, no body areas had missing values. Chest injuries dominate: - All 6964 patients had injuries to the Chest (no patients had Chest_AIS= 0 = No injury). - The Chest was the only body area for which nonsurviable injures were recorded => 4 patients had a value of Face_AIS=6. - Chest injuries had the highest mean AIS measurement (2.4). Abdomen injuries had the lowest mean AIS measurement (0.01). /* 1b) (3 points) Determine the Injury Severity Score (ISS) for each patient by identifying the three highest AIS values and adding up the squares of these three values. If a patient has a nonsurvivable injury in any of the six areas of the body, set the ISS automatically to 75. Note: If you decide to use an array for this part of the the exercise, the statement CALL SORTN(OF name_of_array{*}) in your data step will sort the values in the array from smallest to largest. Print the values for the 6 variables and their calculated ISS, but, using appropriate SAS code, only include the results for patients 10 through 35 in your document. Analysis approach:
Place each patient's body area variable in an array, sort the array elements from smallest to largest, and sum the squares of array elements 4, 5 and 6 to calculate the ISS for the patient. Note: The 3 highest AIS values are automatically sorted into elements 4, 5 and 6 by SORTN. Note: In lieu of using an array and SORTN, you could use the LARGEST function instead: largest(k, abd_ais, head_ais, extrem_ais, external_ais, chest_ais, face_ais) where value k=1 is the largest value of the 6 body areas, k=2 is the second largest value, etc. and assigning the results to variables named largest1, largest2, largest3. If array element 6 has a value of 6, then set the patient's ISS to 75 Patient ID 9, 651, 5799, and 6361 are the four with values of Face_AIS= 6 */ data work.ais_iss_score; set work.ais_iss; /* Using an array and call routine SORTN ... */ array ais{*} abd_ais head_ais extrem_ais external_ais face_ais chest_ais /* or ais{*} */; call sortn(of ais{*}); /* sort array ais in ascending order, must use ais{*}, not ais{6} */ iss_score=(ais{4})**2 + (ais{5})**2 + (ais{6})**2; if ais{6}=6 then iss_score=75; /* Using the largest function instead ... */ /* largest3=largest(3, abd_ais, head_ais, extrem_ais, external_ais, chest_ais, face_ais); largest2=largest(2, abd_ais, head_ais, extrem_ais, external_ais, chest_ais, face_ais); largest1=largest(1, abd_ais, head_ais, extrem_ais, external_ais, chest_ais, face_ais); iss_score=(largest3)**2 + (largest2)**2 + (largest1)**2; if largest1=6 then iss_score=75; */ run; title '1b) Calculated Injury Severity Score (ISS) for Patients 10 to 35'; proc print data=work.ais_iss_score (firstobs=10 obs=35); run; title; /* 1c) (3 points) How many patients have more than 4 of the 6 body areas injured? Use a data step and a sum statement to perform this calculation, not PROC FREQ or PROC MEANS. Note: Using the “end of file processing” (EOF) method discussed in Homework #3, Optional Extra Credit problem, may simplify your code and output. Analysis approach: Use the optional "end of file" processing method in a data null step. For each patient, use variable count_ais to count the number of injured body areas, then increment variable count_gt4 by one for each patient having count_ais > 4. Otherwise, use a PROC PRINT step Answer: 266 (5 injuries) + 53 (6 injures) = 319 patients */
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help