<?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: Generating a graph of comparative responses in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116932#M4449</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have time to give a complete example, but let me outline an approach that might work. The basic idea is to move from "wide" format to "long" format.&amp;nbsp; You want all of the response variables to be names VALUE and you want to create a new ID variable called VARIABLE that you can put on the PANELBY statement in order to build the vertical strata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the environmental variables are in different data sets, concatenate them together and create a new ID variable called VARIABLE.&lt;/P&gt;&lt;P&gt;For example, you might do something like this (code probably contains syntax errors):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data All;&lt;/P&gt;&lt;P&gt;set EvElev_dist(rename=(AveElev=Value) in=In1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data2(rename=(Var2=Value) in=In2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...;&lt;/P&gt;&lt;P&gt;if in1 then Variable="Elevation";&lt;/P&gt;&lt;P&gt;else if in2 then Variable="Var2";&lt;/P&gt;&lt;P&gt;else ...;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;sgpanel&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=All;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;panelby&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp; pertrans Variable&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;; /* VARIABLE is new PANELBY var */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;scatter&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;x&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=dist &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;y&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=Value&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* VALUE is the response for all envornmental variables */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Apr 2013 16:56:40 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2013-04-23T16:56:40Z</dc:date>
    <item>
      <title>Generating a graph of comparative responses</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116931#M4448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sas users,&lt;/P&gt;&lt;P&gt;I would appreciate any advice you could give on generating a particular graph.&amp;nbsp; &lt;/P&gt;&lt;P&gt;To summarize my data structure I have different environmental measurements taken at 5 sampling units at different distances from a forest edge (1, 5, 10 30 and 60 meters).&amp;nbsp; This sampling procedure was repeated at 4 edges (N1, N2, S1 and S2) at 3 sites.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each site, I want to summarize the changes in environmental variables that occur along each edge to interior transect.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I generated one “band” of this graph using sgpanel, with the following code, for the environmental measurement “avg elev”.&amp;nbsp; &lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sgpanel&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=EvElev_dist;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;panelby&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; pertrans / &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;LAYOUT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;columnlattice&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;UNISCALE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;COLUMN&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;ONEPANEL&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;scatter&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;x&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=dist &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;y&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=avgelev&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;colaxis&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;label&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"Distance from edge"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;rowaxis&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;label&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"Relative elevation (cm), n=2"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;; &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;which produced the following graph:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;IMG alt="graph1.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/3459_graph1.jpg" width="450" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Each column (n1, n2, etc) is a different edge specified by the variable “pertrans”, and the variable on the x axis of each graph is the distance from the edge (1, 5, 10, 30 or 60m).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;WHAT I NEED is to make a graph where I have the response of different environmental variables (besides elevation) stacked one on top of another.&amp;nbsp; Essentially, I want the exact format shown in the previous graph, for each different environmental variable.&amp;nbsp; Then I want them stacked in a panel so that I can compare how different envirionmental variables change over each edge-interior transect.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Any advice you could offer would be much appreciated.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Meghan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 16:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116931#M4448</guid>
      <dc:creator>mrlang02</dc:creator>
      <dc:date>2013-04-23T16:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a graph of comparative responses</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116932#M4449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have time to give a complete example, but let me outline an approach that might work. The basic idea is to move from "wide" format to "long" format.&amp;nbsp; You want all of the response variables to be names VALUE and you want to create a new ID variable called VARIABLE that you can put on the PANELBY statement in order to build the vertical strata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the environmental variables are in different data sets, concatenate them together and create a new ID variable called VARIABLE.&lt;/P&gt;&lt;P&gt;For example, you might do something like this (code probably contains syntax errors):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data All;&lt;/P&gt;&lt;P&gt;set EvElev_dist(rename=(AveElev=Value) in=In1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data2(rename=(Var2=Value) in=In2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...;&lt;/P&gt;&lt;P&gt;if in1 then Variable="Elevation";&lt;/P&gt;&lt;P&gt;else if in2 then Variable="Var2";&lt;/P&gt;&lt;P&gt;else ...;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;sgpanel&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=All;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;panelby&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp; pertrans Variable&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;; /* VARIABLE is new PANELBY var */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;scatter&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;x&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=dist &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;y&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=Value&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* VALUE is the response for all envornmental variables */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 16:56:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116932#M4449</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-04-23T16:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a graph of comparative responses</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116933#M4450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rick, sounds like that will work. I appreciate it!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 18:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116933#M4450</guid>
      <dc:creator>mrlang02</dc:creator>
      <dc:date>2013-04-23T18:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a graph of comparative responses</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116934#M4451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, one last question.&amp;nbsp; I successfully generated that graph, but now am wondering if there is a way, within sgpanel, to scale the values of each row of graphs to match the range of values for that data.&amp;nbsp; For instance, although all of the variables values are now stored in one field "value", the range for each type of measurement is vastly different.&amp;nbsp; For instance some environmental measurements range 0-1, while others range 0-100.&amp;nbsp; I am wondering if there is an "easy" way to make sgpanel automatically scale the graph axis to reflect the range of the variables it is graphing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Meghan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 18:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116934#M4451</guid>
      <dc:creator>mrlang02</dc:creator>
      <dc:date>2013-04-23T18:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a graph of comparative responses</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116935#M4452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind, I figured it out.&amp;nbsp; The answer was to specify uniscale=column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgpanel data=ALLenv_plots;&lt;/P&gt;&lt;P&gt;by site;&lt;/P&gt;&lt;P&gt;panelby&amp;nbsp; pertrans var/ LAYOUT=lattice onepanel uniscale=column;&lt;/P&gt;&lt;P&gt;scatter x=partrans y=value&amp;nbsp; ; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 18:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Generating-a-graph-of-comparative-responses/m-p/116935#M4452</guid>
      <dc:creator>mrlang02</dc:creator>
      <dc:date>2013-04-23T18:27:18Z</dc:date>
    </item>
  </channel>
</rss>

