BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
stancemcgraw
Obsidian | Level 7

Hello,

   I'm trying to overlay two scatterplots; one for bmi & days to transition and one for age & days to transition. I then want to draw a best fit line through them with results from my regression analysis. 

 

I've tried the following code

proc template;

  define statgraph standard;

    begingraph;

      entrytitle "Model Transition days by Age and BMI";

      layout overlay;

        scatterplot x=transition  y=age;

        scatterplot x=transition y=bmi;

  endlayout;

    endgraph;

  end;

run;

 

proc sgrender data=sashelp.class template=standard;

run;

 

It will not output the graph because it says I am missing arguments in the log. Could someone please help p me out?

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I assume you are asking for two different best-fit lines, one for transition and age, and one for transition and BMI.

 

It's not clear to me why you are doing this in PROC TEMPLATE rather than PROC SGPLOT. In PROC SGPLOT, you would use two SCATTER statements and two REG statements.

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

I assume you are asking for two different best-fit lines, one for transition and age, and one for transition and BMI.

 

It's not clear to me why you are doing this in PROC TEMPLATE rather than PROC SGPLOT. In PROC SGPLOT, you would use two SCATTER statements and two REG statements.

--
Paige Miller

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 1 reply
  • 467 views
  • 0 likes
  • 2 in conversation