turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Coding for restricted cubic splines for multivaria...

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-23-2016 12:13 PM

My analysis is determining the association between weight (continuous variable) and post-operative complications (yes/no). I am doing a multivariable logistic regression analysis, adjusting for seven predictors (1 has multiple categories, 5 are yes/no, and 1 is continuous). I notice that the association between weight and complication is not exactly linear, so it is recommended that I do restricted cubic splines. I was using the following code:

**proc** **logistic** data=weight.avg_pred_val_all_data2;

effect spl_weight = spline(weight/naturalcubic knotmethod=percentiles(**5**));/*natural cubic splines with knots at quartiles*/

model est_prob= spl_weight/ cl;

output out=predicted_values pred=pred;

**run**;

Where est_prob is the probability of any complication.I then plotted the **unadjusted** spline association between weight and probability of any complication:

ods graphics/height=**6.5**in width=**10**in imagename="Figure2_revised_with_cubicspline" border=off;

**proc** **sgplot** data=predicted_values noautolegend;

xaxis label='Weight (kg)';

yaxis label='Any complication' values=(**0** to **60** by **5**);

series x=weight y=pred/ lineattrs=(color=gray pattern=solid thickness=**2**);

**run**;

My question is, how do I show the association between weight and any complication, adjusted for my seven predictors?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-23-2016 11:16 PM

If your full model doesn't involve interactions, have a look at proc gam.

PG

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-24-2016 10:15 AM

Thanks I will try that

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-24-2016 01:23 AM

Better post it at Stat Forum , since it is a Statistical Problem.
proc logistic has already built-in Graphics to display it .Check EFFECTPLOT statement :
http://blogs.sas.com/content/iml/2016/03/21/statistical-analysis-stephen-curry-shooting.html

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-24-2016 10:15 AM

Thanks for your suggestions