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.
Look at proc transreg.
Calling @Rick_SAS
proc sgplot data=sashelp.heart(obs=1000); loess x=weight y=height/clm nomarkers; run;
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.