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
- /
- Analytics
- /
- Stat Procs
- /
- How to estimate spline function in a multi-variabl...

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

05-22-2017 03:52 AM

Hi all,

When researchers want to conduct the relationship between a binary dependent variable and independent variables, one way they can do is as follows:

```
PROC LOGISTIC DATA = MyDtSt;
MODEL Y(event='1') = Main X, confounders;
RUN;
```

This one is easy!

It simply use main x to construct a model for Y, also with the adjustment of confounders.

However, my question is that what if I want to use spline(X) to model Y, and at the same time I want to control for linear confounding effects?

Is there any way allows me to model binary Y with spline function of X, and also enables me to take into account confounding effects?

Hope you guys can provide me with some suggestions.

Thanks in advance!

Accepted Solutions

Solution

05-22-2017
08:07 PM

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

05-22-2017 08:35 AM

You can use the EFFECT statement in PROC LOGISTIC to define a spline effect.

Simple example with lots of links to papers and doc: "Nonsmooth models and spline effects"

The EFFECT statement supports several kinds of splines, so read the doc for how to specify the basis functions. For an example that uses restricted cubic splines, see "Regression with restricted cubic splines in SAS". The article demonstrates linear regression, but you can use the same ideas and syntax in PROC LOGISTIC.

All Replies

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

05-22-2017 08:15 AM

Calling @Rick_SAS

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

05-22-2017 08:09 PM

Ksharp,

Thank you for doing this!

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

05-22-2017 08:25 AM

The EFFECT statement in PROC LOGISTIC (and many other PROCs) allows you to use a spline fit through X in the model. This example, which uses PROC GLIMMIX, ought to function the same in PROC LOGISTIC: http://documentation.sas.com/?cdcId=statcdc&cdcVersion=14.2&docsetId=statug&docsetTarget=statug_intr...

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

05-22-2017 08:11 PM

Paige Miller,

Thank you for this information!

I'll definitely check "effect" statement.

Solution

05-22-2017
08:07 PM

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

05-22-2017 08:35 AM

You can use the EFFECT statement in PROC LOGISTIC to define a spline effect.

Simple example with lots of links to papers and doc: "Nonsmooth models and spline effects"

The EFFECT statement supports several kinds of splines, so read the doc for how to specify the basis functions. For an example that uses restricted cubic splines, see "Regression with restricted cubic splines in SAS". The article demonstrates linear regression, but you can use the same ideas and syntax in PROC LOGISTIC.

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

05-22-2017 08:15 PM

Rick,

This is exactly what I'm looking for!

With this information, I think I can achieve what I want.

Thank you!