Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Why are the transformations for restricted cubic splines the same rega...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 02-04-2019 06:46 PM
(578 views)

I'm using the spline function from the effect statement in PROC Logistic and noticed that the RCS transformations for my independent variable happen to be the same regardless of what outcome I use. This confused me as I thought the transformations were performed in relation to the outcome.

To illustrate my issue, I have fitted Death Status or BP Status against Weight as the independent variable. The data set used is the heart data set from sashelp. I'm running SAS9.4 M4.

Proc print and Proc Corr results below showing how the spline transformations are exactly the same. Proc freq results also below to show that the outcomes fitted are different.

`data heart_anal;set sashelp.heart;`

where BP_Status ne '' and weight ne . and status ne '';run;
proc logistic data=heart_anal noprint outdesign=cubic_out1;
effect spl=spline(Weight /basis=tpf(noint) naturalcubic knotmethod=rangefractions(0.10 0.50 0.90));
model Status= spl/expb;
run;
data cubic_out1;set cubic_out1;id=_n_;keep id spl1 spl2;run;
proc logistic data=heart_anal noprint outdesign=cubic_out2;
effect spl=spline(Weight /basis=tpf(noint) naturalcubic knotmethod=rangefractions(0.10 0.50 0.90));
model BP_Status= spl/expb;
run;
data cubic_out2;set cubic_out2;id=_n_;keep id spl1 spl2;rename spl1=spl1_2 spl2=spl2_2;run;
data comb;merge cubic_out1 cubic_out2;by id;run;
proc corr data=comb;var spl1 spl1_2 spl2 spl2_2;run;
proc print data=comb(obs=5);id id;var spl1 spl1_2 spl2 spl2_2;run;
proc freq data=heart_anal;table status*bp_status;run;

Thanks for reading. Any help will be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

No, your assumption is not correct. Only the X variable is used to generate the spline effects. Notice that the EFFECT statement only refers to the WEIGHT variable in your example.

Here is the documentation for the spline effects, in case you want to read more details.

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

No, your assumption is not correct. Only the X variable is used to generate the spline effects. Notice that the EFFECT statement only refers to the WEIGHT variable in your example.

Here is the documentation for the spline effects, in case you want to read more details.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

**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.

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.