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
- /
- General Programming
- /
- How to estimate Relative Risk using a Multinomial ...

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
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-18-2017 07:08 PM

Hello SAS friends,

Please bear with me, I am a coding beginner and am not qualified to invoke macros. I use SAS Studio, University Edition.

I have a categorical response variable with 4 levels (DENV_CNTL2, levels 1, 3, 4, 5).

I have a continuous predictor variable (RBP4_ADJC).

Additional predictor variables include (Age, continuous; Sex, binary; Fever, binary).

I would like to run a multinomial logistic regression first with only 1 continuous predictor variable. I would like to run subsequent models with the additional predictor variables (categorical and continuous).

I have read that it's possible to estimate relative risk with PROC LOGISTIC using the %NLEstimate macro. I am having trouble writing the f or fdata parameters of this macro based on my variables. I have also never used a macro.

The code is below, and the output is attached.

PROC LOGISTIC DATA=Suze.ECData;

CLASS DENV_CNTL2 (ref = 1) / param = ref;

MODEL DENV_CNTL2=RBP4_ADJC / RL link=glogit;

STORE OUT=NLE;

RUN;

%NLEstimate(INSTORE=NLE, f=..... ???)

Thank you kindly!

Suze

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

Posted in reply to suze152

12-18-2017 08:58 PM - edited 12-18-2017 08:59 PM

If something is new, find a fully worked example, ensure you can replicate the results and then try and apply it to your data.

Here’s the one for what you’re looking for.

http://support.sas.com/kb/57/798.html

Calling a macro is the same as using a function in Excel. You put the right things in the function and you get results.

Learning to use one is very straightforward, writing them is a different story. There no qualifications required to run macros besides a willingness to try it.

suze152 wrote:

Hello SAS friends,

Please bear with me, I am a coding beginner and am not qualified to invoke macros. I use SAS Studio, University Edition.

I have a categorical response variable with 4 levels (DENV_CNTL2, levels 1, 3, 4, 5).

I have a continuous predictor variable (RBP4_ADJC).Additional predictor variables include (Age, continuous; Sex, binary; Fever, binary).

I would like to run a multinomial logistic regression first with only 1 continuous predictor variable. I would like to run subsequent models with the additional predictor variables (categorical and continuous).

I have read that it's possible to estimate relative risk with PROC LOGISTIC using the %NLEstimate macro. I am having trouble writing the f or fdata parameters of this macro based on my variables. I have also never used a macro.

The code is below, and the output is attached.PROC LOGISTIC DATA=Suze.ECData;

CLASS DENV_CNTL2 (ref = 1) / param = ref;

MODEL DENV_CNTL2=RBP4_ADJC / RL link=glogit;

STORE OUT=NLE;

RUN;%NLEstimate(INSTORE=NLE, f=..... ???)

Thank you kindly!

Suze

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

Posted in reply to Reeza

12-25-2017 09:07 PM

Dear Reeza,

Thank you for your reply and helpful link. I have been following your suggested link and the example in the "Using PROC LOGISTIC and the NLEstimate macro" section.

I have not been able to find an example using a continuous predictor variable. How will a continuous predictor variable change the application of the NLEstimate macro?

I would like some guidance on how to write the datalines for the data set specified in the **fdata=fd** NLEstimate macro parameter. Please see the "shownames" in the screenshot attached.

I am also unsure of my degrees of freedom parameter in the NLEstimate macro.

data fd;

length label f $32767;

infile datalines delimiter='|';

input label f;

datalines;

P(3)/P(1)| exp(b_p1+b_p4)

P(4)/P(1)| exp(b_p2+b_p5)

P(5)/P(1)| exp(b_p3+b_p6)

P(3)/P(4)| exp(b_p1+b_p4-b_p2-b_p5)

P(3)/P(5)| exp(b_p1+b_p4-b_p3-b_p6)

P(4)/P(5)| exp(b_p2+b_p5-b_p3-b_p6);

%NLEstimate(instore=NLE, fdata=fd, df=?)

Thank you!

Suze