<?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: sgplot with macro and do loops in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/884040#M349250</link>
    <description>&lt;P&gt;Hi Reeza,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution worked however I still got one more problem when I try to display the slope. It is not showing the correct intercept value not sure what is the issue. this is the figure and the code that I'm trying&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="mona12_0-1688773071256.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85665i1662BA586DB9837C/image-size/large?v=v2&amp;amp;px=999" role="button" title="mona12_0-1688773071256.png" alt="mona12_0-1688773071256.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;%macro create_graph(_paramn=, _param=, _avision=, _trta=, _usubjid=);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; data _null_;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set example (obs=1);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where paramn=&amp;amp;_paramn. &amp;amp; param="&amp;amp;_param." &amp;amp; avision=&amp;amp;_avision. &amp;amp; trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid.";&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; call symput('Int', put(intercept, BEST6.));&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; call symput('Slope', put(slope, BEST6.));&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; run;&lt;/DIV&gt;
&lt;DIV&gt;title " &amp;amp;_param &amp;amp;_avision &amp;amp;_trta &amp;amp;_usubjid";&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; proc sgplot data=example noautolegend;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where paramn=&amp;amp;_paramn. &amp;amp; param="&amp;amp;_param." &amp;amp; avision=&amp;amp;_avision. &amp;amp; trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid.";&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scatter x=parcat3n y=value / group=trta groupdisplay=cluster clusterwidth=0.5&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; markerattrs=(size=10)errorbarattrs=(thickness=2);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; styleattrs datasymbols=(circle);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yaxis label='Aval (D)' grid values=(-7.25 to 7.25 by 0.25);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xaxis offsetmax=0.08 fitpolicy=rotate values=(-0.41 -0.2 0 0.2 0.41 0.61 0.81&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.02 1.22 1.43 1.63 1.83 2.04 2.24 2.44 2.65 2.85 3.06 3.26);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refline x_axis_value / axis=x lineattrs=(color=red thickness=3px&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pattern=ShortDashDot);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inset "Intercept = &amp;amp;Int" "Slope = &amp;amp;Slope" / border title="Parameter Estimates" position=topleft;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; lineparm&amp;nbsp; &amp;nbsp;x=0 y=intercept slope=Slope;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; keylegend / title="Treatment";&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;%mend;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;data test;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; set example;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; by paramn param avision trta usubjid NOTSORTED;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if first.usubjid then&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str=catt('%create_graph(_paramn=', paramn, ", _param=", param,&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; " , _avision=", avision, ", _trta= ", trta, ", _usubjid=", %str(usubjid),&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ');');&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rc=dosubl(str);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 23:38:08 GMT</pubDate>
    <dc:creator>LOLO12</dc:creator>
    <dc:date>2023-07-07T23:38:08Z</dc:date>
    <item>
      <title>sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883797#M349165</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have difficulties getting some graphs rights. I'm not familiar with do loops and macro with sgplot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to output the scatter plots, the slope and the slope value, and the point of change on the x axis.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is a sample of the data and code below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;&amp;nbsp;
