data framing; infile 't:\framing.txt' firstobs=2; input id sex age frw sbp sbp10 dbp chol cig chd yrschd death yrsdth cause; if chd=1 then chdny=.; if chd=0 then chdny=0; if chd>1 then chdny=1; run; /* Spm. 1: Krydstabel: køn vs. hjertesygdom. */ proc freq data=framing; tables sex*chdny/chisq relrisk; run; /* Spm. 2: Beskrivelse af aldersfordelingen, */ proc univariate data=framing; var age; run; /* Spm. 2: konstruktion af grupperet aldersvariabel - NB nyt 'data step' */ data framing; set framing; if age<=48 then ageny=1; if age > 48 and age<=52 then ageny=2; if age > 52 and age<=56 then ageny=3; if age > 56 then ageny=4; run; /* Spm. 2: analyse af køn vs. hjertesygdom stratificeret for alder. */ proc freq data=framing; tables ageny*sex*chdny/chisq relrisk cmh; run; /* Smp. 3: beskrivelse af blodtryksfordelingen. */ proc univariate data=framing; var sbp; run; /* Spm. 3: konstruktion af grupperet blodtryksvariabel - NB nyt 'data step' */ data framing; set framing; if sbp<=130 then sbpny=1; if sbp > 130 and sbp<=160 then sbpny=2; if sbp > 160 then sbpny=3; run; /* Spm. 3: analyse af køn vs. hjertesygdom stratificeret for blodtryk. */ proc freq data=framing; tables sbpny*sex*chdny/chisq relrisk cmh; run;