BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sathish_jammy
Lapis Lazuli | Level 10

Hi community, 

 

I have a 3 columns of patient details

Weight-height-ratio (WHR) , Age, sex.

I want to visualize an image like 

Reg1.png

But I get visualization like:

I given the code below

 

Untitled.png

 

proc sgplot data = reg_55k;
styleattrs datacontrastcolors = (red blue);
scatter x = ageonset y = whr / group = sex;
reg x = ageonset y = whr / group = sex clm clmattrs = (clmfillattrs = (color = lightgrey));
run;

 

Please kindly guide me to get the exact format like the first visualization.

I also attach the dataset in this post.

Thanks in advance!

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

Can't see your example data. but what you want is likely something like this without the scatter statement

 

proc sgplot data=sashelp.class;
   reg x=height y=weight / group=sex clm nomarker;
   yaxis min=30 max=200;
run;

View solution in original post

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Can't see your example data. but what you want is likely something like this without the scatter statement

 

proc sgplot data=sashelp.class;
   reg x=height y=weight / group=sex clm nomarker;
   yaxis min=30 max=200;
run;
Sathish_jammy
Lapis Lazuli | Level 10

Thank you that worked out very nicely.

 

How could I implement the 95% interval in this, I tried like (cli clm)

Please gothrough the first image - it have 0.95 intreval values. 

When I tried : PArtial output occurs

 

proc sgplot data=reg_55k;
reg x=ageonset y=whr_ / group=sex clm cli nomarker;
run;

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 953 views
  • 0 likes
  • 2 in conversation