BookmarkSubscribeRSS Feed
tmuhich
Calcite | Level 5

Hello everyone,

I am new to SAS, although I have used Program R a little in the past.  I need to run a piecewise regression/multi-phase regression for a data set that will have either two or three linear segments, and is continuous.  I don't know which, but it will be one of the two.  I believe I need to use PROC NLIN to accomplish this, but don't know how to set up the code for the two potential break points.  I have attached a dummy data set.  Could one of you be so kind as to help walk me through the code for this?  I am interested in finding the break point or points, and the adj. r^2.

 

I appreciate your time, 

Thank you,

Tim Muhich

1 REPLY 1
Rick_SAS
SAS Super FREQ

There have been several papers written on this topic.  You will need one parameter for each location where you think the derivative is discontinuous. One easy-to-read paper is by Schwarz (2015).  It is the similar to an example from the UCLA web site. They both include code for PROC NLIN, although the example only has a single "elbow" point where the PL curve changes slope.

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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