<?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: Adding a significance star in proc sgplot in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767771#M243447</link>
    <description>&lt;P&gt;There isn't a way to do it in SGPLOT directly you would need to pre-process your data to identify when you wanted to add that extra label.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you add the asterisk in you can assign a variable as your datalabel in SGPLOT, which I see you've done below. Did that not work for you?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Sep 2021 16:56:37 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-09-14T16:56:37Z</dc:date>
    <item>
      <title>Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767758#M243443</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I looked at another topic that discusses this but I'm still very lost.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;With the code at the bottom I understand how to put a star above a bar but I only want to put that star there if there is a significant difference in the means. So I'm a bit lost on how to tie all of that in together.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I also ran a proc anova with a post hoc test (tukey) on my data so I know which bars are significant comparing them together.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;It'd be nice if there was a way to do it through the proc sgplot procedure itself.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I'm try to get it to look like the images below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-09-14 at 9.42.28 AM.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63593i58544A9FAFE96616/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screen Shot 2021-09-14 at 9.42.28 AM.png" alt="Screen Shot 2021-09-14 at 9.42.28 AM.png" /&gt;&lt;/span&gt;or&amp;nbsp; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-09-14 at 11.22.20 AM.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63592iE6A46682DB0FEB2E/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screen Shot 2021-09-14 at 11.22.20 AM.png" alt="Screen Shot 2021-09-14 at 11.22.20 AM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-09-14 at 11.30.05 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63595i017CA9E74012B7FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-09-14 at 11.30.05 AM.png" alt="Screen Shot 2021-09-14 at 11.30.05 AM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;This is the original code for the graph above&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on / width=15in height=6in noborder ;

ods listing style =styles.mine;



title '[P]in X';

proc sgplot data=Narwhal.Narwhal_Data (where=(Location Contains 'X'));

&amp;nbsp; vbar Dependant_V / response=N_Concentration group=Experiment_Group groupdisplay=cluster&amp;nbsp;

&amp;nbsp; &amp;nbsp; stat=mean limitstat=stderr alpha=.05 ;

&amp;nbsp; xaxis /*display=(nolabel noticks)*/ label="Package"&amp;nbsp;

&amp;nbsp; values=('X_A' 'X_C' 'X_D' 'X_E' 'X_B' 'X_F');

&amp;nbsp; yaxis grid label="Concentration (pines/apples)";

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;And this is the code I made following the other topic&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc summary data=narwhal.narwhal_data nway;

Class Experiment_group Package;

var N_Concentration;

output out=tempp mean=uclm=uclm ;

run;



data dlabel;

set tempp;

if (uclm&amp;gt;30) then dlabel="*";

else dlabel="";

run;



proc sgplot data=dlabel;

vbarparm category=package response=N_Concentration / group=Experiment_Group datalabel=dlabel groupdisplay=cluster;

run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I'm using SAS OnDemand for academics&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 15:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767758#M243443</guid>
      <dc:creator>Kedarnath_M</dc:creator>
      <dc:date>2021-09-14T15:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767771#M243447</link>
      <description>&lt;P&gt;There isn't a way to do it in SGPLOT directly you would need to pre-process your data to identify when you wanted to add that extra label.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you add the asterisk in you can assign a variable as your datalabel in SGPLOT, which I see you've done below. Did that not work for you?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 16:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767771#M243447</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-14T16:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767777#M243449</link>
      <description>&lt;P&gt;No the problem was with that code it included a significance star on the graph if the mean was greater than 30, but I only want it to include a star if the &lt;STRONG&gt;difference&lt;/STRONG&gt; between the means is a significant amount, like if the error bars don't over lap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dlabel;

set tempp;

if (uclm&amp;gt;30) then dlabel="*";

