<?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: How do we change order of a categorical variable for sgpanel? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413172#M14183</link>
    <description>&lt;P&gt;Attach your sample (non-confidential) data so we can run the program to see what is going on.&amp;nbsp; It is hard to&amp;nbsp;guess what is going on without your data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2017 02:36:03 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2017-11-14T02:36:03Z</dc:date>
    <item>
      <title>How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413102#M14178</link>
      <description>&lt;P&gt;For x-axis, I want to correct the order to: Week 0, Week 8, Week 16, Week 24, Week 32 instead of otherwise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="how to change order code.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16610i3B78603336A02A03/image-size/large?v=v2&amp;amp;px=999" role="button" title="how to change order code.JPG" alt="how to change order code.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="change order graph.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16611iEB5C2312170E777E/image-size/large?v=v2&amp;amp;px=999" role="button" title="change order graph.JPG" alt="change order graph.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 22:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413102#M14178</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2017-11-13T22:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413124#M14179</link>
      <description>&lt;P&gt;Create a numerical variable with the value of week and then use a format to have it appear as WEEK 8 etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that because its a character variable its sorting alphabetically, which is the correct approach.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 00:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413124#M14179</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-14T00:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413126#M14180</link>
      <description>&lt;P&gt;Or make sure the values will sort correctly for character: "Week 8" is after "Week 32" because 8 comes after 3. So use "Week 08", then the 0 comes before the 1 in "Week 16".&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 00:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413126#M14180</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-14T00:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413148#M14181</link>
      <description>&lt;P&gt;With&amp;nbsp;ODS Graphics Procedures, there are often multiple ways to achieve the result.&amp;nbsp; In addition to the previous suggestions, you could also&amp;nbsp;put the values in the order you want in your data, and use DISCRETEORDER=data on the COLAXIS.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 01:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413148#M14181</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-11-14T01:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413166#M14182</link>
      <description>&lt;P&gt;(I slightly modified my code)&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added DISCRETEORDER=data and it doesn't do anything.. What do you mean by "put the values in the order you want in your data"..?&lt;/P&gt;&lt;P&gt;I sorted by visit (Week 0, and so on) in proc sort and proc freq steps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgpanel data = percents;&lt;BR /&gt;panelby VSTEST / columns=2;&lt;BR /&gt;vbar visit / group= arm groupdisplay=cluster response=percent;&lt;BR /&gt;colaxis display=(nolabel) DISCRETEORDER=data;&lt;BR /&gt;where responder='Y';&lt;BR /&gt;title 'Percentage of Treatment Responders by Visit and Treatment Group';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 02:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413166#M14182</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2017-11-14T02:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413172#M14183</link>
      <description>&lt;P&gt;Attach your sample (non-confidential) data so we can run the program to see what is going on.&amp;nbsp; It is hard to&amp;nbsp;guess what is going on without your data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 02:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413172#M14183</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-11-14T02:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413173#M14184</link>
      <description>&lt;P&gt;I tried this but it's still not working:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;value week_sorted&lt;BR /&gt;2 = "Week 8"&lt;BR /&gt;3 = "Week 16"&lt;BR /&gt;4 = "Week 24"&lt;BR /&gt;5 = "Week 32";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sgpanel data = percents;&lt;BR /&gt;panelby VSTEST / columns=2;&lt;BR /&gt;format visitnum week_sorted.;&lt;BR /&gt;vbar visitnum / group= arm groupdisplay=cluster response=percent;&lt;BR /&gt;where responder='Y';&lt;BR /&gt;&lt;BR /&gt;colaxis label = "Study Visit" DISCRETEORDER=data;&lt;BR /&gt;rowaxis label = "Percent of Subjects with &amp;gt;=5 mmHg BP Decrease";&lt;BR /&gt;label arm = "Treatment Group";&lt;BR /&gt;title 'Percentage of Treatment Responders by Visit and Treatment Group';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 02:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413173#M14184</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2017-11-14T02:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413174#M14185</link>
      <description>It worked when I sorted variables in different order:&lt;BR /&gt;&lt;BR /&gt;proc sort data = visit_bp out = visit_bp_sorted;&lt;BR /&gt;by vstest arm visitnum visit;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc freq data= visit_bp_sorted noprint;&lt;BR /&gt;by vstest arm visitnum visit;&lt;BR /&gt;table responder / nocum out = percents;&lt;BR /&gt;run;&lt;BR /&gt;Do you know why it didn't work with&lt;BR /&gt;by visit vstest arm visitnum;&lt;BR /&gt;but worked with&lt;BR /&gt;by vstest arm visitnum visit;</description>
      <pubDate>Tue, 14 Nov 2017 02:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413174#M14185</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2017-11-14T02:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do we change order of a categorical variable for sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413384#M14196</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/172057"&gt;@gsk&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;(I slightly modified my code)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added DISCRETEORDER=data and it doesn't do anything.. What do you mean by "put the values in the order you want in your data"..?&lt;/P&gt;
&lt;P&gt;I sorted by visit (Week 0, and so on) in proc sort and proc freq steps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sgpanel data = percents;&lt;BR /&gt;panelby VSTEST / columns=2;&lt;BR /&gt;vbar visit / group= arm groupdisplay=cluster response=percent;&lt;BR /&gt;colaxis display=(nolabel) DISCRETEORDER=data;&lt;BR /&gt;where responder='Y';&lt;BR /&gt;title 'Percentage of Treatment Responders by Visit and Treatment Group';&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you have "Week 8" proc sort unless you use the correct linguistic options will place 'Week 8' after 'Week 16' 'Week 24' and 'Week 36'.&lt;/P&gt;
&lt;P&gt;Show us the Proc Sort.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 15:47:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-we-change-order-of-a-categorical-variable-for-sgpanel/m-p/413384#M14196</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-14T15:47:45Z</dc:date>
    </item>
  </channel>
</rss>

