hw7 - STAT 506Homework 7 For most problems you will need to...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT 506—Homework 7 For most problems you will need to access the data in the PRG2 folder. Use the libname statement we learned to load this each time you work on your assignments calling the library ‘orion’. I tried to bold the parts where I expect you to actually show me something in your homework solutions if it is not obvious. Do the following problems. 1. Creating Accumulating Totals with Conditional Logic The data set orion.order_fact contains a group of orders across several years, sorted by Order_Date . Partial Listing of orion.order_fact (617 Total Observations, 12 Total Variables) Order_ Order_ Order_ID Type Date Quantity 1230058123 1 11JAN2003 1 1230080101 2 15JAN2003 1 1230106883 2 20JAN2003 1 1230147441 1 28JAN2003 2 1230315085 1 27FEB2003 3 a. Orion Star would like to analyze 2005 data by creating accumulating totals for the number of items sold from retail, catalog, and Internet channels. The value of Order_Type indicates whether the sale was retail (=1), catalog (=2), or Internet (=3). Create a data set named work.typetotals with accumulating totals for TotalRetail , TotalCatalog , and TotalInternet , as described above. The variable Quantity contains the number of items sold for each order. For testing your program in this step, read only the first 10 observations that satisfy the WHERE statement. Remember to process only those rows where Order_Date occurs in 2005. b. Continue testing your program by printing the results from step a . Print all the variables and check to make sure that the program is correctly calculating values for the accumulating totals. PROC PRINT Output Order_ Delivery_ Order_ Obs Customer_ID Employee_ID Street_ID Date Date Order_ID Type Product_ID 1 195 120150 1600101663 02JAN2005 02JAN2005 1234437760 1 230100600028 2 36 99999999 9260128237 11JAN2005 14JAN2005 1234534069 3 240800100026 3 183 120121 1600100760 12JAN2005 12JAN2005 1234537441 1 240100200001 4 16 99999999 3940105865 12JAN2005 14JAN2005 1234538390 2 220200300015 5 16 99999999 3940105865 17JAN2005 19JAN2005 1234588648 2 230100500101 Total_Retail_ CostPrice_ Total Total Total Obs Quantity Price Per_Unit Discount Retail Catalog Internet 1 2 $193.40 $48.45 . 2 0 0 2 4 $525.20 $58.55 . 2 0 4 3 1 $16.00 $6.35 . 3 0 4 4 1 $115.00 $52.40 . 3 1 4 5 1 $138.70 $62.50 . 3 2 4 c. When the results from steps a and b are correct, do the following: Modify the program to read all observations satisfying the WHERE statement. Keep only the variables
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/20/2012 for the course STAT 506 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 6

hw7 - STAT 506Homework 7 For most problems you will need to...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online