<?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: Plotting Frequencies by date in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595135#M15732</link>
    <description>&lt;P&gt;Do you have an actual SAS date value? Use the desired format in any of the summarization procedures such as Proc Freq&amp;nbsp; with that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not that for data coded 1/0 the MEAN of the variable for a group is the percentage of 1's.&lt;/P&gt;
&lt;P&gt;If not that likely would be the first step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What TYPE of graph do you want? Bar, scatter, needle, series or what? And by "multiple variables" do mean to place all of them on a single graph or what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is one way to do bar chart:&lt;/P&gt;
&lt;PRE&gt;data example;
   do date= '01JAN2019'd to '31DEC2019'd;
      do record= 1 to rand('integer',1,50);
         value = (rand('uniform') ge .3);
         output;
      end;
   end;
   format date monyy.;
run;

proc sgplot data=example;
   vbar date /response=value stat=mean;
   format value percent4.;
   yaxis values=(0 to 1 by .1);
run;
   &lt;/PRE&gt;</description>
    <pubDate>Wed, 09 Oct 2019 17:14:12 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-10-09T17:14:12Z</dc:date>
    <item>
      <title>Plotting Frequencies by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/594916#M15707</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I had a question I was hoping I can get some help with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to create a plot of multiple variables by month using SAS.&amp;nbsp;&lt;BR /&gt;I'm not sure how to create it so that my x-axis is in monyy. and my Y axis is percentage complete (0-100).&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be plotted is the percentage of (1)'s for each variable of interest by month, as the data is binary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight in how to do this would be much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 22:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/594916#M15707</guid>
      <dc:creator>aowusudommey</dc:creator>
      <dc:date>2019-10-08T22:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting Frequencies by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/594936#M15708</link>
      <description>PROC FREQ + FORMAT to calculate the percentages by default by dates.&lt;BR /&gt;PROC SGPLOT to create the graph.</description>
      <pubDate>Wed, 09 Oct 2019 03:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/594936#M15708</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-09T03:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting Frequencies by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595135#M15732</link>
      <description>&lt;P&gt;Do you have an actual SAS date value? Use the desired format in any of the summarization procedures such as Proc Freq&amp;nbsp; with that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not that for data coded 1/0 the MEAN of the variable for a group is the percentage of 1's.&lt;/P&gt;
&lt;P&gt;If not that likely would be the first step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What TYPE of graph do you want? Bar, scatter, needle, series or what? And by "multiple variables" do mean to place all of them on a single graph or what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is one way to do bar chart:&lt;/P&gt;
&lt;PRE&gt;data example;
   do date= '01JAN2019'd to '31DEC2019'd;
      do record= 1 to rand('integer',1,50);
         value = (rand('uniform') ge .3);
         output;
      end;
   end;
   format date monyy.;
run;

proc sgplot data=example;
   vbar date /response=value stat=mean;
   format value percent4.;
   yaxis values=(0 to 1 by .1);
run;
   &lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2019 17:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595135#M15732</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-09T17:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting Frequencies by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595196#M15755</link>
      <description>&lt;P&gt;I do have a SAS date value that is currently in monyy, and I have already conducted a proc freq on each variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally I would have a series graph with multiple variables on one graph. The y-axis would be percentage and the x-axis would be months. Similar to the attached image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="journal.pone.0184200.g002.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33031i4AE3972A1EA459C8/image-size/large?v=v2&amp;amp;px=999" role="button" title="journal.pone.0184200.g002.PNG" alt="journal.pone.0184200.g002.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 20:47:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595196#M15755</guid>
      <dc:creator>aowusudommey</dc:creator>
      <dc:date>2019-10-09T20:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting Frequencies by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595197#M15756</link>
      <description>Add a GROUP =  on the SERIES statement to have a line graph. The documentation has many examples.&lt;BR /&gt;&lt;BR /&gt;Find the closest one to what you want and start with that. Each sample has the full code:&lt;BR /&gt;&lt;A href="http://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html" target="_blank"&gt;http://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html&lt;/A&gt;</description>
      <pubDate>Wed, 09 Oct 2019 20:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595197#M15756</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-09T20:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting Frequencies by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595207#M15759</link>
      <description>&lt;P&gt;Data, data, data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have your percentages already or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sgplot will plot multiple variables if they share a common x axis. Dummy code of an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc Sgplot data=have;
   series x=date y=percent1;
   series x=date y=percent2;
   series x=date y=percent3;
run;&lt;/PRE&gt;
&lt;P&gt;You would want to sort the data by date, use&amp;nbsp;nice labels for your percentage variables, use the Yaxis statement to set the label and other appearance items and possibly get into a KEYLEGEND statement to control location of the legend.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 23:07:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Plotting-Frequencies-by-date/m-p/595207#M15759</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-09T23:07:31Z</dc:date>
    </item>
  </channel>
</rss>

