<?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: Boxplot in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866065#M342017</link>
    <description>But my requirement is to also represent treatment group by different line pattern (1st with solid line, 2nd treatment with dotted lines). How we can add 2 linepatterns in outlineattrs=, whiskerattrs= and medianattrs= options in boxplot.</description>
    <pubDate>Fri, 24 Mar 2023 09:58:05 GMT</pubDate>
    <dc:creator>Anv_SAS</dc:creator>
    <dc:date>2023-03-24T09:58:05Z</dc:date>
    <item>
      <title>Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/865195#M341654</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create BOXPLOT, as per below mock, using styles.rtf.&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="Anv_SAS_0-1679317166340.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81768iD8150211C318C6DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anv_SAS_0-1679317166340.png" alt="Anv_SAS_0-1679317166340.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm getting output as below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anv_SAS_1-1679317284567.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81770i45ED32F0AADFF9B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anv_SAS_1-1679317284567.png" alt="Anv_SAS_1-1679317284567.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm unable to restrict FILLPATTERN and unable to get DASHED lines for entire box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I'm restricted to use STYLE.RTF only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using below TEMPLATE code for creating BOXPLOT.&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="Anv_SAS_2-1679318194140.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81773i06F1BE47E130C35F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anv_SAS_2-1679318194140.png" alt="Anv_SAS_2-1679318194140.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anv_SAS_3-1679318235572.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81774iE87312099597332D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anv_SAS_3-1679318235572.png" alt="Anv_SAS_3-1679318235572.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can you help in fixing the above issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anvesh&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 13:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/865195#M341654</guid>
      <dc:creator>Anv_SAS</dc:creator>
      <dc:date>2023-03-20T13:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/865335#M341735</link>
      <description>&lt;P&gt;Try to remove "fillpattern" from the display= option, and add "pattern=3" into&amp;nbsp;outlineattrs=,&amp;nbsp;whiskerattrs= and&amp;nbsp;medianattrs= options.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 01:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/865335#M341735</guid>
      <dc:creator>Hao_Luo</dc:creator>
      <dc:date>2023-03-21T01:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866065#M342017</link>
      <description>But my requirement is to also represent treatment group by different line pattern (1st with solid line, 2nd treatment with dotted lines). How we can add 2 linepatterns in outlineattrs=, whiskerattrs= and medianattrs= options in boxplot.</description>
      <pubDate>Fri, 24 Mar 2023 09:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866065#M342017</guid>
      <dc:creator>Anv_SAS</dc:creator>
      <dc:date>2023-03-24T09:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866125#M342035</link>
      <description>&lt;P&gt;Your question is really not easy.&lt;/P&gt;
&lt;P&gt;Here is an example.&lt;/P&gt;
&lt;P&gt;Hope you can get the graph you want by refer to the following code.&lt;/P&gt;
&lt;P&gt;Good Luck.&lt;/P&gt;
&lt;P&gt;[Edited]&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 set sashelp.heart(keep=status sex weight);
run;

ods select none;
ods output sgplot=sgplot;
proc sgplot data=have;
vbox weight/category=status group=sex nooutliers ;
run;
ods select all;
data want;
 set sgplot;
 if BOX_WEIGHT_X_STATUS_GROUP_SE__ST in ('MIN' 'Q1' 'MEDIAN' 'Q3' 'MAX' 'MEAN') ;
run;
proc sort data=want;by BOX_WEIGHT_X_STATUS_GROUP_SE___X BOX_WEIGHT_X_STATUS_GROUP_SE__GP;run;
proc transpose data=want out=want2;
by BOX_WEIGHT_X_STATUS_GROUP_SE___X BOX_WEIGHT_X_STATUS_GROUP_SE__GP;
var BOX_WEIGHT_X_STATUS_GROUP_SE___Y;
id BOX_WEIGHT_X_STATUS_GROUP_SE__ST;
run;
data want2;
 set want2;
 l_mean=mean-5;
 h_mean=mean+5;
run;


ods graphics/ATTRPRIORITY=none;
proc sgplot data=want2;
styleattrs DATALINEPATTERNS=(solid shortdash) ;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=max low=min /
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=q3 low=q1/type=bar barwidth=0.5 nooutline
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster fillattrs=(color=white);

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=q3 low=q1/type=bar barwidth=0.5
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=median low=median/type=bar barwidth=0.5
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=min low=min/type=bar barwidth=0.5
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=max low=max/type=bar barwidth=0.5
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=mean low=mean/type=bar barwidth=0.2
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=h_mean low=l_mean/
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster ;

