<?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: need help with a panel of graphs in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699234#M33726</link>
    <description>&lt;P&gt;Dear Draycut,&lt;/P&gt;&lt;P&gt;Nice SAS coding and a beautiful output.&lt;/P&gt;&lt;P&gt;It is just what I need.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marcel&lt;/P&gt;</description>
    <pubDate>Mon, 16 Nov 2020 17:13:16 GMT</pubDate>
    <dc:creator>marcel</dc:creator>
    <dc:date>2020-11-16T17:13:16Z</dc:date>
    <item>
      <title>need help with a panel of graphs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/698991#M33718</link>
      <description>&lt;P&gt;Hello SAS community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if there is a way to create a panel of graphs with n-columns and m-rows, with a common x-axis. I also want to add the slope of the regression lines. I expand below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods graphics / reset height=7.5in width=8.925in;&lt;BR /&gt;proc sgscatter data=data;&lt;BR /&gt;plot Y1*X Y2*X Y3*X Y4*X Y5*X Y6*X Y7*X Y8*X Y9*X Y10*X Y11*X&amp;nbsp; Y12*X&amp;nbsp; /&amp;nbsp; group=tto reg rows=4 columns=3 ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;and I obtained the panel below (let's call it Panel A):&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="to_sas_communities.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51691i9F7F53345EF4AE5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="to_sas_communities.png" alt="to_sas_communities.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I would like to have the output panel to look like the one I show next (I edited Panel A by using mspaint) (let's call it Panel B):&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="to_sas_communities_desired.jpg" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51692i26EFE484DF054A61/image-size/large?v=v2&amp;amp;px=999" role="button" title="to_sas_communities_desired.jpg" alt="to_sas_communities_desired.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Panel B saves space. Also, is there any way to add the slopes for the regression lines per TTO in&amp;nbsp; Panel B (for example, at the bottom right corner of each graph)?&lt;BR /&gt;&lt;BR /&gt;Thank you for any suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marcel&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 19:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/698991#M33718</guid>
      <dc:creator>marcel</dc:creator>
      <dc:date>2020-11-15T19:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a panel of graphs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699002#M33719</link>
      <description>&lt;P&gt;You can use Proc SGPanel and do something like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the slopes, you can edit the code a bit from the blog post&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2013/02/27/slope-of-a-regression-line.html" target="_self"&gt;How to use PROC SGPLOT to display the slope and intercept of a regression line&lt;/A&gt; and use the Inset Statement in Proc SGPanel.&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;data have;
   do group = 1 to 12;
      do _N_ = 1 to 100;
         tto = (rand('uniform') &amp;gt; .5);
         x = rand('integer', 30, 120);
         y = rand('integer', 0, 1500);
         output;
      end;
   end;
run;

proc sgpanel data=have;
  panelby group / rows=4 columns=3;
  reg x=x y=y / group=tto;
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>Sun, 15 Nov 2020 21:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699002#M33719</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-15T21:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a panel of graphs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699084#M33720</link>
      <description>&lt;P&gt;Here is some code to get you started. Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   do group = 1 to 12;
      do _N_ = 1 to 100;
         tto = (rand('uniform') &amp;gt; .5);
         x = rand('uniform') * 120;
         y = rand('uniform') * 120 + 2;
         output;
      end;
   end;
run;

proc sort data=have;
   by group tto;
run;

ods graphics off;
proc reg data=have;
   model y = x;
   by group tto;
   ods output ParameterEstimates=PE(where=(Variable = 'x'));
run;

data help;
   length est $ 200;
   do until (last.group);
      set PE;
      by group;
      est = catx('', est, 'tto', tto, ': ', put(Estimate, best5.));
   end;
run;

data plot;
   merge have help;
   by group;
run;

ods graphics on / width=15in;
ods graphics on / height=20in;
proc sgpanel data=plot;
  panelby group / columns=3 rows=4;
  reg x=x y=y / group=tto;
  inset est / position=se nolabel;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Nov 2020 10:15:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699084#M33720</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-16T10:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a panel of graphs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699234#M33726</link>
      <description>&lt;P&gt;Dear Draycut,&lt;/P&gt;&lt;P&gt;Nice SAS coding and a beautiful output.&lt;/P&gt;&lt;P&gt;It is just what I need.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marcel&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 17:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699234#M33726</guid>
      <dc:creator>marcel</dc:creator>
      <dc:date>2020-11-16T17:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a panel of graphs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699301#M33727</link>
      <description>&lt;P&gt;Glad to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 20:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/need-help-with-a-panel-of-graphs/m-p/699301#M33727</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-16T20:42:00Z</dc:date>
    </item>
  </channel>
</rss>

