<?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 Problem regarding proc sgplot in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732382#M228222</link>
    <description>&lt;DIV class="Page-container"&gt;&lt;DIV class="Page PageComponent"&gt;&lt;DIV class="Draw Draw--not-drawing Draw--selection"&gt;&lt;DIV class="TextLayer-container"&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;Hello! I have a problem related to proc sgplot. I have tried doing some code, but it didn't seem to work. Could someone help with this? Thanks in advance!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;Here's the instructions of the problem:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="Page-container"&gt;&lt;DIV class="Page PageComponent"&gt;&lt;DIV class="Draw Draw--not-drawing Draw--selection"&gt;&lt;DIV class="TextLayer-container"&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;4. Use PROC SGPLOT to&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; a.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;Create a time series plot with smooth lines, where the time component (DATE) is the x-axis and the&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp;percent (StLouis) is the y-axis.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; &amp;nbsp; i. Add a blue line with line thickness equaled to 2.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; &amp;nbsp; ii.&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;Add a legend label called ‘Economic Conditions Index for St. Louis, MO-IL (MSA)’.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; b.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;Create a time series plot with smooth lines, where the time component (DATE) is the x-axis and the&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp;percent (RealGDP) is the y-axis.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; &amp;nbsp; i. Add a red line with line thickness equaled to 2&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; &amp;nbsp; ii. Add a legend label called ‘Real Gross Domestic Product’.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;Here's what I have so far:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import 
	out = StLouis 
    datafile = '/folders/myfolders/sasuser.v94/all_data/extdata/StLouisData.csv'
    dbms = CSV replace;
    getnames = YES;
run;
proc print data=StLouis;
run; 

proc sort data=StLouis;
  by Date StLouis;
run;

ods pdf style=analysis file="StLouis.pdf";
proc sgplot data=StLouis;
  loess x=Date y=StLouis / smooth nomarkers lineattrs=(color=blue thickness=2) legendlabel="Economic Conditons Index for St. Louis, MO-IL (MSA)";
run;

proc sort data=StLouis;
  by Date RealGDP;
run;

proc sgplot data=StLouis;
  loess x=Date y=RealGDP / smooth lineattrs=(color=red thickness=2) legendlabel="Real Gross Domestric Product";
run;
ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 09 Apr 2021 15:41:49 GMT</pubDate>
    <dc:creator>emmad511</dc:creator>
    <dc:date>2021-04-09T15:41:49Z</dc:date>
    <item>
      <title>Problem regarding proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732382#M228222</link>
      <description>&lt;DIV class="Page-container"&gt;&lt;DIV class="Page PageComponent"&gt;&lt;DIV class="Draw Draw--not-drawing Draw--selection"&gt;&lt;DIV class="TextLayer-container"&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;Hello! I have a problem related to proc sgplot. I have tried doing some code, but it didn't seem to work. Could someone help with this? Thanks in advance!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;Here's the instructions of the problem:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="Page-container"&gt;&lt;DIV class="Page PageComponent"&gt;&lt;DIV class="Draw Draw--not-drawing Draw--selection"&gt;&lt;DIV class="TextLayer-container"&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;4. Use PROC SGPLOT to&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; a.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;Create a time series plot with smooth lines, where the time component (DATE) is the x-axis and the&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp;percent (StLouis) is the y-axis.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; &amp;nbsp; i. Add a blue line with line thickness equaled to 2.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; &amp;nbsp; ii.&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;Add a legend label called ‘Economic Conditions Index for St. Louis, MO-IL (MSA)’.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; b.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;Create a time series plot with smooth lines, where the time component (DATE) is the x-axis and the&lt;/SPAN&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp;percent (RealGDP) is the y-axis.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; &amp;nbsp; i. Add a red line with line thickness equaled to 2&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;&amp;nbsp; &amp;nbsp; ii. Add a legend label called ‘Real Gross Domestic Product’.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;SPAN class="textLayer--absolute"&gt;Here's what I have so far:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="textLayer"&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import 
	out = StLouis 
    datafile = '/folders/myfolders/sasuser.v94/all_data/extdata/StLouisData.csv'
    dbms = CSV replace;
    getnames = YES;
run;
proc print data=StLouis;
run; 

proc sort data=StLouis;
  by Date StLouis;
run;

ods pdf style=analysis file="StLouis.pdf";
proc sgplot data=StLouis;
  loess x=Date y=StLouis / smooth nomarkers lineattrs=(color=blue thickness=2) legendlabel="Economic Conditons Index for St. Louis, MO-IL (MSA)";
run;

proc sort data=StLouis;
  by Date RealGDP;
run;

proc sgplot data=StLouis;
  loess x=Date y=RealGDP / smooth lineattrs=(color=red thickness=2) legendlabel="Real Gross Domestric Product";
run;
ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Apr 2021 15:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732382#M228222</guid>
      <dc:creator>emmad511</dc:creator>
      <dc:date>2021-04-09T15:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem regarding proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732395#M228224</link>
      <description>&lt;P&gt;Specify an appropriate value for smooth.&lt;/P&gt;
&lt;P&gt;smooth -&amp;gt; smooth=n&lt;/P&gt;
&lt;P&gt;(Or you can remove smooth and sgplot will work.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=grstatproc&amp;amp;docsetTarget=n0j1n6w6psxa44n12vw6vh4qpl5y.htm&amp;amp;locale=en" target="_self"&gt;SGPLOT Procedure / LOESS Statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-04-09_13h38_06.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57182iC01BCDF133F743C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2021-04-09_13h38_06.png" alt="2021-04-09_13h38_06.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 04:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732395#M228224</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-04-09T04:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem regarding proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732438#M228235</link>
      <description>&lt;P&gt;Surely you are supposed to do your homework yourself?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 09:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732438#M228235</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-04-09T09:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem regarding proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732526#M228258</link>
      <description>&lt;P&gt;It worked out! Thank you for your help:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;update: I didn't mean to select this reply as the correct answer... Since I don't know how to change it, I'll post the code I have right now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Options papersize=(9in 3in);
ods pdf style=analysis file="/folders/myfolders/sasuser.v94/all_data/extdata/Overall Economy Activity.pdf";
proc sgplot data=StLouis;
  loess x=Date y=StLouis / smooth=10 lineattrs=(color=blue thickness=2) legendlabel="Economic Conditons Index for St. Louis, MO-IL (MSA)";
  loess x=Date y=RealGDP / smooth=5 lineattrs=(color=red thickness=2) legendlabel="Real Gross Domestric Product";;
  keylegend / location=outside position=bottomleft VALUEATTRS=(Size=8);
run;
ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 15:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732526#M228258</guid>
      <dc:creator>emmad511</dc:creator>
      <dc:date>2021-04-09T15:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem regarding proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732529#M228259</link>
      <description>&lt;P&gt;Surely thanks for bumping tho^^&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 15:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-proc-sgplot/m-p/732529#M228259</guid>
      <dc:creator>emmad511</dc:creator>
      <dc:date>2021-04-09T15:38:45Z</dc:date>
    </item>
  </channel>
</rss>