input usubjid $ trta $ param $ paramn parcat3n avision value intercept slope x_axis_value;&amp;nbsp;
datalines;
1 A Vertical(D)&amp;nbsp; 1 -0.2 2 0.1707 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 -0.2 2 -0.0669 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 -0.2 2 0.1521 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 -0.2 2 -0.0992 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 -0.41 2 -0.0714 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 -0.41 2 0.1811 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 -0.41 2 0.0141 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 -0.41 2 -0.1178 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0 &amp;nbsp; &amp;nbsp; 2 -0.1262 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0 &amp;nbsp; &amp;nbsp; 2 -0.0793 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0 &amp;nbsp; &amp;nbsp; 2 0.0298 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0 &amp;nbsp; &amp;nbsp; 2 0.1851 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.2 &amp;nbsp; &amp;nbsp; 2 -0.0253 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.2 &amp;nbsp; &amp;nbsp; 2 0.1388 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.2 &amp;nbsp; &amp;nbsp; 2 0.6125 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.2 &amp;nbsp; &amp;nbsp; 2 -0.0559 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.41 2 -0.0255 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.41 2 -0.1386 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.41 2 0.3035 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.41 2 0.0774 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.61 2 0.0726 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.61 2 -0.1511 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.61 2 -0.2065 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.61 2 0.2805 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.81 2 0.1613 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.81 2 0.3675 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.81 2 0.2 &amp;nbsp; &amp;nbsp; 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 0.81 2 0.0016 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.02 2 0.1792 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.02 2 0.2991 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.02 2 0.3813 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.02 2 0.2411 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.22 2 0.2553 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.22 2 0.2884 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.22 2 0.7136 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.22 2 -0.0152 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.43 2 0.4232 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.43 2 0.448 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.43 2 0.2378 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.43 2 0.5496 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.63 2 0.5702 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.63 2 0.6 &amp;nbsp; &amp;nbsp; 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.63 2 0.6161 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.63 2 0.4157 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.83 2 1.0329 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.83 2 0.5851 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.83 2 0.6626 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 1.83 2 0.7523 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.04 2 0.7635 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.04 2 0.7686 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.04 2 0.9049 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.04 2 0.6882 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.24 2 0.8305 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.24 2 0.9262 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.24 2 0.8935 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 2.24 2 1.3591 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.44 2 1.0929 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.44 2 1.5478 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.44 2 1.0488 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.44 2 0.7817 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 2.65 2 1.1285 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 2.65 2 1.2927 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 2.65 2 1.2595 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.65 2 0.9924 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.85 2 1.4696 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.85 2 0.2935 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.85 2 0.7271 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) 1 2.85 2 1.3147 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 3.06 2 1.4319 0.935899949 -0.390958784 2.447266353
1 A Vertical(D)&amp;nbsp; 1 3.06 2 0.1533 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 3.06 2 1.3206 0.935899949 -0.390958784 2.447266353
1 A Vertical(D)&amp;nbsp; 1 3.06 2 0.9575 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 3.26 2 0.0014 0.935899949 -0.390958784 2.447266353
1 A Vertical(D)&amp;nbsp; 1 3.26 2 1.6503 0.935899949 -0.390958784 2.447266353
1 A Vertical(D) &amp;nbsp; &amp;nbsp; 1 3.26 2 0.5574 0.935899949 -0.390958784 2.447266353
1 A Vertical(D)&amp;nbsp; 1 3.26 2 0.424 0.935899949 -0.390958784 2.447266353
1 A Horizontal(D) 2 -0.21 1 0.1448 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 -0.21 1 -0.375 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 -0.21 1 0.3902 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 -0.21 1 -0.2554 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 -0.41 1 0.2108 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 -0.41 1 -0.5052 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 -0.41 1 -0.409 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 -0.41 1 -0.8127 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0 &amp;nbsp; &amp;nbsp; 1 0.0268 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0 &amp;nbsp; &amp;nbsp; 1 -0.1181 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0 &amp;nbsp; &amp;nbsp; 1 0.339 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0 &amp;nbsp; &amp;nbsp; 1 -0.2461 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.21 1 -0.289 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.21 1 0.0428 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.21 1 0.3737 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.21 1 0.3882 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.41 1 -0.0451 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.41 1 -0.2725 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.41 1 0.2029 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.41 1 0.4177 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.62 1 0.1691 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.62 1 -0.1687 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.62 1 -1.0771 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.62 1 0.2388 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.83 1 0.3029 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.83 1 0.5051 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.83 1 -0.9407 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 0.83 1 0.3464 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.04 1 0.1285 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.04 1 0.2376 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.04 1 0.5279 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.04 1 -0.3623 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.25 1 -0.0329 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.25 1 0.3425 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.25 1 -0.6584 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.25 1 -0.3581 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.45 1 0.4022 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.45 1 0.3429 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.45 1 0.3076 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.45 1 -0.489 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.66 1 0.3751 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.66 1 0.3222 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.66 1 -0.0473 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.66 1 0.3665 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.87 1 0.4804 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.87 1 0.3097 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.87 1 -0.2533 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 1.87 1 -0.06 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.08 1 0.3615 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.08 1 -1.1145 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.08 1 -0.1673 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.08 1 -0.8939 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.28 1 0.3122 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.28 1 0.6135 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.28 1 -0.7456 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.28 1 0.6849 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.49 1 0.5677 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.49 1 -0.2066 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.49 1 0.0414 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.49 1 -0.5632 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.7 &amp;nbsp; &amp;nbsp; 1 0.5773 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.7 &amp;nbsp; &amp;nbsp; 1 0.5452 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.7 &amp;nbsp; &amp;nbsp; 1 -0.1142 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.7 &amp;nbsp; &amp;nbsp; 1 0.3945 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.9&amp;nbsp; &amp;nbsp; 1 0.6845 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.9 &amp;nbsp; &amp;nbsp; 1 0.5298 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.9 &amp;nbsp; &amp;nbsp; 1 -1.3461 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 2.9 &amp;nbsp; &amp;nbsp; 1 0.2105 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 3.11 1 0.3965 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 3.11 1 0.6605 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 3.11 1 -0.4938 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 3.11 1 0.1051 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 3.32 1 0.3853 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 3.32 1 0.7322 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D) 2 3.32 1 -0.9426 0.04885302 -1.775846127 -0.169060756
1 A Horizontal(D)&amp;nbsp; &amp;nbsp;2 3.32 1 0.0293 0.04885302 -1.775846127 -0.169060756
1 B Accommodat(D) 3 -0.21 1 0.1003 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 -0.21 1 -0.0665 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 -0.21 1 0.3441 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 -0.21 1 0.1783 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 -0.41 1 0.3098 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 -0.41 1 0.3597 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 -0.41 1 0.372 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 -0.41 1 -0.0616 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0 &amp;nbsp; &amp;nbsp; 1 -0.0624 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0 &amp;nbsp; &amp;nbsp; 1 0.0836 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0 &amp;nbsp; &amp;nbsp; 1 -0.1015 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0 &amp;nbsp; &amp;nbsp; 1 0.0816 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.21 1 0.405 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.21 1 -0.0232 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.21 1 0.0284 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.21 1 0.1742 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.41 1 -0.0602 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.41 1 -0.0133 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.41 1 0.2819 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.41 1 0.1425 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.62 1 -0.1619 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.62 1 0.0271 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.62 1 -0.2757 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.62 1 0.238 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.83 1 0.0424 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.83 1 0.0348 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.83 1 0.2973 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 0.83 1 0.0949 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.04 1 0.0922 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.04 1 -0.0785 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.04 1 -0.3258 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.04 1 -0.1451 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.25 1 -0.2052 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.25 1 0.0582 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.25 1 0.0577 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.25 1 0.0193 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.45 1 -0.2301 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.45 1 0.1912 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.45 1 0.292 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.45 1 0.0001 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.66 1 0.2386 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.66 1 0.1388 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.66 1 0.1483 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.66 1 0.034 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.87 1 -0.0221 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.87 1 0.0838 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.87 1 0.369 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 1.87 1 0.2857 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.08 1 -0.1323 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.08 1 0.2017 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.08 1 0.2523 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.08 1 0.0167 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.28 1 0.0078 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.28 1 0.1426 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.28 1 0.3908 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.28 1 0.1036 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.49 1 0.3323 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.49 1 0.1939 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.49 1 -0.2569 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.49 1 0.1658 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.7 &amp;nbsp; &amp;nbsp; 1 -0.0026 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.7 &amp;nbsp; &amp;nbsp; 1 0.4685 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.7 &amp;nbsp; &amp;nbsp; 1 0.0036 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.7&amp;nbsp; &amp;nbsp; 1 0.5123 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.9&amp;nbsp; 1 0.2968 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.9 1 0.3871 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.9 1 0.055 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 2.9 &amp;nbsp; &amp;nbsp; 1 0.0564 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 3.11 1 -0.1342 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 3.11 1 0.1774 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 3.11 1 0.5596 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 3.11 1 0.5958 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 3.32 1 0.444 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 3.32 1 -0.0021 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 3.32 1 0.0103 0.107655911 0.529623822 -0.150723888
1 B Accommodat(D) 3 3.32 1 0.2388 0.107655911 0.529623822 -0.150723888
;
run;&amp;nbsp;

