<?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: Using sgplot to plot summarized data produces an extra line? in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-sgplot-to-plot-summarized-data-produces-an-extra-line/m-p/778061#M15577</link>
    <description>You run two PROC MEANS back to back with different CLASS statements and the same output name. Only the last data set remains the first isn't used anywhere. Is that what you're trying to do?&lt;BR /&gt;&lt;BR /&gt;If you examine the output from the PROC MEANS in the MEANOUT data set you should notice that there's a variable in there called TYPE. When you specify a CLASS variable SAS summarizes it at all possible levels, so for two variables you end up with a three different type of summaries, the overall total (TYPE=0), overall for each variable SEQUENCE level overall, PERIOD level (with TYPE=1) and then for each Period*SEQUENCE interaction as well. &lt;BR /&gt;&lt;BR /&gt;You can switch to BY instead of CLASS to avoid this or add the NWAY option to your PROC MEANS to sort this out.&lt;BR /&gt;&lt;BR /&gt;proc means data=a NWAY N mean stderr stddev lclm uclm NDEC=2 alpha=.05;&lt;BR /&gt;   class sequence period;&lt;BR /&gt;   var result;&lt;BR /&gt;   output out=MeanOut mean=Mean;&lt;BR /&gt;run;</description>
    <pubDate>Tue, 02 Nov 2021 23:04:43 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-11-02T23:04:43Z</dc:date>
    <item>
      <title>Using sgplot to plot summarized data produces an extra line?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-sgplot-to-plot-summarized-data-produces-an-extra-line/m-p/778054#M15576</link>
      <description>&lt;P&gt;It looks like sequence means 1 and 2 are being plotted as well as&amp;nbsp; responseMeans * Period = sequence. How do I remove that dotted line and create a legend inside the plot?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input subject sequence $ period regimen $ result;
cards;
1  AB  1  A  15
1  AB  2  B  10
2  AB  1  A  14
2  AB  2  B  11
6  BA  1  B  11
6  BA  2  A  15
7  BA  1  B  10
7  BA  2  A  14
;				

proc means data=a N mean stderr stddev lclm uclm NDEC=2 alpha=.05;
   class sequence;
   var result;
   output out=MeanOut mean=Mean;
run;

proc means data=a N mean stderr stddev lclm uclm NDEC=2 alpha=.05;
   class sequence period;
   var result;
   output out=MeanOut mean=Mean;
run;

title2 "Presummarized Data";
proc sgplot data=Meanout;
series  x=period y=Mean / group=sequence;
scatter x=period y=Mean / group=sequence;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 23:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-sgplot-to-plot-summarized-data-produces-an-extra-line/m-p/778054#M15576</guid>
      <dc:creator>MaryA_Marion</dc:creator>
      <dc:date>2021-11-02T23:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using sgplot to plot summarized data produces an extra line?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-sgplot-to-plot-summarized-data-produces-an-extra-line/m-p/778061#M15577</link>
      <description>You run two PROC MEANS back to back with different CLASS statements and the same output name. Only the last data set remains the first isn't used anywhere. Is that what you're trying to do?&lt;BR /&gt;&lt;BR /&gt;If you examine the output from the PROC MEANS in the MEANOUT data set you should notice that there's a variable in there called TYPE. When you specify a CLASS variable SAS summarizes it at all possible levels, so for two variables you end up with a three different type of summaries, the overall total (TYPE=0), overall for each variable SEQUENCE level overall, PERIOD level (with TYPE=1) and then for each Period*SEQUENCE interaction as well. &lt;BR /&gt;&lt;BR /&gt;You can switch to BY instead of CLASS to avoid this or add the NWAY option to your PROC MEANS to sort this out.&lt;BR /&gt;&lt;BR /&gt;proc means data=a NWAY N mean stderr stddev lclm uclm NDEC=2 alpha=.05;&lt;BR /&gt;   class sequence period;&lt;BR /&gt;   var result;&lt;BR /&gt;   output out=MeanOut mean=Mean;&lt;BR /&gt;run;</description>
      <pubDate>Tue, 02 Nov 2021 23:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-sgplot-to-plot-summarized-data-produces-an-extra-line/m-p/778061#M15577</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-02T23:04:43Z</dc:date>
    </item>
  </channel>
</rss>

