BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pkfamily
Obsidian | Level 7

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.

 

for_sas_board2.pngfor_sas_board1.pngfor_sas_board3.png

 

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
Rick_SAS
SAS Super FREQ

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.

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

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.

pkfamily
Obsidian | Level 7

Thanks for the clarification Rick! For RCS, I suppose the transformation mainly depends on the number of knots and the knot locations. 

sas-innovate-2024.png

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.

 

Register now!

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
  • 2 replies
  • 579 views
  • 2 likes
  • 2 in conversation