SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
ajames2020
Fluorite | Level 6

Are these two lines the same? This is based on a segmented regression that I'm doing. I'm trying to use two separate methods to create the plots:

 

1. Do separate regression lines by using sgplot and the "group" option for under regression.

2. Generating values for ytrend using proc autoreg, then plotting the trend line. 

 

The lines from 1 and 2 above seem to fit the points differently. Option 1 gives me a better fit. If I'm interested in connecting the two regression lines generated in option (1) above, how would I do that? (I'm trying to show a level change in my interrupted time series analysis.

1 REPLY 1
smantha
Lapis Lazuli | Level 10

A regression line is different from a trend line,Though both can be correlated some times. This is more evident in time series plots. For a time series the following are how things are looked at

Y=intercept+seasonality(seasonal patterns)+Other causals

as an example if you are measuring sales due to an advertising campaign Other causals represent your marketing actvity and Y is the sales response, then your intercept+seasonality must be able to capture trend.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 500 views
  • 0 likes
  • 2 in conversation