Question: MS 3 2 5 1 Analytics Using SAS Assignment 1 - You must complete the assignment by yourself. Exchanging ideas with classmates is Showing your
MS Analytics Using SAS
Assignment
You must complete the assignment by yourself. Exchanging ideas with classmates is Showing your work to your classmates is a nonacceptable collaboration. All identified
Complete all questions. Put all of your SAS code into one PDF file. It would be best to
mark each question's answer as SAS comment statements in the code, such as Question Name your code file as nnnnnnnnpdf where nnnnnnnn is your full name.
You should set all irrelevant statements in your code as SAS comment statements. Be aware that your SAS code created under a nonEnglish operating system may contain
extraneous characters when viewed in an English operating system. You are responsible for ensuring your submitted code is free of these characters. All extraneous characters in Utilising codes not included in the course notes will not be accepted as correct answers,
even though they are not wrong. of the course on Canvas. If you submit your file more than once, only the latest submitte shall be deducted for every minute or less late. The submission link will be closed at Question marks
Suppose the raw data file PurchaseRecords. dat not provided has already been referred to definition in your code. PurchaseRecords contains each customer's purchase records. Fo order: customer's identity at most characters, no embedded blank number of visits the units purchased in each visit standard numeric if applicable. The exact number of fields he customer had purchased any units during the visit. A visit without purchase will have n units in two of the three visits. Each customer in PurchaseRecords made at least one visit, table shows a subset of the records in PurchaseRecords.
Write a SAS DATA step that reads each record of PurchaseRecords into a SAS data set named Purchases. The data set Purchases must contain only three variables: a customer's identity,
the number of visits, and the total number of units purchased in all visits by the custome
There is one observation for each unique customer's identity. For a visit without purchase,
the purchased number of units of that visit should be set to The following table shows subset of Purchase
are meaningful and valid SAS variable names. You must accomplish the task with only one
SAS DATA step. Using any other procedures is not allowed. Question marks
Suppose the raw data file Sales.txt not provided has already been referred to by the
defeference 'DataB' in SAS Studio. You do not need to submit the FILENAME
"David Wong" Aug
"David Wong" Aug
"Brian Leung" Sep
Sep
"Mary Chan" Jul
Aug
Aug
Dec
Aug
The first line in the shown table is not part of the data file. The records in the data set ar alesperson's name at most quoted characters, including the quotes and embedded field of the record always starts from the first column. Subsequent records of the same
ddmonyyyy and the sales amount standard numeric The sales date field in these the data set does not contain in any column. All fields are separated by a blank space, and ne or more lines of records, and the same salesperson's records are not listed in date order. Write a SAS DATA step that reads each record of SalesRecords.txt into a SAS data set named It contains only one observation for each salesperso
It contains only the following variables: a salesperson's name without quotes, the
salesperson's latest sales date in SAS date values, the number of days between the sales date is Dec then the number of days equal to the salesperson's total
number of sales equivalent to the salesperson's number of records in Sales and the for reference only. You don't need to define them in your SAS DATA step. You may name th You must accomplish the task with only one SAS DATA step. Using any other procedures is t allowed.
begintabularlrrrrr
hline Name & Last sales date & Number of sales & Running sales total & Days between last sales and Dec
hline David Wong & & & &
hline Brian Leung & & & &
hline Mary Chan & & & &
hline John Tam & & & &
hline
endtabular example, Varjand assigns a SAS date value constant to the variable Var The
difference between two SAS date values recent SAS date value earlier SAS date value
returns the number of days between two dates.
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
