BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ksharp
Super User

Check @Rick_SAS blogs for this topic:

https://blogs.sas.com/content/iml/2020/05/11/cubic-interpolation-sas.html
https://blogs.sas.com/content/iml/2017/04/19/restricted-cubic-splines-sas.html
https://blogs.sas.com/content/iml/2019/10/16/visualize-regression-splines.html
https://blogs.sas.com/content/iml/2024/06/03/vize-multivar-regression-splines.html
https://blogs.sas.com/content/iml/2019/02/18/regression-restricted-cubic-splines-sas.html

 

Here I use the code written by Rick to get cubic spline effect/term , if you want cubic interpolation check the first one URL I marked bold.

data cars;
set sashelp.cars;
keep mpg_city weight;
run;
proc glmselect data=cars outdesign(addinputvars fullmodel)=SplineBasis;
   effect spl = spline(weight / naturalcubic basis=tpf(noint) knotmethod=percentilelist(25 50 75) );
   model mpg_city = spl / selection=none noint;  
quit;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 15 replies
  • 3902 views
  • 11 likes
  • 5 in conversation