Hi all,
I two numeric-Continuous variables. I'd like to draw a distribution where one continues variable x-axis and the other one is y-axis. I draw scatter plots with the curve but I don't want dots in the graph. It should be more like Kernel or Normal distribution. However, as I know I can draw Kernel or Normal distribution with only one variable using density. I want a distribution as seen below.
Could you help me to draw it?
Thanks.
Using @PeterClemmensen's data set.
Maybe:
proc sgplot data=have; pbspline x=scores y=ss; run;
or
proc sgplot data=have; reg x=scores y=ss / degree=3 nomarkers; run;
We kind of need a bit more description of your expectations than "no dots".
Can you post your data or a sample of it?
Sure, Here it is! It is in the attachment.
Thanks
the scores will be x-axis and ss will be y-axis.
Thanks
I'm not really sure how you expect this data to yield a plot like you posted. However, to get things started, you can fit a normal density plot like this
data have;
input scores ss;
datalines;
920 5.5
941 6.3
935 8.2
910 9.5
972 10.5
954 .
925 9.2
900 8.7
;
proc sgplot data=have;
density ss;
run;
Using @PeterClemmensen's data set.
Maybe:
proc sgplot data=have; pbspline x=scores y=ss; run;
or
proc sgplot data=have; reg x=scores y=ss / degree=3 nomarkers; run;
We kind of need a bit more description of your expectations than "no dots".
Thank you so much!
I tried the second one and it worked!
Thank you!
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.
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.