Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- How to use a single common reference to estimate interaction?

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 11-25-2023 05:40 PM
(798 views)

Dear All:

I tried to report two risk ratios for the two levels of a modifier (retirement: 1 yes and 0 no). The exposure variable is depression (1: depressed and 0:not). I made the following SAS syntax:

proc genmod data=abc desc;

class dep retire /param=ref ref=first;

model death = dep retire dep*retire /dist=bin link=log;

estimate "RR in Non_retired" dep 1 dep*retire 0/exp;

estimate "RR in Retired" dep 1 dep*retire 1/exp;

run;

However, the two risk ratios used two reference groups. The risk ratio among non-retired has a reference of risk among subjects who were not retired and not depressed. In the second group (RR in the retired group), the reference risk is subjects who were retired but not depressed. I want to estimate the two risk ratios by using the same reference in the non-retired category but do not know how to use the 'estimate' option. Great appreciate it if you would help me. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

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

5 REPLIES 5

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

While I just can't understand what you are really trying to do, you can make this easier on yourself, by using LSMEANS. As I've said here many times, you should never use the more complex ESTIMATE (or CONTRAST) statement when simpler statements can do the job. The LSMEANS statement requires using the nonfull-rank version of reference parameterization which is the default GLM parameterization.

From the first LSMEANS statement below, you get the estimated event probability (presumably the probability of death) in the MEAN column (provided by the ILINK option) for each combination of DEP and RETIRE. In the Differences table, you also get (in the Exponentiated column) every pairwise comparison which includes (if that's what you want) the relative risk of death comparing DEP levels in each level of RETIRE. If you want is a single, common relative risk estimate across the levels of RETIRE (probably not advisable if the interaction is significant) then the second LSMEANS statement provides that in the Exponentiated column of the Differences table. The E option shows how it is constructed, which by default treats the RETIRE levels in a balanced way. You can use the OM option in the LSMEANS statement if the RETIRE levels are not balanced.

```
proc genmod desc;
class dep retire/ref=first;
model death=dep|retire/d=b link=log;
lsmeans dep*retire/ilink diff exp;
lsmeans dep / ilink diff exp e;
run;
```

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

Thank you for your reply!

To explain how one variable modifies the other, I need to estimate a risk ratio for each level of the modifier. In other words, I need to estimate one risk ratio at the level of retire=1 and the other risk ratio at the level of retire=0, but use the same references (i.e., the group who had exposed neither of the two variables). This is recommended by this paper (Table 6 on page 48).

https://www.hsph.harvard.edu/wp-content/uploads/sites/603/2018/04/InteractionTutorial_EM.pdf

The SAS syntax that I made estimated the two risk ratios using two different reference groups (Table 5 on the same page).

Would you help me in this regard?

Thanks again!

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

By the way, this is what I need:

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

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

Many thanks. The issue has been solved. Hongjie

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 25. Read more here about **why** you should contribute and **what is in it** for you!

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.