<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How Can I Display Confidence Interval like Prediction Limit by PROC SGPLOT? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/461481#M15908</link>
    <description>&lt;P&gt;Hi, All:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm making linear regression graph (with xx%CI), and I have trouble changing xx%CI's display.&lt;/P&gt;&lt;P&gt;I want xx%CI graph with dashed line (which expresses confidence limit) like Prediction Limit's display,&lt;/P&gt;&lt;P&gt;but now, I have regression line graph with xx%CI's shaded area by submitting following code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I tried by using CLMLINEATTRS= option, but I can't understand what changed.&lt;/P&gt;&lt;P&gt;I want xx%CI's display which is expressed by dashed line &amp;amp; no shaded area, and also want to change xx%CI's label 's symbol (from shaded square to dash line).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using Graphics Designer &amp;amp; following Generated Code, I accomplished my objective.&lt;/P&gt;&lt;P&gt;But I want to accomplish it by PROC SGPLOT, not by PROC TEMPLATE&amp;amp;SGRENDER.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LikeThis.JPG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20453i4CEDE6665C29D881/image-size/small?v=v2&amp;amp;px=200" role="button" title="LikeThis.JPG" alt="LikeThis.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your kind cooperation.&lt;/P&gt;</description>
    <pubDate>Fri, 11 May 2018 06:06:33 GMT</pubDate>
    <dc:creator>KentaMURANAKA</dc:creator>
    <dc:date>2018-05-11T06:06:33Z</dc:date>
    <item>
      <title>How Can I Display Confidence Interval like Prediction Limit by PROC SGPLOT?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/461481#M15908</link>
      <description>&lt;P&gt;Hi, All:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm making linear regression graph (with xx%CI), and I have trouble changing xx%CI's display.&lt;/P&gt;&lt;P&gt;I want xx%CI graph with dashed line (which expresses confidence limit) like Prediction Limit's display,&lt;/P&gt;&lt;P&gt;but now, I have regression line graph with xx%CI's shaded area by submitting following code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I tried by using CLMLINEATTRS= option, but I can't understand what changed.&lt;/P&gt;&lt;P&gt;I want xx%CI's display which is expressed by dashed line &amp;amp; no shaded area, and also want to change xx%CI's label 's symbol (from shaded square to dash line).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using Graphics Designer &amp;amp; following Generated Code, I accomplished my objective.&lt;/P&gt;&lt;P&gt;But I want to accomplish it by PROC SGPLOT, not by PROC TEMPLATE&amp;amp;SGRENDER.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LikeThis.JPG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20453i4CEDE6665C29D881/image-size/small?v=v2&amp;amp;px=200" role="button" title="LikeThis.JPG" alt="LikeThis.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your kind cooperation.&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 06:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/461481#M15908</guid>
      <dc:creator>KentaMURANAKA</dc:creator>
      <dc:date>2018-05-11T06:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Display Confidence Interval like Prediction Limit by PROC SGPLOT?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/461599#M15914</link>
      <description>&lt;P&gt;This code may do what you want.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation for the REG statement includes these two sentences:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;CLMLINEATTRS= has no effect unless you change the display options in the style element to display outlines. See the preceding code example.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;But I didn't see any preceding code example.&amp;nbsp; Googling "CLMLINEATTRS=style-element &amp;lt;(options)&amp;gt;" helped me find the code example in the PBSPLINE statement documentation for PROG SGPLOT in the &lt;STRONG&gt;&lt;EM&gt;SAS 9.3 ODS Graphics: Procedures Guide, Third Edition&lt;/EM&gt;&lt;/STRONG&gt;.&amp;nbsp; That's the PROC TEMPLATE below, which is how you turn on the fill outline.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I &lt;STRONG&gt;don't&lt;/STRONG&gt; see the code example in the most recent version of the online documentation for the PBSPLINE statement in PROC SGPLOT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
  define style MyStyleDefault;
  parent=Styles.htmlblue;
  style GraphBand from GraphBand /
      DisplayOpts = "Fill outline";
  end; 
run;

