Hello, I have 2 variables: binomialpdf and X. I use the following procedure
proc sgplot data =one;
scatter y=binomialpdf x=x;
run;
Is there anyway to put area under each dot in the above graph?
Thank You.
You can use a needle plot or a bar chart. For examples and discussion, see this blog post.
data one;
do x = 0 to 30;
binomialpdf = pdf("Binomial", x, 0.6, 30);
output;
end;
run;
proc sgplot data =one;
needle y=binomialpdf x=x / markers lineattrs=(thickness=5);
run;
proc sgplot data =one;
vbarbasic x / response=binomialPDF barwidth=1; /* requires SAS 9.4M3 */
run;
If you calculate the area outside of the SGPLOT and have it in your dataset you could use XAXISTABLE to print the numbers in the graph. I don't think SGPLOT has any Area under the curve options that it can calculate on its own.
I also try another procedure "gplot", but it looks similar even I add option "areas=1" (picture is below).
proc gplot data=chap3_binomial;
plot binomialpdf*x / areas=1;
Is there other procedure to get my objective?
Thank you.
run;
You want this ?
proc sgplot data=sashelp.air ;
scatter x=date y=air;
band x=date lower=0 upper=air / transparency=0.5;
run;
You can use a needle plot or a bar chart. For examples and discussion, see this blog post.
data one;
do x = 0 to 30;
binomialpdf = pdf("Binomial", x, 0.6, 30);
output;
end;
run;
proc sgplot data =one;
needle y=binomialpdf x=x / markers lineattrs=(thickness=5);
run;
proc sgplot data =one;
vbarbasic x / response=binomialPDF barwidth=1; /* requires SAS 9.4M3 */
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.