Assignment 3

docx

School

Florida State University *

*We aren’t endorsed by this school

Course

STA 3024

Subject

Statistics

Date

Feb 20, 2024

Type

docx

Pages

2

Uploaded by jasenrinehart

Report
STA 3024 Assignment 3 1. The data set lemur.txt (in the STA 3024 folder) contains the ID, Sex, Name, and DOB (date of birth) of 35 ring-tailed lemurs. a. Using the list style of input read in the above data such that the dates are stored as numbers (SAS dates). Print the resulting data set without formatting it. b. Print the data set so that DOB is formatted as February 7, 2024. c. Create a new data step based on the one in (a) that calculates the age in years of each lemur. Print the entire data set with the formats from (b). d. Create a new data set by using a SET statement with the data set created in (a) and use a WHERE statement to select only lemurs born in 2016. e. Print the name of the lemur with the highest status among this group. If you have been attending class, you should be familiar with the basic structure of ring-tailed lemur society. 2. The data file donation.dat is in the STA3024 folder. The first 10 observations are: 120265 . . . 25 120267 15 15 15 15 120269 20 20 20 20 120270 20 10 5 . 120271 20 20 20 20 120272 10 10 10 10 120275 15 15 15 15 120660 25 25 25 25 120662 10 . 5 5 120663 . . 5 . The following variables should be read in using list style input: Name Type Length IDNum Character 6 Q1 Numeric 8 Q2 Numeric 8 Q3 Numeric 8 Q4 Numeric 8 Q1, Q2, Q3, and Q4 are the quarterly donations from each person. Create a SAS data set containing the ID, Q1, Q2, Q3, Q4 and two new variables: The number of quarters in which a person has a missing donation. The total of the donations for each person. Use SAS functions to calculate the new variables. 3. The SAS data sets sales and nonsales are stored in the course folder. a. Use the statement LIBNAME lib '/courses/d649d56dba27fe300/ STA3024 ' ;
to designate this folder as a library named lib. Make copies of lib.sales and lib.nonsales, called work.sales and work.nonsales. b. Use a DATA step to concatenate the SAS data sets work.sales and work.nonsales to create a new data set called work.allemployees. Use a RENAME= data set option to change the names of the different variables in work.nonsales. work.allemployees should have 400 observations and 9 variables. 4. The SAS data sets employee_payroll and employee_addresses are stored in the library defined in 3(a). a. Use a PROC SORT step to sort lib.employee_payroll in ascending order by Employee_ID to create a new data set, work.payroll, that contains the sorted data. b. Use a PROC SORT step to sort lib.employee_addresses in ascending order by Employee_ID to create a new data set called work.addresses. c. Use a DATA step to merge the two sorted data sets by Employee_ID to create a new data set called work.payadd. This new data set should have 424 observations and 16 variables.
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