proc sgplot data=example noautolegend;
by paramn param avision trta usubjid;
&amp;nbsp; &amp;nbsp;scatter&amp;nbsp; x=parcat3n y=value / group=trta groupdisplay=cluster clusterwidth=0.5
markerattrs=( size=10)errorbarattrs=(thickness=2);&amp;nbsp;
&amp;nbsp; &amp;nbsp; styleattrs datasymbols=(circle);
&amp;nbsp; &amp;nbsp; yaxis&amp;nbsp; label='Aval (D)' grid&amp;nbsp; values=(-7.25 to 7.25 by .25);
xaxis&amp;nbsp; &amp;nbsp;offsetmax=0.08 fitpolicy=rotate&amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; values=(-0.41 -0.2 0 0.2 0.41 0.61 0.81 1.02 1.22 1.43 1.63 1.83 2.04 2.24 2.44 2.65 2.85 3.06 3.26);&amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; keylegend / title="Treatment" ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;please don't remove this topic. this is not scam&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 20:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883797#M349165</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-07-06T20:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883804#M349166</link>
      <description>&lt;P&gt;Please show us the plots you are getting (use the "Insert Photos" icon to include screen captures in your reply; DO NOT attach files) and explain exactly what is wrong with them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your future benefit, saying things like "I have difficulties getting some graphs rights" or more generally "It doesn't work" without further explanation is never sufficient.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 19:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883804#M349166</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-06T19:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883812#M349167</link>
      <description>Am I missing the question?</description>
      <pubDate>Thu, 06 Jul 2023 19:45:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883812#M349167</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-07-06T19:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883821#M349168</link>
      <description>&lt;P&gt;I'm not able to output the accurate estimates values on the graph. Also, I don't know how to display the slope&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try this code and you will understand the issue. the graph suppose to show the corresponding slope value instead it rad the second raw in the slope for the second graph.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;data _null_;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;set example;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;if _n_ = 1 then call symput('Int', put(intercept, BEST6.));&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;else&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; call symput('Slope', put(slope, BEST6.));&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc sgplot data=example noautolegend;&lt;/DIV&gt;&lt;DIV&gt;by paramn param avision trta usubjid;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;scatter&amp;nbsp; x=parcat3n y=value / group=trta groupdisplay=cluster clusterwidth=0.5&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;markerattrs=( size=10)errorbarattrs=(thickness=2);&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; styleattrs datasymbols=(circle);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; yaxis&amp;nbsp; label='Aval (D)' grid&amp;nbsp; values=(-7.25 to 7.25 by .25);&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;xaxis&amp;nbsp; &amp;nbsp;offsetmax=0.08 fitpolicy=rotate&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; values=(-0.41 -0.2 0 0.2 0.41 0.61 0.81 1.02 1.22 1.43 1.63 1.83 2.04 2.24 2.44 2.65 2.85 3.06 3.26);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; refline x_axis_value / axis=x lineattrs=(color=red thickness=3px&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;pattern=ShortDashDot);&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;inset "Intercept = &amp;amp;Int" "Slope = &amp;amp;Slope" /&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;border title="Parameter Estimates" position=topleft;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; keylegend / title="Treatment" ;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mona12_0-1688674660966.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85617iBF69D92DF2F12109/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mona12_0-1688674660966.png" alt="mona12_0-1688674660966.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Jul 2023 20:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883821#M349168</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-07-06T20:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883826#M349170</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;I'm not able to output the accurate estimates values on the graph.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is stopping you? Accurate in what sense? What numbers do you want to see on this graph?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Also, I don't know how to display the slope&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have displayed the slope. It says Slope = 0.5296&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 20:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883826#M349170</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-06T20:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883833#M349173</link>
      <description>&lt;P&gt;for the first graph the value is correct then for the second graph it displays the same value for the first graph. Something has to do with the macro. it is not reading the right slope value it is reading the second raw in the data which is the value of the first graph.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 20:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883833#M349173</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-07-06T20:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883835#M349174</link>
      <description>&lt;P&gt;Show me the code in which the macro variables are created.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 20:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883835#M349174</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-06T20:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883837#M349175</link>
      <description>it is in my comment above ^^^</description>
      <pubDate>Thu, 06 Jul 2023 20:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883837#M349175</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-07-06T20:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883839#M349176</link>
      <description>&lt;P&gt;You haven't shown me the DO-loop where this will be used.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 20:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883839#M349176</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-06T20:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883845#M349177</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro create_graph(_paramn=, _param=, _avision=, _trta=, _usubjid=);
    data _null_;
        set example (obs=1);
        where paramn=&amp;amp;_paramn. &amp;amp; param="&amp;amp;_param." &amp;amp; avision=&amp;amp;_avision. &amp;amp; trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid.";
        call symput('Int', put(intercept, BEST6.));
        call symput('Slope', put(slope, BEST6.));
    run;

    proc sgplot data=example noautolegend;
        where paramn=&amp;amp;_paramn. &amp;amp; param="&amp;amp;_param." &amp;amp; avision=&amp;amp;_avision. &amp;amp; trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid.";
        scatter x=parcat3n y=value / group=trta groupdisplay=cluster clusterwidth=0.5 
            markerattrs=(size=10)errorbarattrs=(thickness=2);
        styleattrs datasymbols=(circle);
        yaxis label='Aval (D)' grid values=(-7.25 to 7.25 by .25);
        xaxis offsetmax=0.08 fitpolicy=rotate values=(-0.41 -0.2 0 0.2 0.41 0.61 0.81 
            1.02 1.22 1.43 1.63 1.83 2.04 2.24 2.44 2.65 2.85 3.06 3.26);
        refline x_axis_value / axis=x lineattrs=(color=red thickness=3px 
            pattern=ShortDashDot);
        inset "Intercept = &amp;amp;Int" "Slope = &amp;amp;Slope" / border 
            title="Parameter Estimates" position=topleft;
        keylegend / title="Treatment";
    run;

