BookmarkSubscribeRSS Feed
lokerick
Calcite | Level 5

Hello,

 

I'm attempting to avoid my instinct to switch to R when doing something graphical. Is there a way to add a significance star, p-value and/or connector above my clustered vertical bars to show a statistical difference between groups? 

 

Current code: 

 

proc sgplot data=cog_long;
	where test = "Rivermead";
	styleattrs datacolors=(%RGB(217,217,217) %RGB(127,127,127));
	vbar testnum / response=score stat=mean limitstat=stderr
		limitattrs=(color=black) group=trt groupdisplay=cluster
		nooutline;
	xaxis valueattrs=(size=12pt family="Times New Roman") 
		labelattrs  =(size=14pt family="Times New Roman");
	yaxis min=0 max=25 valueattrs=(size=14pt family="Times New Roman") 
		labelattrs=(size=14pt family="Times New Roman");
	keylegend / titleattrs=(size=14pt family="Times New Roman") 
		valueattrs=(size=14pt family="Times New Roman");
	title;
run;

Current graph: 

Note: significance star/connector would go above Memory RetentionNote: significance star/connector would go above Memory Retention

The desired graph would have connecting line with ** above the Memory Retention tests similar to this graph produced in R:

fig23.png

 

1 REPLY 1
Ksharp
Super User

You could use

 

BARPARM  statement + SCATTER statement (plot a big Star symbol)

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1629 views
  • 1 like
  • 2 in conversation