options nocenter ps = 60 ls = 75; data sasuser.juul; infile 'T:\juul2.txt'; input age height menarche sexnr sigf1 tanner testvol weight; run; proc means data=sasuser.juul; run; data spm1; set sasuser.juul; title 'SPM-1'; bmi=weight/(height/100)**2; run; proc print data=spm1; run; data spm2; set spm1; title 'SPM-2'; lweight=log10(weight); lheight=log10(height); run; *plot nr 1; proc gplot data=spm2; plot weight*height; symbol v=circle i=none c=black r=1; run; *plot nr 2; proc gplot data=spm2; plot weight*height; symbol v=circle i=rl c=black r=1; run; *plot nr 3; proc gplot data=spm2; plot lweight*lheight; symbol v=circle i=rl c=black r=1; run; *goptions display; *plot nr 4; proc gplot data=spm2; plot lweight*lheight / haxis=axis1 vaxis=axis2 frame; axis1 value=(H=2) minor=NONE label=(H=3 'log10(height)'); axis2 value=(H=2) minor=NONE label=(A=90 R=0 H=3 'log10(weight)'); symbol v=circle i=rl h=2 c=black r=1; run; data spm3; set spm2; title 'SPM-3'; if sexnr=2 then sex='female'; if sexnr=1 then sex='male'; lsigf1=log10(sigf1); ssigf1=sqrt(sigf1); proc format; value tanner_f 1='inden pubertet' 2='pubertetsstart' 3='midt i pubertet' 4='slutning af pubertet' 5='efter pubertet'; run; proc means mean median std min max data=spm3; var age height weight bmi sigf1; run; proc freq data=spm3; table sex; run; proc sort data=spm3; by sex tanner; run; proc means mean median std min max data=spm3; by sex; class tanner; var sigf1 lsigf1 ssigf1; format tanner tanner_f.; run; *plot nr 5, 6; proc boxplot data=spm3; by sex; plot sigf1*tanner / boxstyle=schematic; run; *plot nr 7; proc univariate noprint data=spm3; var sigf1; class sexnr; histogram / cfill=gray normal; inset mean std skewness / header='descriptive'; run; data spm4; set spm3; title 'SPM-4'; proc sort data=spm4; by tanner; run; *plot nr 8,9,10,11 og 12; proc gplot data=spm4; by tanner; where tanner>0; plot sigf1*age=sexnr / haxis=axis1 vaxis=axis2 frame; axis1 value=(H=2) minor=NONE label=(H=3 'alder'); axis2 order=(0 to 1000 by 100) value=(H=2) minor=NONE label=(A=90 R=0 H=3 'serum IGF-1'); symbol1 v='M' i=none h=2 c=black r=1; symbol2 v='F' i=none h=2 c=black r=1; title F=swissb h=3 'Serum IGF-1 vs. alder'; run; data spm5; set spm4; title 'SPM-5'; if tanner=1 then materiale=1; if age>25 then materiale=2; if age<20 then agegrp=ceil(age/2); run; proc sort data=spm5; by materiale; run; *plot nr 13,14; proc gplot data=spm5; by materiale; where materiale>0; plot ssigf1*age=sex; symbol1 v='M' i=rl h=2 c=black r=2; symbol2 v='F' i=rl h=2 c=black r=2; run; proc means noprint mean data=spm5; class agegrp; var ssigf1; output out=ny mean=mssigf1; run; data spm5; set ny; msigf1=mssigf1**2; run; proc print data=spm5; run; *plot nr 15; proc gplot data=spm5; plot mssigf1*agegrp / haxis=axis1 vaxis=axis2 frame; axis1 value=(H=2) minor=NONE label=(H=3 'alder'); axis2 value=(H=2) minor=NONE label=(A=90 R=0 H=3 'kvadratrod serum IGF-1'); symbol1 v=circle i=join h=2 c=black r=1; title F=swissb h=3 'Serum IGF-1 vs. aldersgruppe'; run; *plot nr 16; proc gplot data=spm5; plot msigf1*agegrp / haxis=axis1 vaxis=axis2 frame; axis1 value=(H=2) minor=NONE label=(H=3 'alder'); axis2 value=(H=2) minor=NONE label=(A=90 R=0 H=3 'serum IGF-1'); symbol1 v=circle i=join h=2 c=black r=1; title F=swissb h=3 'Serum IGF-1 vs. aldersgruppe'; run;