%mend;

data test;
    set example;
    by paramn param avision trta usubjid NOTSORTED;

    if first.usubjid then
        do;
            str=catt('%create_graph(_paramn=', paramn, ", _param=", param, 
                " , _avision=", avision, ", _trta= ", trta, ", _usubjid=", %str(usubjid), 
                ');');
            rc=dosubl(str);
            output;
        end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2023 21:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/883845#M349177</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-07-06T21:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/884040#M349250</link>
      <description>&lt;P&gt;Hi Reeza,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution worked however I still got one more problem when I try to display the slope. It is not showing the correct intercept value not sure what is the issue. this is the figure and the code that I'm trying&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="mona12_0-1688773071256.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85665i1662BA586DB9837C/image-size/large?v=v2&amp;amp;px=999" role="button" title="mona12_0-1688773071256.png" alt="mona12_0-1688773071256.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;%macro create_graph(_paramn=, _param=, _avision=, _trta=, _usubjid=);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; data _null_;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set example (obs=1);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where paramn=&amp;amp;_paramn. &amp;amp; param="&amp;amp;_param." &amp;amp; avision=&amp;amp;_avision. &amp;amp; trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid.";&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; call symput('Int', put(intercept, BEST6.));&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; call symput('Slope', put(slope, BEST6.));&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; run;&lt;/DIV&gt;
