程序案例-STAT 325

SDSU – Fall 2021 – STAT 325 1st Midterm Exam – October 13, 2021 Due: Thursday, October 14, 2021 at 11:59 PM PDT Student Name: Student Red ID #: 1. PROC IMPORT can be used to read what type of input data files A. Space-delimited (or Fixed format) Text Data File B. Tab-delimited Text Data File C. CSV Data File D. Excel (XLSX) File E. All of the Above Enter Answer: 2. When specifying the FIRSTOBS=2 option in an INFILE statement, what does this tell SAS to do A. Read the first column of data B. Read the first row of data C. Ignore the first row in the input data file and read data starting at observation (row) #2 D. None of the Above E. All of the Above Enter Answer: 3. Download the Heart tab-delimited text data file from the Data Sources folder on Canvas and use SAS Studio to upload the Heart tab-delimited text data file to your folder in the cloud. Then, construct a DATA step program that specifies the DATA, INFILE, INPUT and RUN statements to read ALL the data records and variables from the data file and create a temporary SAS dataset in the “WORK” library. Verify that your code executed successfully by carefully inspecting the SAS Log, and download your SAS DATA step code as a PDF document. 4. Download the SAS Log from the DATA step program you constructed and executed in question #3 as a PDF document. 5. Construct PROC PRINT code to display the data in the SAS dataset you created in question #3 and download the SAS code, SAS Log and Results to a PDF document. 6. Download the Heart Comma Separated Value (CSV) data file from the Data Sources folder on Canvas and use SAS Studio to upload the Heart Comma Separated Value (CSV) data file to your folder in the cloud. Then, construct a DATA step program that specifies the DATA, INFILE, INPUT, FORMAT and RUN statements to read all the observations and ALL the variables and create a temporary SAS dataset in the “WORK” library. Verify that your code executed successfully by carefully inspecting the SAS Log, and download your SAS code and SAS Log as a PDF document. 7. Download the Heart Excel (XLSX) data file from the Data Sources folder on Canvas and use SAS Studio to upload the Heart Excel (XLSX) data file to your folder in the cloud. Using SAS Studio, construct a DATA step program that specifies the LIBNAME, DATA, SET, and RUN statements to read all the observations and all the variables and create a temporary SAS dataset in the “WORK” library. Verify that your code executed successfully by carefully inspecting the SAS Log, and download your SAS DATA step code as a PDF document. 8. Download the SAS Log from the DATA step program you constructed and executed in question #7 as a PDF document. 9. Construct PROC PRINT code to produce detail results for the contents of the SAS dataset you created in question #7 and download the SAS code, SAS Log and Results to a PDF document. 10. Construct PROC FREQ code to produce one-way frequency tables for the SEX, SMOKING_STATUS and STATUS variables from the Heart SAS dataset you created in question #7 and download the SAS code, SAS Log and Results to a PDF document. 11. Construct PROC FREQ code that specifies a WHERE statement to subset “Female” Heart patients and produce a two-way frequency table that displays the variables SMOKING_STATUS and STATUS variables from the Heart SAS dataset you created in question #7. Download the SAS code, SAS Log and Results to a PDF document. 12. Construct PROC MEANS code to produce descriptive statistics for all numeric variables in the Heart SAS dataset you created in question #7. Download the SAS code, SAS Log and Results to a PDF document. 13. Construct PROC MEANS code that specifies a WHERE statement to subset Heart patients that weigh more than 180 pounds from the SAS dataset you created in question #7. Verify your code and results for correctness, and download the SAS code, SAS Log and Results to a PDF document. 14. Construct PROC FREQ code with the TABLES statement to identify “Missing” values for the variables DEATHCAUSE, AGECHDDIAG, AGEATDEATH, CHOLESTEROL and CHOL_STATUS and by specifying a WHERE statement to subset Heart patients that weigh more than 180 pounds for the Heart SAS dataset you created in question #7. Verify your code and results for correctness, and download the SAS code, SAS Log and Results to a PDF document. 15. Construct PROC SORT code to remove duplicate observations (rows) from the Heart SAS dataset you created in question #7 by specifying the SMOKING_STATUS variable in your BY statement and the NODUPKEY keyword. Then, construct PROC PRINT code to display the data contained in the OUT= dataset you created. Verify your code and results for correctness, and download the SAS code, SAS Log and Results to a PDF document. Submission Requirements Carefully name and include all your PDF documents into a Zip file and send as an attachment in an email the Zip file and all its contents to: KirkLafler@cs.com Also, be sure to enter the following information in the email’s Subject line: SDSU – STAT 325 – Fall 2021 – 1st Midterm Exam – Your Lastname, Firstname Good Luck everyone!