Turn on suggestions

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

Showing results for

- Home
- /
- Programming
- /
- Programming
- /
- spline for odd ratios after logistic regression

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**.
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 08-28-2023 01:20 AM
(1469 views)

Hi, everyone

I spent a lot of time yesterday searching how to make spline for odd ratios after a logistic regression. My idea is simple the coefficient of a continuous variable is derived from the logistic regression, and I can use it and its CI to construct the spline for ORs.

But I did not find any direct SAS procedures or statements to do so. Would you guide me the direction? Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

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

The most likely reason is that you specified serumALB in your MODEL statement as a predictor rather than the spline effect, splALB. Effectively, the spline was not even used in the model.

6 REPLIES 6

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

Better post it at Statistic Forum:

https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures

@StatDave maybe could give you a hand.

https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures

@StatDave maybe could give you a hand.

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

What you are trying to do is not entirely clear, but this note might address it.

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

Hello, Dave.

Wow! That's a great reference. Thanks. I copied and edited the code to suit my project. But, so far, I have never get the Odd Ratio plot as shown in the first example. My code only generated one column for the variable of serumAlb. I am just not able to make it. Your investigation would be of great important. Thanks.

My code:

```
%macro Logistic2;
proc logistic data= &raw_data_name plots = oddsratio(type=vertical);
class &class_var;
effect SplALB=spline(serumAlb/naturalcubic);
model &censor(event = '1') = &indep_list;
effectplot fit(x=serumAlb);
effectplot fit(x=serumAlb) / link;
oddsratio serumAlb / at(serumAlb=34.8125 36.0425 37.35 39.0 40.92);
store kmod;
run;
%mend;
%Logistic2
```

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

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

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

Exactly! This is the issue. I specified serumALB instead of SplALB in the MODEL statement. After correcting this error, everything followed as expected. Thank you.

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.

Ready to level-up your skills? Choose your own adventure.