# Assignment_3_answers - UNSW SCHOOL OF MATHEMATICS MATH2871...

This preview shows pages 1–3. Sign up to view the full content.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: UNSW SCHOOL OF MATHEMATICS MATH2871 DATA MANAGEMENT FOR STATISTICAL ANALYSIS ASSIGNMENT 3 - ANSWERS TOTAL MARKS 20 (15% of final grade) Due: 4pm, Friday, 22 October, 2010 There are different ways of coding programs. The followings are only suggestions, and the full mark will be given for any appropriate code. 1. [4 marks] Output data marks2b (drop=type q1-q4 anum first last); length type \$ 1 ; retain id name a1mark a2mark total; infile 'marks.txt' end =last_obs; input type \$ @; if type= 'i' then do ; if _N_> 1 then output ; input @ 4 id \$ first \$ last \$; name=catx( ', ' ,first,last); total= ; a1mark= ; a2mark= ; end ; if type= 'a' then do ; input @ 2 anum q1-q4; if anum= 1 then a1mark=sum(of q1-q4); else a2mark=sum(of q1-q4); total=sum(a1mark, a2mark); end ; name=propcase(name, ', ' ); if last_obs then output ; run ; proc print data =marks2b noobs ; run ; The SAS System id name a1mark a2mark total z35201 Ben, Simpson 31 0 31 z43437 Nicole, Chen 25 20 45 z42750 Colin, White 0 28 28 z33161 Matt, Green 25 24 49 2. [3 marks] Output data fsp; set A3.orders_midyear; keep Customer_ID Months_Ordered Total_Order_Amount; array amt{*} month:;...
View Full Document

## This note was uploaded on 06/12/2011 for the course ASB 1001,2522, taught by Professor Nicole during the One '09 term at University of New South Wales.

### Page1 / 5

Assignment_3_answers - UNSW SCHOOL OF MATHEMATICS MATH2871...

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

View Full Document
Ask a homework question - tutors are online