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;

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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