I want to plot the following graph by a given dataset. I think may be using PROC PARETO. But I am not exactly sure.
Thanks for code hint.
output cumulative percent into table freq .
You can use SGPLOT or Pareto, it's a matter of choice, assuming you have the SAS/QC and PROC PARETO available.
What exactly is your question though?
OI don't have Pareto installed, I just found the fact. So I have to use SGPLOT.
The goal is
You really should post it at ODS Graphic forum.
proc freq data=sashelp.class noprint;
table age/out=freq outcum;
run;
data have;
set freq;
p=percent/100;
cum_p=cum_pct/100;
format p cum_p percent7.2;
proc sgplot data=have;
vbar age/response=p nostatlabel fillattrs=graphdata2 legendlabel='percent';
vline age/response=cum_p markers datalabel legendlabel='cum percent';
yaxis label=' ';
keylegend /across=1 position=right location=inside;
run;
So I have to calculate freq and cumulative percentage first on the given dataset?
The sashelp.class is just a demo example?
You can usually use the procs to do some summaries, but since you're needing two different statistics it's easier if you do it first yourself.
So yes, summarize the data using proc freq. SASHELP.CLASS is one of several demo dataset that almost all SAS installations will have. This allows others to run the same code and generate results.
table age/out=freq outcum;
For this line code. What is outcum?
It is not used in the later code.
output cumulative percent into table freq .
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.