BookmarkSubscribeRSS Feed
CathyVI
Pyrite | Level 9

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 837 views
  • 2 likes
  • 4 in conversation