Chapter 3, Section 3.3
Time Plots of Blood Lead Levels
data tlc;
infile 'tlc.dat';
input id group $ lead0 lead1 lead4 lead6;
y=lead0; time=0; output;
y=lead1; time=1; output;
y=lead4; time=4; output;
y=lead6; time=6; output;
drop lead0 lead1 lead4 lead6;
if (id ne 197);
***********************************************;
* Removing outlier: Subject ID = 197 *;
***********************************************;
data succimer;
set tlc;
if (group = 'A');
proc sort;
by id time;
run;
goptions reset = all;
symbol1 value=circle color=black interpol = join repeat = 50;
axis1 order =(0 to 6 by 1) label=('Time (in Days)');
axis2 order =(0 to 70 by 10) label = (angle=90 'Blood Lead Levels (mcg/dL)');
title1 Time Plot, with Joined Line Segments, of Blood Lead Levels in the Succimer Group;
title2 Treatment of Lead Exposed Children (TLC) Trial;
proc gplot data = succimer;
plot y*time = id / haxis = axis1 vaxis = axis2 nolegend;
run;
proc means data=tlc n mean nway;
var y;
class time group;
output out=leadmean mean=mean;
run;
goptions reset = all;
symbol1 value=circle color=black interpol = join;
symbol2 value=triangle color=red interpol = join;
axis1 order =(0 to 6 by 1) label=('Time (in Days)');
axis2 order =(10 to 30 by 5) label = (angle=90 'Blood Lead Levels (mcg/dL)');
title1 Time Plot of Mean Blood Lead Levels in the Placebo and Succimer Groups;
title2 Treatment of Lead Exposed Children (TLC) Trial;
proc gplot data=leadmean;
plot mean*time=group / haxis = axis1 vaxis = axis2;
run;
Time Plots of Log(FEV1/Height)
data fev;
infile 'fev1.dat';
input id ht age baseht baseage logfev1;
logfev1ht=logfev1 - log(ht);
proc sort;
by id age;
run;
goptions reset = all;
symbol1 value=circle color=black interpol=join repeat=300;
axis1 order =(6 to 20 by 2) label=('Age (in Years)');
axis2 order =(-0.25 to 1 by .25) label = (angle=90 'Log(FEV1/Height)');
title1 Time Plot, with Joined Line Segments, of Log(FEV1/Height) versus Age;
title2 Six Cities Study;
proc gplot data = fev;
plot logfev1ht*age = id / haxis = axis1 vaxis = axis2 nolegend;
run;
title1 Time Plot of Log(FEV1/Height) versus Age, with Lowess Smoothed Curve;
title2 Six Cities Study;
proc sgplot data=fev;
xaxis value=(6 to 20 by 2) label='Age (in Years)';
yaxis value=(-0.25 to 1 by .25) label='Log(FEV1/Height)';
loess x=age y=logfev1ht / lineattrs=(color=black pattern=1 thickness=4) markerattrs=(color=red);
run;