Hi, All: I'm making linear regression graph (with xx%CI), and I have trouble changing xx%CI's display. I want xx%CI graph with dashed line (which expresses confidence limit) like Prediction Limit's display, but now, I have regression line graph with xx%CI's shaded area by submitting following code. data test;
input x y @@;
datalines;
10 10 4 5 2 5 2 4 8 4 9 6 7 6 5 2
1 1 3 2 4 7 6 7 8 9 11 8 6 4
;
run;
proc sgplot data=test;
reg x=x y=y / cli clm clmattrs=(clmlineattrs=(pattern=dash color=black));
keylegend / noborder location=outside position=top;
run; I tried by using CLMLINEATTRS= option, but I can't understand what changed. I want xx%CI's display which is expressed by dashed line & no shaded area, and also want to change xx%CI's label 's symbol (from shaded square to dash line). By using Graphics Designer & following Generated Code, I accomplished my objective. But I want to accomplish it by PROC SGPLOT, not by PROC TEMPLATE&SGRENDER. ods output outputstatistics=pred(keep=observation predictedvalue lowerclmean upperclmean
rename=(predictedvalue=pred lowerclmean=lower upperclmean=upper));
proc reg data=test;
model y=x / r clm alpha=.1;
run;
quit;
data test_1(drop=observation);
merge test pred;
run;
proc template;
define statgraph sgdesign;
dynamic _HEIGHT _UPPER _LOWER _HEIGHT2 _PREDICT _HEIGHT3 _WEIGHT;
begingraph;
layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;
layout overlay;
bandplot x=_HEIGHT limitupper=_UPPER limitlower=_LOWER / name='band' display=(OUTLINE) connectorder=axis extend=true outlineattrs=(color=CX000000 pattern=MEDIUMDASH );
seriesplot x=_HEIGHT2 y=_PREDICT / name='series' connectorder=xaxis;
scatterplot x=_HEIGHT3 y=_WEIGHT / name='scatter';
discretelegend 'scatter' 'series' 'band' / opaque=false border=false halign=center valign=top displayclipped=true down=1 order=columnmajor location=inside;
endlayout;
endlayout;
endgraph;
end;
run;
proc sgrender data=test_1 template=sgdesign;
dynamic _HEIGHT="x" _UPPER="upper" _LOWER="lower" _HEIGHT2="x" _PREDICT="pred" _HEIGHT3="x" _WEIGHT="y";
run; Thank you for your kind cooperation.
... View more