<?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 Re: PROC TEMPLATE De-Bugging help in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-TEMPLATE-De-Bugging-help/m-p/271583#M9671</link>
    <description>&lt;P&gt;I think the third line is behind the blue line. To test this theory, change the REGRESSIONPLOT to LOESSPLOT and see if the line appears.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the legend, The labels will come from the group values, as the plots are grouped plots. Also, instead of DISCRETELEGEND, use MERGEDLEGEND with the names of the SCATTERPLOT and REGRESSIONPLOT. For example,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MERGEDLEGEND "trends" "diff" / title="Comparisons";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2016 03:01:53 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2016-05-19T03:01:53Z</dc:date>
    <item>
      <title>PROC TEMPLATE De-Bugging help</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-TEMPLATE-De-Bugging-help/m-p/271560#M9670</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to PROC TEMPLATE but I would like to create a&amp;nbsp;scatterplot with&amp;nbsp;regression lines overlayed. I have a categorical variable "comp" that has 3 values. I would like there to be 3 regression lines, one for each of these groups. Similarly, I would like the scatterplot to have different shapes and colors for each of the "comp" values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code below, I get only 2 regression lines. Where am I going wrong? I am using SAS 9.3, and a sample of the data is attached to this message:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define style Styles.BAPstyle; 
    parent=styles.listing;
    style GraphData1 from GraphData1 /
      ContrastColor=blue
      Color=blue
      MarkerSymbol="CircleFilled"
      Linestyle=1;
    style GraphData2 from GraphData2 /
      ContrastColor=orange
      Color=orange
      MarkerSymbol="TriangleFilled"
      Linestyle=2;
    style GraphData3 from GraphData3 /
      ContrastColor=black
      Color=black
      MarkerSymbol="SquareFilled"
      Linestyle=3;
  end;
run;


proc template;
define statgraph BAP;
begingraph ;
  entrytitle "Sector 1 Bland-Altman Plot";
  layout overlay / 
  		yaxisopts=(label="Difference between Measurements")
		xaxisopts = (label = "Measurement Average");
	scatterplot x = mean y = diff / 
		group = comp name = "diff";
	regressionplot x=mean y=diff /
        group=comp
        name="trends";
    discretelegend "trends" "diff"/ 
		title="Comparisons";
	referenceline Y = 0 / 
		CURVELABEL =  "Zero Bias Line" 
		CURVELABELLOCATION = Outside
		DATATRANSPARENCY = 0.5;
	referenceline Y = &amp;amp;upper / 
		CURVELABEL =  "95% Upper Limit" 
		CURVELABELLOCATION = Outside
		DATATRANSPARENCY = 0.5;
	referenceline Y = &amp;amp;lower / 
		CURVELABEL =  "95% Lower Limit" 
		CURVELABELLOCATION = Outside
		DATATRANSPARENCY = 0.5;
  endlayout;
endgraph;
end;
run;


proc sort data = test; by comp; run;
ods _all_ close;
ods graphics / reset imagename="Bland-Altman";
ods pdf file="&amp;amp;out.\fig1.pdf" style=BAPstyle;

proc sgrender data=test template=BAP;
	format comp $comp.;
run;
ods pdf close;
ods pdf;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the plot that I get in return (notice the missing black line):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3225i40DCA09213D221AB/image-size/medium?v=v2&amp;amp;px=-1" border="0" alt="snip.JPG" title="snip.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally, I would love suggestions on how to make a legend that grouped the scatterplot point with the corresponding line with the relevant label.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 23:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-TEMPLATE-De-Bugging-help/m-p/271560#M9670</guid>
      <dc:creator>rsilve</dc:creator>
      <dc:date>2016-05-18T23:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TEMPLATE De-Bugging help</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-TEMPLATE-De-Bugging-help/m-p/271583#M9671</link>
      <description>&lt;P&gt;I think the third line is behind the blue line. To test this theory, change the REGRESSIONPLOT to LOESSPLOT and see if the line appears.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the legend, The labels will come from the group values, as the plots are grouped plots. Also, instead of DISCRETELEGEND, use MERGEDLEGEND with the names of the SCATTERPLOT and REGRESSIONPLOT. For example,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MERGEDLEGEND "trends" "diff" / title="Comparisons";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 03:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-TEMPLATE-De-Bugging-help/m-p/271583#M9671</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2016-05-19T03:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TEMPLATE De-Bugging help</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-TEMPLATE-De-Bugging-help/m-p/272551#M9727</link>
      <description>&lt;P&gt;Thanks for the suggestions,&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130" target="_self"&gt;DanH_sas&lt;/A&gt;, but changing to LOESSPLOT does not make a third line appear. I have isolated the problem to the format statement. For some reason without the format I get exactly what I want, 3 regression lines. Can anyone tell me why the format statement is not compatable here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thanks.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 20:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-TEMPLATE-De-Bugging-help/m-p/272551#M9727</guid>
      <dc:creator>rsilve</dc:creator>
      <dc:date>2016-05-23T20:17:41Z</dc:date>
    </item>
  </channel>
</rss>