&lt;DIV&gt;title " &amp;amp;_param &amp;amp;_avision &amp;amp;_trta &amp;amp;_usubjid";&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; proc sgplot data=example noautolegend;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where paramn=&amp;amp;_paramn. &amp;amp; param="&amp;amp;_param." &amp;amp; avision=&amp;amp;_avision. &amp;amp; trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid.";&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scatter x=parcat3n y=value / group=trta groupdisplay=cluster clusterwidth=0.5&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; markerattrs=(size=10)errorbarattrs=(thickness=2);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; styleattrs datasymbols=(circle);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yaxis label='Aval (D)' grid values=(-7.25 to 7.25 by 0.25);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xaxis offsetmax=0.08 fitpolicy=rotate values=(-0.41 -0.2 0 0.2 0.41 0.61 0.81&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.02 1.22 1.43 1.63 1.83 2.04 2.24 2.44 2.65 2.85 3.06 3.26);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refline x_axis_value / axis=x lineattrs=(color=red thickness=3px&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pattern=ShortDashDot);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inset "Intercept = &amp;amp;Int" "Slope = &amp;amp;Slope" / border title="Parameter Estimates" position=topleft;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; lineparm&amp;nbsp; &amp;nbsp;x=0 y=intercept slope=Slope;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; keylegend / title="Treatment";&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;%mend;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;data test;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; set example;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; by paramn param avision trta usubjid NOTSORTED;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if first.usubjid then&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str=catt('%create_graph(_paramn=', paramn, ", _param=", param,&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; " , _avision=", avision, ", _trta= ", trta, ", _usubjid=", %str(usubjid),&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ');');&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rc=dosubl(str);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 23:38:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/884040#M349250</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-07-07T23:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with macro and do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/884048#M349258</link>
      <description>&lt;P&gt;If the intercept and slope are from a linear regression on the data, then the values of slope and intercept in your original data are not correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=example plots=none;
    by trta notsorted param;
    model value=parcat3n;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jul 2023 10:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-macro-and-do-loops/m-p/884048#M349258</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-08T10:37:48Z</dc:date>
    </item>
  </channel>
</rss>

