<?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: SAS Proc Reg plots overlay problem in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569479#M28017</link>
    <description>&lt;P&gt;Perfect, thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2019 15:05:43 GMT</pubDate>
    <dc:creator>BDORR</dc:creator>
    <dc:date>2019-06-27T15:05:43Z</dc:date>
    <item>
      <title>SAS Proc Reg plots overlay problem</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569204#M28007</link>
      <description>&lt;P&gt;Hey Folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running a SAS Proc Reg procedure and producing prediction plots using the Plots syntax. I have a control and 3 treatment levels that I would like to overlay each regression and their respective CLM CLI. I can get the plots separately fine but when I use overlay it builds&amp;nbsp; CLM CLI around all the regression lines not each individually. How can I correct this?&amp;nbsp; Pgm below, plots attached. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=MeanTotTRlat; by treatment;&lt;/P&gt;
&lt;P&gt;proc reg data=MeanTotTRlat plots=predictions (x=LatR );&lt;BR /&gt;var LatR2; &lt;BR /&gt;model TotTR = LatR LatR2;by treatment;&lt;BR /&gt;plot overlay;&lt;BR /&gt;run;quit;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 18:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569204#M28007</guid>
      <dc:creator>BDORR</dc:creator>
      <dc:date>2019-06-26T18:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc Reg plots overlay problem</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569408#M28008</link>
      <description>&lt;P&gt;A few thoughts:&lt;/P&gt;
&lt;P&gt;1. &lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_odsgraph_toc.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en" target="_self"&gt;SAS introduced ODS statistical graphics&lt;/A&gt; way back in version 8, so you should upgrade to ODS. The newer graphs have many advantages over the older graphs.&lt;/P&gt;
&lt;P&gt;2. There is a &lt;A href="https://blogs.sas.com/content/iml/2018/02/14/difference-class-and-by-statements-sas.html" target="_self"&gt;difference between BY-group analysis by treatment and using treatment as a CLASS variable&lt;/A&gt;. If you put Treatment on a&amp;nbsp; CLASS statement, the overlay will happen automatically. As a bonus, you can compare the treatment effects in the statistical output.&lt;/P&gt;
&lt;P&gt;3. You can switch from PROC REG to PROC GLM to solve two problems: (A) PROC GLM enables you to use the quadratic variable LatR*LatR directly without having to create it in a DATA step, and (B) PROC GLM supports the CLASS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Putting these all together, the following statements provide what you want&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;
proc glm data=MeanTotTRlat plots=FitPlot;
class treatment;
model TotTR = latR LatR*LatR treatment;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2019 12:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569408#M28008</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-06-27T12:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc Reg plots overlay problem</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569434#M28009</link>
      <description>Rick,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply. A more elegant solution for sure for the issue I had (your code below). I get all four regression lines on my graph. However, I still don't get the CLM on my regression lines. Even when I use the Plots=INTPLOT(CLM) option.&lt;BR /&gt;&lt;BR /&gt;Any Suggestions?&lt;BR /&gt;&lt;BR /&gt;proc glm data=MeanTotTRlat plots=fitplot;&lt;BR /&gt;class treatment;&lt;BR /&gt;model TotTR = latR LatR*LatR treatment;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jun 2019 14:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569434#M28009</guid>
      <dc:creator>BDORR</dc:creator>
      <dc:date>2019-06-27T14:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc Reg plots overlay problem</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569474#M28016</link>
      <description>&lt;P&gt;I apologize for not answering that portion of your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, a confession: I simplified the call by using PLOTS=FITPLOT, which is sort of a generic specification. The actual name of the plot you are creating is the ANCOVAPLOT, as stated in the &lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glm_syntax01.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en#statug.glm.cglmfplots" target="_self"&gt;documentation for the PLOTS= option&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get only CLM, use PLOTS=ANCOVAPLOT(CLM)&lt;/P&gt;
&lt;P&gt;To get only CLI, use PLOTS=ANCOVAPLOT(CLI)&lt;/P&gt;
&lt;P&gt;Because you want both, you can use&lt;/P&gt;
&lt;P&gt;proc glm data=MeanTotTRlat plots=ancovaplot(limits);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Be aware that the four lines with confidence bands might overlap and the graph might look crowded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 15:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569474#M28016</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-06-27T15:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc Reg plots overlay problem</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569479#M28017</link>
      <description>&lt;P&gt;Perfect, thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 15:05:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Proc-Reg-plots-overlay-problem/m-p/569479#M28017</guid>
      <dc:creator>BDORR</dc:creator>
      <dc:date>2019-06-27T15:05:43Z</dc:date>
    </item>
  </channel>
</rss>

