a4 - EXAMPLE A4 SAS Program data group1; input age @;...

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

View Full Document Right Arrow Icon
EXAMPLE A4 SAS Program data group1; input age @@; datalines; 1 3 7 9 12 17 21 26 30 32 36 42 45 51 ; run; data group2; set group1; if 0<=age<10 then agegroup=0; else if 10<=age<20 then agegroup=10; else if 20<=age<30 then agegroup=20; else if 30<=age<40 then agegroup=30; else if 40<=age<50 then agegroup=40; else if age >=50 then agegroup=50; run; proc print;run; data group3; set group1; agegroup=int(age/10)*10; run; proc print; run;
Background image of page 1

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

View Full DocumentRight Arrow Icon
SAS Log 1 options ls=80 nodate pageno=1; 2 data group1; 3 input age @@; 4 datalines; NOTE: SAS went to a new line when INPUT statement reached past the end of a line. NOTE: The data set WORK.GROUP1 has 14 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.12 seconds cpu time 0.00 seconds 6 ; 7 run; 8 9 data group2; 10 set group1; 11 if 0<=age<10 then agegroup=0; 12 else if 10<=age<20 then agegroup=10; 13 else if 20<=age<30 then agegroup=20; 14 else if 30<=age<40 then agegroup=30; 15 else if 40<=age<50 then agegroup=40;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

a4 - EXAMPLE A4 SAS Program data group1; input age @;...

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

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