Question: The data set lemur.txt ( in the STA 3 0 2 4 folder ) contains the ID , Sex, Name, and DOB The data file
The data set lemur.txt in the STA folder contains the ID Sex, Name, and DOB The data file donation.dat is in the STA folder. The first observations are:
The following variables should be read in using list style input:
tableNameType,LengthIDNumCharacter,QNumeric,QNumeric,QNumeric,QNumeric,
and Q are the quarterly donations from each person.
Create a SAS data set containing the ID Q Q Q Q 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. The SAS data sets sales and nonsales are stored in the course folder.
a Use the statement LIBNAME lib
coursesdddbafeSTA;
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 observations and variables. The SAS data sets employee payroll and employeeaddresses are stored in the library
defined in a
a Use a PROC SORT step to sort lib.employee payroll in ascending order by
EmployeeID to create a new data set, work.payroll, that contains the sorted data.
b Use a PROC SORT step to sort lib.employeeaddresses in ascending order by
EmployeeID to create a new data set called work.addresses.
c Use a DATA step to merge the two sorted data sets by EmployeeID to create a new
data set called work.payadd. This new data set should have observations and
variables.
date of birth of ringtailed 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
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
e Print the name of the oldest female lemur.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