ods html5 (id=web) style= MyStyleDefault;

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 / clm clmattrs=(clmfillattrs=(color=white) 
	                            clmlineattrs=(pattern=mediumdash color=black thickness=2))
	              nolegclm;
	keylegend "y" "band" "fit" / noborder location=outside position=top;
	legenditem type=line name="band" / label="95% Confidence Limits" 
	                                   lineattrs=(pattern=mediumdash
	                                              color=black 
	                                              thickness=2);
	legenditem type=marker name="y" / label="y" markerattrs=(symbol=circle);
	legenditem type=line name="fit" / label="Regression" lineattrs=(pattern=solid
	                                                                thickness=2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The screen shot below is the graphic from the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Show confidence limit lines in PROC SGPLOT rather than shaded area" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20465i6C638AEAE1402DAE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Show_only_confidence_limit_line_not_shaded_area_PROC_SGPLOT.jpg" alt="Show confidence limit lines in PROC SGPLOT rather than shaded area" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Show confidence limit lines in PROC SGPLOT rather than shaded area&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 16:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/461599#M15914</guid>
      <dc:creator>SuzanneDorinski</dc:creator>
      <dc:date>2018-05-11T16:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Display Confidence Interval like Prediction Limit by PROC SGPLOT?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/461918#M15927</link>
      <description>&lt;P&gt;Hi, Suzanne:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply and your attached picture is just my wanted.&lt;/P&gt;&lt;P&gt;But LEGENDITEM statement in PROC SGPLOT applies to SAS9.4M5 or to the latter, and unfortunately, mine is SAS9.4M3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I questioned this, I tried another method and got the following "closer" to my objective.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=SASHELP.CLASSFIT;
    band x=HEIGHT UPPER=UPPER LOWER=LOWER /  nofill LINEATTRS=(color=CX000000 pattern=SHORTDASH );
    series x=HEIGHT y=PREDICT;
    scatter x=HEIGHT y=WEIGHT;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LikeThis.JPG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20492i2CDEF1EBC25338CA/image-size/small?v=v2&amp;amp;px=200" role="button" title="LikeThis.JPG" alt="LikeThis.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It's like my goal and I thought I accomplished, but........&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;
ods output outputstatistics=pred(keep=observation predictedvalue lowerclmean upperclmean
                                 rename=(predictedvalue=pred lowerclmean=lower upperclmean=upper));
proc reg data=test;
    model y=x / p clm alpha=.1;
run;
quit;
data test_1(drop=observation);
    merge test pred;
run;
proc sgplot data=test_1;
    reg x=x y=y / clm filledoutlinedmarkers;
run;
proc sgplot data=test_1;
    band x=x upper=upper lower=lower / nofill lineattrs=(color=cx000000 pattern=shortdash);
    series x=x y=pred;
    scatter x=x y=y;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="What.JPG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20493iDAA5518002863CFC/image-size/small?v=v2&amp;amp;px=200" role="button" title="What.JPG" alt="What.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can't understand why multiple CI lines are displayed, and what the difference is between SASHELP.CLASSFIT data &amp;amp; my TEST_1 data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please give me some advice. Thank you for your kind cooperation.&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 05:17:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/461918#M15927</guid>
      <dc:creator>KentaMURANAKA</dc:creator>
      <dc:date>2018-05-14T05:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Display Confidence Interval like Prediction Limit by PROC SGPLOT?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/462051#M15937</link>
      <description>&lt;P&gt;The documentation for the BAND statement includes the following note:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="xis-procSummary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xis-summaryNote"&gt;Note:&lt;/TD&gt;
&lt;TD class="xis-summaryValue"&gt;The input data should be sorted by the X or Y variable. If the data is not sorted, the graph might produce unpredictable results.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I did a sort by X, the graph looked like what you want.&amp;nbsp; When I did a sort by Y, it didn't look like what you want.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 14:09:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/462051#M15937</guid>
      <dc:creator>SuzanneDorinski</dc:creator>
      <dc:date>2018-05-14T14:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Display Confidence Interval like Prediction Limit by PROC SGPLOT?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/462912#M15965</link>
      <description>&lt;P&gt;Hi, Suzanne:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply &amp;amp; I'm so sorry for my late response.&lt;/P&gt;&lt;P&gt;Like you said, I sorted data by x, and got my wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 00:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Display-Confidence-Interval-like-Prediction-Limit-by/m-p/462912#M15965</guid>
      <dc:creator>KentaMURANAKA</dc:creator>
      <dc:date>2018-05-17T00:34:36Z</dc:date>
    </item>
  </channel>
</rss>

