<?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 Ordering values in a box plot in PROC ANOVA in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Ordering-values-in-a-box-plot-in-PROC-ANOVA/m-p/3810#M1603</link>
    <description>With the ODS graphics in PROC ANOVA, can you modify the order of the class variable on the x-axis?  I am comparing averages across days of the workweek, and it works fine if I use the numeric value of the day, however when I format the weekday it puts it in alphabetical order (FRI, MON, THU, etc.).  Using ORDER=INTERNAL does not seem to work.</description>
    <pubDate>Fri, 13 Jul 2007 18:30:09 GMT</pubDate>
    <dc:creator>Petersi</dc:creator>
    <dc:date>2007-07-13T18:30:09Z</dc:date>
    <item>
      <title>Ordering values in a box plot in PROC ANOVA</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Ordering-values-in-a-box-plot-in-PROC-ANOVA/m-p/3810#M1603</link>
      <description>With the ODS graphics in PROC ANOVA, can you modify the order of the class variable on the x-axis?  I am comparing averages across days of the workweek, and it works fine if I use the numeric value of the day, however when I format the weekday it puts it in alphabetical order (FRI, MON, THU, etc.).  Using ORDER=INTERNAL does not seem to work.</description>
      <pubDate>Fri, 13 Jul 2007 18:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Ordering-values-in-a-box-plot-in-PROC-ANOVA/m-p/3810#M1603</guid>
      <dc:creator>Petersi</dc:creator>
      <dc:date>2007-07-13T18:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering values in a box plot in PROC ANOVA</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Ordering-values-in-a-box-plot-in-PROC-ANOVA/m-p/3811#M1604</link>
      <description>The way that ANOVA works is to use the formatted value. You could try formatting like this:&lt;BR /&gt;
1-S&lt;BR /&gt;
2-M&lt;BR /&gt;
3-T&lt;BR /&gt;
4-W&lt;BR /&gt;
5-R&lt;BR /&gt;
6-F&lt;BR /&gt;
7-S&lt;BR /&gt;
or something similar to get the number with the day value (either all or part of the day). &lt;BR /&gt;
   &lt;BR /&gt;
OR, in SAS 9.1.3, you could change the graph template to put in a simulated legend. The code below shows both methods on some data.&lt;BR /&gt;
cynthia&lt;BR /&gt;
 &lt;BR /&gt;
[pre]&lt;BR /&gt;
*** the code;&lt;BR /&gt;
** Method 1: Use a Number in the format to keep order;&lt;BR /&gt;
ods path sashelp.tmplmst(read) ;&lt;BR /&gt;
     &lt;BR /&gt;
   data Clover2;&lt;BR /&gt;
      input Strain $ Nitrogen Day @@;&lt;BR /&gt;
   return;&lt;BR /&gt;
   datalines;&lt;BR /&gt;
   3DOK1  19.4 1 3DOK1  32.6 1 3DOK1  27.0 1 3DOK1  32.1 1 3DOK1  33.0 1&lt;BR /&gt;
   3DOK5  17.7 2 3DOK5  24.8 2 3DOK5  27.9 2 3DOK5  25.2 2 3DOK5  24.3 2&lt;BR /&gt;
   3DOK4  17.0 3 3DOK4  19.4 3 3DOK4   9.1 3 3DOK4  11.9 3 3DOK4  15.8 3&lt;BR /&gt;
   3DOK7  20.7 4 3DOK7  21.0 4 3DOK7  20.5 4 3DOK7  18.8 4 3DOK7  18.6 4&lt;BR /&gt;
   3DOK13 14.3 5 3DOK13 14.4 5 3DOK13 11.8 5 3DOK13 11.6 5 3DOK13 14.2 5&lt;BR /&gt;
   COMPOS 17.3 6 COMPOS 19.4 6 COMPOS 19.1 6 COMPOS 16.9 6 COMPOS 20.8 6&lt;BR /&gt;
   ;&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
proc format;&lt;BR /&gt;
  value dayf  1 = '1-SUN'&lt;BR /&gt;
              2 = '2-MON'&lt;BR /&gt;
              3 = '3-TUE'&lt;BR /&gt;
              4 = '4-WED'&lt;BR /&gt;
              5 = '5-THU'&lt;BR /&gt;
              6 = '6-FRI'&lt;BR /&gt;
              7 = '7-SAT';&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
