I have attached the data if it would be useful in your helping me achieve this task. Data Selected;
Set mylibrary.Mean_Comparison_Proc;
Period2 = input(Period, 2.);
Drop Period;
rename Period2=Period;
run;
Proc Sort Data=Selected;
by resp_name Treatment Period;
run; I created the above individual graphs using SGPLOT within a macro, with the below code: Proc Sql noprint;
select count(distinct resp_name) into :obs from Selected;
select distinct resp_name into :resp1-:resp5 from Selected;
Quit;
%Macro TestSee;
%do i = 1 %to &obs;
%Let value1=(650 to 750 by 10); %Let value2=(1.0 to 2.0 by 0.1); %Let value3=(1 to 2.0 by 0.1); %Let value4=(2 to 5 by 0.1); %Let value5=(35 to 45 by 1);
%Let ylabel1=BW, kg; %Let ylabel2=ECM/DMI, kg/kg; %Let ylabel3=Milk Fat Yield, kg; %Let ylabel4=Milk Fat Percentage, %; %Let ylabel5=Milk Yield, kg;
%Let xlabel=Week of Trial;
proc format;
value $treatmentFmt
"Bov" = "PRO-A"
"BovC" = "PRO-B"
"Control" = "CON"
;
ods html style=listing; *In SAS 9.4 you need a style like LISTING to see different symbols;
Proc SGPLOT data = Selected noautolegend;
format treatment $treatmentFmt.;
where resp_name="&&resp&i";
styleattrs datasymbols=(CircleFilled triangleFilled SquareFilled) datalinepatterns=(ShortDash Solid MediumDash) datacontrastcolors=(darkblue darkred darkgreen);
Series x=Period y=estimate/ group=Treatment grouplc=Treatment groupmc=Treatment markers lineattrs=(thickness=1) name="Treatment";
Scatter x=Period y=estimate/ group=Treatment name="a" YErrorUpper=Upper YErrorLower=Lower;*groupdisplay=cluster clusterwidth=0.6 datalabel=MSgroup datalabelattrs=(size=9pt color=gray);
yaxis label="&&ylabel&i" Labelattrs=(Family=Arial Size=11 weight=Bold ) valueattrs=(size=10) values=&&value&i;
xaxis discreteorder=data label="&xlabel." Labelattrs=(Family=Arial Size=11 weight=Bold ) valueattrs=(size=10) values=(1 to 12 by 1);
keylegend "Treatment"/ title="Treatment:" location=inside position=topright across=1;
run;
%end;
Ods html CLOSE;
%mend;
%TestSee; What i however need is a grid of all 5 graphs with independent axis, all labelled as i did with the above graph. I did research on Proc template and it seems it could really do the job for me, but i still couldn't figure out how to make this work. I will really appreciate your help guys. Thank you.
... View more