Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tz
Obsidian | Level 7 Tz
Obsidian | Level 7

Dear all.

I created the plot in the attachement, using Vbox in SGPLOT.

I would like to include the frequencies for each point of NACCFDYSYear somewhere in the plot.

The XAXISTABLE statement cannot produce frequencies with box plots.

Any suggestions?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

You want this ?

proc sql;
create table have as
select sex,status,weight,count(*) as count,max(weight)+.05*range(weight) as y
 from sashelp.heart
  group by sex,status;
quit;
data have ;
 set have;
 by sex status;
 if not first.status then call missing(count,y);
run;

proc sgplot data=have;
vbox weight/category=sex group=status groupdisplay=cluster connect=median;
scatter x=sex y=y/group=status markerchar=count groupdisplay=cluster labelstrip clusterwidth=0.7;
run;

x.png

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

Show us your code 🙂

Tz
Obsidian | Level 7 Tz
Obsidian | Level 7

Code attached

Ksharp
Super User

You want this ?

proc sql;
create table have as
select sex,status,weight,count(*) as count,max(weight)+.05*range(weight) as y
 from sashelp.heart
  group by sex,status;
quit;
data have ;
 set have;
 by sex status;
 if not first.status then call missing(count,y);
run;

proc sgplot data=have;
vbox weight/category=sex group=status groupdisplay=cluster connect=median;
scatter x=sex y=y/group=status markerchar=count groupdisplay=cluster labelstrip clusterwidth=0.7;
run;

x.png

Tz
Obsidian | Level 7 Tz
Obsidian | Level 7

Thanks Ksharp

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1958 views
  • 1 like
  • 3 in conversation