ods html path='c:\temp' (url=none)&lt;BR /&gt;
        gpath='c:\temp' (url=none)&lt;BR /&gt;
        file='anova_origtemp.html' &lt;BR /&gt;
        style=analysis;&lt;BR /&gt;
ods select boxplot;&lt;BR /&gt;
ods graphics on /imagefmt=staticmap;&lt;BR /&gt;
title '1) Original template and format';&lt;BR /&gt;
  proc anova data = Clover2;&lt;BR /&gt;
    class Day;&lt;BR /&gt;
    model Nitrogen = Day;&lt;BR /&gt;
    format day dayf.;&lt;BR /&gt;
  run;&lt;BR /&gt;
  quit;&lt;BR /&gt;
  &lt;BR /&gt;
ods graphics off;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
 &lt;BR /&gt;
 &lt;BR /&gt;
** Method 2: change the template to put in a simulated legend;&lt;BR /&gt;
ods path work.temp(update) sashelp.tmplmst(read) ;&lt;BR /&gt;
   &lt;BR /&gt;
proc template;                                                                &lt;BR /&gt;
   define statgraph Stat.GLM.Graphics.BoxPlot;                                &lt;BR /&gt;
   dynamic _DEPVAR _CLASSVAR _GROUPDFBY; &lt;BR /&gt;
   layout gridded; &lt;BR /&gt;
      layout lattice / rows=1 columns=1;                                      &lt;BR /&gt;
         Sidebar / Align=top;                                                 &lt;BR /&gt;
            layout Overlay / padbottom=3;                                     &lt;BR /&gt;
               layout gridded / columns=4 valign=top;                         &lt;BR /&gt;
                  entrytitle "Distribution of ";                              &lt;BR /&gt;
                  entrytitle _DEPVAR;                                         &lt;BR /&gt;
                  entrytitle " by ";                                          &lt;BR /&gt;
                  entrytitle _CLASSVAR;                                       &lt;BR /&gt;
               endlayout;                                                     &lt;BR /&gt;
            EndLayout;                                                        &lt;BR /&gt;
         EndSidebar;                                                          &lt;BR /&gt;
         layout overlay / ygrid=true;                                         &lt;BR /&gt;
            boxplot y=_DEPEN x=_GROUPDFBY / datalabel=_DOBS labelfar=on       &lt;BR /&gt;
               notches=off connect=none mediansymbol=line meansymbol=diamond  &lt;BR /&gt;
               markers=on markersymbol=circle fill=on capshape=serif;  &lt;BR /&gt;
         endlayout;          &lt;BR /&gt;
      endlayout;  &lt;BR /&gt;
      layout gridded /border=yes rows=1;&lt;BR /&gt;
         entry "1=Sun 2=Mon 3=Tue 4=Wed 5=Thu 6=Fri 7=Sat" &lt;BR /&gt;
               /foreground=purple&lt;BR /&gt;
                fontweight=bold&lt;BR /&gt;
                fontsize=12pt; &lt;BR /&gt;
      endlayout;&lt;BR /&gt;
   endlayout;&lt;BR /&gt;
   end;                                                                       &lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
ods html path='c:\temp' (url=none)&lt;BR /&gt;
        gpath='c:\temp' (url=none)&lt;BR /&gt;
        file='anova_newtemp.html' &lt;BR /&gt;
        style=analysis;&lt;BR /&gt;
ods select boxplot;&lt;BR /&gt;
ods graphics on /imagefmt=staticmap;&lt;BR /&gt;
title '2) New template and Day numbers and Legend';&lt;BR /&gt;
 &lt;BR /&gt;
  proc anova data = Clover2;&lt;BR /&gt;
    class Day;&lt;BR /&gt;
    model Nitrogen = Day;&lt;BR /&gt;
  run;&lt;BR /&gt;
  quit;&lt;BR /&gt;
 &lt;BR /&gt;
ods graphics off;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
 &lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 13 Jul 2007 20:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Ordering-values-in-a-box-plot-in-PROC-ANOVA/m-p/3811#M1604</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-07-13T20:04:48Z</dc:date>
    </item>
  </channel>
</rss>

