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
- /
- Estimating O.R.s for interaction terms bt continuo...

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

10-24-2016 01:49 PM - edited 10-25-2016 07:12 PM

I am trying to estimate odds ratios for interaction terms in a logistic regression using v9.4. I've found this article, http://support.sas.com/kb/24/455.html, but can't find an explanation for how to determine which numbers to enter into the matrix (the 1s, 0s, -1s in the example) in the estimate statement to pull what I want. I am specifcially having difficulty figuring out how to pull for an interaction between a continuous variable (peervicadd) and a categorical one (percschsafe). For good measure, here's my code:

**Proc** **logistic** data=secondyp.lgbq;

class race(ref="5" param=ref) sex(ref="1" param=ref) percschsafe(param=ref ref="0");

model SuicideAttemptA(event='1')=peervicadd race age sex grade percschsafe percschsafe*peervicadd/clodds=wald lackfit expb;

estimate "Peer Victimization" peervicadd **1**/exp cl;

estimate "Perception of School Safety (No)" percschsafe **0** /exp cl;

estimate "Perception of School Safety (Yes)" percschsafe **1** /exp cl;

Estimate "Peer Victimization x Perceptions of School Safety (No)" percschsafe*peervicadd **0** **1** /exp cl;

Estimate "Peer Victimization x Perceptions of School Safety (Yes)" percschsafe*peervicadd **1** **1** /exp cl;

**Run**;

Adding to the mystery, I keep getting this message in the log:

WARNING: More coefficients than levels specified for effect PeerVicAd*PercSchSaf. Some

coefficients will be ignored.

WARNING: More coefficients than levels specified for effect PeerVicAd*PercSchSaf. Some

coefficients will be ignored.

If someone could point me to a reference to see what #'s line up to the various columns in the Estimate statement, I would be very appreciative.

Thanks,

Andrew

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

10-24-2016 01:55 PM

Use the ODDSRATIO statement instead, a bit easier to navigate in my opinion.

You're looking for the interaction between a categorical and continuous variable so you may want to specify levels, it chooses the average by default.

```
proc logistic data=sashelp.heart;
class sex ;
model status = ageatstart height weight sex weight*sex ;
oddsratio sex;
run;
```

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

10-24-2016 02:27 PM

Thanks for your reply. I tried to use an oddsratio statement, but I got results that didn't make sense -- the OR's didn't cross 1 even though the interaction term wasn't significant. Is it pulling the interaction term or the predictor variable (sex in your example)?

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

10-24-2016 03:36 PM

The OR's shouldn't cross 1 if the term is insignificant.

When you have an interaction term, you can only look at a 'conditional' oddsratio of your variable.

Ie Sex at average weight of 158lbs

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

10-25-2016 11:55 AM

That makes sense; thank you. I'd like to pull an estimate for the interaction term itself (i.e. in your example, sex*weight). Is that possible with the oddsratio statment?

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

10-25-2016 01:54 PM

What are you expecting as output for that?

If they were both categorical you could look at it for all levels, but since one is continuous you need to pick one or several values for weight to consider.