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

Hi.  I need to add linear trendline to the data plot to show its trend.

What syntax could I add into this following proc gplot?

 

proc gplot data = armaxvlp;
symbol1 i = splines v = dot;
plot Bill*Waktu;
run;

 

Thankyou.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Yes. (Also please look at the SGPLOT procedure, this may be simpler to use in the long run, and has a lot of nice features)

 

data class;
    set sashelp.class;
    seq=_n_;
run;

symbol1 i=rl v=dot c=green;
symbol2 i=splines v=none c=red;
proc gplot data=class;
    plot height*seq=1 height*seq=2/overlay;
run;
quit;
--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I am going to guess that by "linear trendline", you mean a linear regression line.

 

In that case:

 

symbol1 i = rl v = dot;
--
Paige Miller
sasgiaz
Quartz | Level 8

Could I have it both rl and splines on the data plot?

PaigeMiller
Diamond | Level 26

Yes. (Also please look at the SGPLOT procedure, this may be simpler to use in the long run, and has a lot of nice features)

 

data class;
    set sashelp.class;
    seq=_n_;
run;

symbol1 i=rl v=dot c=green;
symbol2 i=splines v=none c=red;
proc gplot data=class;
    plot height*seq=1 height*seq=2/overlay;
run;
quit;
--
Paige Miller
sasgiaz
Quartz | Level 8

Thank you so much!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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 save with the early bird rate—just $795!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 6750 views
  • 1 like
  • 2 in conversation