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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5821 views
  • 1 like
  • 2 in conversation