run;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1679665238023.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82007iBBFE6DE4AC453D4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1679665238023.png" alt="Ksharp_0-1679665238023.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 13:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866125#M342035</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-03-24T13:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866250#M342092</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Ksharp,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks you a lot. The solution you shared suffice the mock requirements. But it is not producing all the stats (MIN, MAX, MEAN, MEDIAN, N, DATAMAX, DATAMIN, OUTLIERS etc) produced by BOXPLOT in graph output.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 23:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866250#M342092</guid>
      <dc:creator>Anv_SAS</dc:creator>
      <dc:date>2023-03-24T23:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866281#M342099</link>
      <description>Can you post a picture to explain what graph you want to see?</description>
      <pubDate>Sat, 25 Mar 2023 09:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866281#M342099</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-03-25T09:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866286#M342100</link>
      <description>&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the screenshot of the output I needed, as requested.&lt;/P&gt;&lt;P&gt;&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="Anv_SAS_0-1679752298183.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82027iC87EC565ADE61808/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anv_SAS_0-1679752298183.png" alt="Anv_SAS_0-1679752298183.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 13:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866286#M342100</guid>
      <dc:creator>Anv_SAS</dc:creator>
      <dc:date>2023-03-25T13:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866355#M342123</link>
      <description>&lt;P&gt;So what is different between yours and mine?&lt;/P&gt;
&lt;P&gt;The max min value in my graph is not real max min of value.&lt;/P&gt;
&lt;P&gt;Check the following picture to see what box line stand for.&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="Ksharp_0-1679823042705.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82057iC227A7195C9D43A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1679823042705.png" alt="Ksharp_0-1679823042705.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 09:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866355#M342123</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-03-26T09:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866495#M342207</link>
      <description>&lt;P&gt;Thank You Ksharp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are getting all stats, except outliers. However, I hope in this model (solid and dashed), we cannot get outliers differentiated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your response suffice mock requirements, as shown in figure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 10:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866495#M342207</guid>
      <dc:creator>Anv_SAS</dc:creator>
      <dc:date>2023-03-27T10:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866513#M342213</link>
      <description>&lt;P&gt;OK. You want outliers as SAS did ? No problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 set sashelp.heart(keep=status sex weight);
run;

ods select none;
ods output sgplot=sgplot;
proc sgplot data=have;
vbox weight/category=status group=sex  ;
run;
ods select all;
data stat outliers;
 set sgplot;
 if BOX_WEIGHT_X_STATUS_GROUP_SE__ST in ('MIN' 'Q1' 'MEDIAN' 'Q3' 'MAX' 'MEAN') then output stat;
 if find(BOX_WEIGHT_X_STATUS_GROUP_SE__ST,'OUTLIER') then output outliers;
run;
proc sort data=stat;by BOX_WEIGHT_X_STATUS_GROUP_SE___X BOX_WEIGHT_X_STATUS_GROUP_SE__GP;run;
proc transpose data=stat out=stat2;
by BOX_WEIGHT_X_STATUS_GROUP_SE___X BOX_WEIGHT_X_STATUS_GROUP_SE__GP;
var BOX_WEIGHT_X_STATUS_GROUP_SE___Y;
id BOX_WEIGHT_X_STATUS_GROUP_SE__ST;
run;
data stat2;
 set stat2;
 l_mean=mean-5;
 h_mean=mean+5;
run;
data want;
 set stat2 outliers;
run;

ods graphics/ATTRPRIORITY=none;
proc sgplot data=want;
styleattrs DATALINEPATTERNS=(solid shortdash) ;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=max low=min /
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=q3 low=q1/type=bar barwidth=0.5 nooutline
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster fillattrs=(color=white);

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=q3 low=q1/type=bar barwidth=0.5
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=median low=median/type=bar barwidth=0.5
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=min low=min/type=bar barwidth=0.3
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=max low=max/type=bar barwidth=0.3
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=mean low=mean/type=bar barwidth=0.15
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster nofill;

highlow x=BOX_WEIGHT_X_STATUS_GROUP_SE___X high=h_mean low=l_mean/
lineattrs=(color=black) group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster ;

scatter x=BOX_WEIGHT_X_STATUS_GROUP_SE___X y=BOX_WEIGHT_X_STATUS_GROUP_SE___Y/
group=BOX_WEIGHT_X_STATUS_GROUP_SE__GP groupdisplay=cluster markerattrs=(color=black);
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1679918011703.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82090i4B5D755A3DE9BA5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1679918011703.png" alt="Ksharp_0-1679918011703.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 11:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Boxplot/m-p/866513#M342213</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-03-27T11:53:46Z</dc:date>
    </item>
  </channel>
</rss>

