BookmarkSubscribeRSS Feed
CathyVI
Lapis Lazuli | Level 10

Hi,

I am trying to replicate this graph. This is from a study https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7214907/

This is a  two-piecewise linear regression model. I will like to know the sas code which can be used to replicate this graph.

 

 

Adewumi_0-1620779302227.png

 

4 REPLIES 4
WarrenKuhfeld
Ammonite | Level 13

Look at proc transreg.

Ksharp
Super User
proc sgplot data=sashelp.heart(obs=1000);
loess x=weight y=height/clm nomarkers;
run;

SGPlot4.png

Rick_SAS
SAS Super FREQ

See the article "Piecewise regression models and spline effects" for a discussion, example, and code.  The example uses PROC GLIMMIX, but also includes a reference to the PROC TRANSREG documentation, which contains a second example.

 

The example assumes that the two pieces of the model both have the same form (for example, linear or quadratic). If you want to mix-and-match models on separate domains, you can use PROC NLIN to construct a segmented regression model.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1375 views
  • 2 likes
  • 4 in conversation