<?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 SAS/Graph in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153182#M40305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi member,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to plot a curve to analyze trend during the years 2005 to 2008 for a categorical variable. I have three datasets for years 2005,2006 and 2008 respectively. So first i combined them to create the super set. I want to plot variables (year vs died) to observe mortality rate. But the values the variable died has are 0,1 and missing data. With gchart i was able to get a block view but i want to plot as a curve or bar for a particular value say died=1 for all three years ?&amp;nbsp; Please can you help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=data-name;&lt;/P&gt;&lt;P&gt;block year/group=died discrete subgroup=year;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Mar 2014 23:29:23 GMT</pubDate>
    <dc:creator>shanthab</dc:creator>
    <dc:date>2014-03-22T23:29:23Z</dc:date>
    <item>
      <title>SAS/Graph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153182#M40305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi member,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to plot a curve to analyze trend during the years 2005 to 2008 for a categorical variable. I have three datasets for years 2005,2006 and 2008 respectively. So first i combined them to create the super set. I want to plot variables (year vs died) to observe mortality rate. But the values the variable died has are 0,1 and missing data. With gchart i was able to get a block view but i want to plot as a curve or bar for a particular value say died=1 for all three years ?&amp;nbsp; Please can you help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=data-name;&lt;/P&gt;&lt;P&gt;block year/group=died discrete subgroup=year;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2014 23:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153182#M40305</guid>
      <dc:creator>shanthab</dc:creator>
      <dc:date>2014-03-22T23:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/Graph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153183#M40306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Have you looked at PROC GPLOT instead of PROC GCHART? For example, this documentation example shows how to plot 3 variables:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/graphref/66521/HTML/default/viewer.htm#n0jp22mw3v2i2pn17i072bl2bo3d.htm" title="http://support.sas.com/documentation/cdl/en/graphref/66521/HTML/default/viewer.htm#n0jp22mw3v2i2pn17i072bl2bo3d.htm"&gt;SAS/GRAPH(R) 9.4: Reference, Second Edition&lt;/A&gt; (&lt;A id="n0jp22mw3v2i2pn17i072bl2bo3d"&gt;&lt;/A&gt;Example 8: Plotting Three Variables). The results are show on the documentation page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2014 23:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153183#M40306</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-03-22T23:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/Graph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153184#M40307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply. I did try using plot. But in my case since the x and y axis variables have discrete data values (died as 0 and 1) and (year as 2005,2006 and 2008) only, the graph will build upon based on _FREQ_ value, so i am unable to use plot statement with sumvar option. Please correct me if my understanding is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shantha B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2014 02:57:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153184#M40307</guid>
      <dc:creator>shanthab</dc:creator>
      <dc:date>2014-03-23T02:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/Graph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153185#M40308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am not sure what you mean by not being able to use the SUMVAR option. Usually, with PROC GPLOT, you might need to "pre-summarize" your data using PROC FREQ or PROC MEANS. I would not put your DIED variable on the Y axis. I would put DIED as the value of the "group"...so I'd have one plot line for DIED=1 and a second line in a different color for DIED=0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I would probably use PROC FREQ to get a variable called COUNT for each YEAR/DIED value and then have a plot with one line for each unique value of DIED. (I would probably drop the missing.) I made some FAKE data using SASHELP.HEART, which already has a STATUS variable for ALIVE or DEAD, which is similar to your DIED variable. It always helps to have code that people can run. Since SASHELP.HEART was added to the SASHELP data in SAS 9.2, you should be able to run the code below.&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods _all_ close;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** make some fake data with more obs for;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** 2006 and 2008, so line is interesting;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** STATUS var is character values are Alive or Dead;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data heart (keep=year status);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; set sashelp.heart;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; year = 2005;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; output;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; year = 2006;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; output; output;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; year = 2008;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; output; output; output;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** summarize data for graph procedure;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc freq data=heart;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;tables year*status/list out=work.frq;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=work.frq;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title 'What does Data Look Like?';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** now use output from PROC FREQ in plot procedures;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;options nodate number pageno=1;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** create report with page for every example;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing close;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods pdf file='c:\temp\plot_statuss.pdf' nogtitle notoc;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title 'SAS/GRAPH GPLOT';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** SAS/GRAPH example;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;symbol1 interpol=join&amp;nbsp; value=dot ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;axis2 label=("Count" )&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order=(0 to 10000 by 1000);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc gplot data=work.frq;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;plot count*year=status / vaxis=axis2;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;quit;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** ODS GRAPHICS example;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title 'ODS GRAPHICS SGPLOT';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgplot data=work.frq;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; series x=year y=count/group=status datalabel markers;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; xaxis values=(2005 to 2008 by 1);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; yaxis values=( 0 to 10000 by 1000);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title 'PROC SGPANEL';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgpanel data=work.frq;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; panelby status;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; series x=year y=count/datalabel markers;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; colaxis values=(2005 to 2008 by 1);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; rowaxis values=( 0 to 10000 by 1000);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods pdf close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2014 16:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153185#M40308</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-03-23T16:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/Graph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153186#M40309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was missing on the pre-summarized data. So i created the data set with count for each level of variable 'died' and then used that as input to sgpanel to plot the graph.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**sorting at two levels --&amp;gt; year &amp;amp; died;&lt;/P&gt;&lt;P&gt;proc sort data=work.bcdata out=work.bcdata_year;&lt;/P&gt;&lt;P&gt;by year died;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**pre-summarizing based on 'died';&lt;/P&gt;&lt;P&gt;data work.bc_died;&lt;/P&gt;&lt;P&gt;set work.bcdata_year (keep=died year);&lt;/P&gt;&lt;P&gt;by year died;&lt;/P&gt;&lt;P&gt;if first.died then count=0;&lt;/P&gt;&lt;P&gt;count+1;&lt;/P&gt;&lt;P&gt;if last.died then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**ODS graph;&lt;/P&gt;&lt;P&gt;proc sgpanel data=work.bc_died;&lt;/P&gt;&lt;P&gt;panelby died;&lt;/P&gt;&lt;P&gt;series x=year y=count/datalabel markers;&lt;/P&gt;&lt;P&gt;colaxis values=(2005 to 2008 by 1);&lt;/P&gt;&lt;P&gt;rowaxis values=(0 to 20000 by 5000);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your suggestion of PROC FREQ to eliminate the missing sounds apt. Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shantha B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2014 21:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Graph/m-p/153186#M40309</guid>
      <dc:creator>shanthab</dc:creator>
      <dc:date>2014-03-23T21:27:45Z</dc:date>
    </item>
  </channel>
</rss>