else dlabel="";

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-09-14 at 1.04.02 PM.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63599iBBA01246C9C08D03/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screen Shot 2021-09-14 at 1.04.02 PM.png" alt="Screen Shot 2021-09-14 at 1.04.02 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;like these were the results of the post hoc test from the anova I ran and I want only these groups to have an asterisk.&lt;/P&gt;&lt;P&gt;I guess another way of putting it for this data set is if the difference between the means is greater then 22 (not If the mean is above 22)&amp;nbsp; then SAS should include a star on top of the bar that is higher.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 17:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767777#M243449</guid>
      <dc:creator>Kedarnath_M</dc:creator>
      <dc:date>2021-09-14T17:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767778#M243450</link>
      <description>So your question isn't how to add it to graph, its how to identify which records are statistically significant?&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Comparing-means-between-several-groups/td-p/345340" target="_blank"&gt;https://communities.sas.com/t5/Statistical-Procedures/Comparing-means-between-several-groups/td-p/345340&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Sep 2021 17:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767778#M243450</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-14T17:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767780#M243452</link>
      <description>&lt;P&gt;I already identified which groups are significant using the anova and the post hoc test but I just don't know how to translate that over to the proc sgplot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thats my anova code down below so I got the results for that&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;
proc anova data = hedgehog.DATA;
   class Experiment_Group;
   model a b c d e f=Experiment_Group; 
   means Experiment_Group/hovtest=bf clm cldiff t tukey
   		alpha=.05;
   ods output cldiffs=diffs;
run;
ods graphics off;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-09-14 at 1.42.00 PM.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63601iC4471228AE7E5BD8/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screen Shot 2021-09-14 at 1.42.00 PM.png" alt="Screen Shot 2021-09-14 at 1.42.00 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And these are all the significant differences between the groups&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 17:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767780#M243452</guid>
      <dc:creator>Kedarnath_M</dc:creator>
      <dc:date>2021-09-14T17:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767787#M243454</link>
      <description>1. You've shown three graphs. Are you trying to create all three or a specific one? It seems like you have two of the three coded? We cannot run the code you've posted so no idea where you are on that.&lt;BR /&gt;2. It looks like you have the pairs comparison to identify the difference, but don't know how to merge that in to your data to present it graphically?&lt;BR /&gt;&lt;BR /&gt;Instead of using the narwhal data set perhaps consider using sashelp.HEART or CARS so someone can help you out with public data if you cannot share your private data. &lt;BR /&gt;</description>
      <pubDate>Tue, 14 Sep 2021 18:05:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767787#M243454</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-14T18:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767789#M243455</link>
      <description>&lt;P&gt;1. I'm trying to get this graph to have the&amp;nbsp;asterisks, the other 2 graphs (the pictures) aren't mine they were just examples of how I wanted the graph to look like.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-09-12 at 4.08.09 PM.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63602i0FFB5285B20A3551/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screen Shot 2021-09-12 at 4.08.09 PM.png" alt="Screen Shot 2021-09-12 at 4.08.09 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2. yup that's the problem&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good idea! I'll try to use one of the sashelp data steps to represent it it might take awhile to do that though.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 18:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767789#M243455</guid>
      <dc:creator>Kedarnath_M</dc:creator>
      <dc:date>2021-09-14T18:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767906#M243510</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary  data=sashelp.heart nway;
class status Weight_Status;
var Systolic;
output out=have mean=mean std=std lclm=lclm uclm=uclm;
run;
data have ;
 set have;
 if Weight_Status in ('Overweight' 'Underweight') and status='Dead' then star=mean+std;
run;


proc sgplot data=have;
symbolchar name=uniStar char='2605'x; 
vbarparm category=status response=mean/ group=Weight_Status  groupdisplay=cluster LIMITLOWER=lclm LIMITUPPER=uclm ;
scatter x=status y=star /markerattrs=(symbol=unistar size=36pt) group=Weight_Status 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-1631715317451.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63612i736E09A930AAE2A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1631715317451.png" alt="Ksharp_0-1631715317451.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 14:15:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767906#M243510</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-09-15T14:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a significance star in proc sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767997#M243546</link>
      <description>&lt;P&gt;This sir, is straight genius.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 20:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-significance-star-in-proc-sgplot/m-p/767997#M243546</guid>
      <dc:creator>Kedarnath_M</dc:creator>
      <dc:date>2021-09-15T20:28:28Z</dc:date>
    </item>
  </channel>
</rss>

