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
- /
- SAS Procedures
- /
- Heterogeneity test for multinomial logistic regres...

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

04-09-2012 04:34 PM

Good day:

I'm wondering how I can test for a trend across outcome categories in multinomial logistic regression? I have four different durations of breastfeeding and several different predictor variables and I would like a p-value for trend for each predictor.

Here is my code:

**surveylogistic** data=final;

ebf (ref='5.5-6.5') hs_q01 (Ref='english OR FRENCH or other') supplement (ref='yes')prenat (Ref='lo') rigon (ref='two') ;

ebf=supplement/link=glogit;

weight weight_ch;

strata community;

run;

I've tried a test statement, but I can't seem to get the code to run. Any help is greatly appreciated.

Accepted Solutions

Solution

04-10-2012
11:48 AM

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

04-10-2012 11:48 AM

Try a simplified program first:

proc surveylogistic data=final;

class hs_q01(ref='1');

model ebf(ref='1') = hs_q01 / glogit;

test intercept = intercept1;

run;

and see if that will work. We can then build from there.

PG

PG

All Replies

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

04-09-2012 07:58 PM

K, your code didn't copy too well (known problem...). I'm assuming proc, class and model statements. From the doc, seems like the test statement should read :

Hetero: test intercept = intercept1 = intercept2 = intercept3;

What message do you get?

PG

PG

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

04-09-2012 08:45 PM

Yes. Proc, class, and model statements. Thanks for catching that cut and paste error, PG.

I was able to deduce that the appropriate code was what you provided: test intercept: intercept1=intercept2=intercept3 but I'm not sure how I can re-code my variables so that SAS recognizes that 'intercept1' is, say the intercept of hs_q01 for EBF duration 1 and intercept 2 is the intercept of hs_q01 EBF duration 2. I'm getting the error message that the variable is not in my model, which is what I expected. Is this because i've used class statements instead of dummy variables?

I was thinking of outputting my intercepts into another database and then re-running the code, but my SAS/statistics knowledge is a bit lacking.

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

04-09-2012 09:18 PM

K, I am not clear as to what you want exactly. Your model statement relates **ebf** to **supplement** only. Your other variables** hs_q01**, **prenat** and** rigon** are NOT in the model. Mentionning them in a CLASS statement merely informs SAS of their categorical nature and reference level. It does not include them in your model. In the test statement I proposed (that's an equal sign after intercept) there is one intercept for each level of your outcome variable. Try it also without intercept4, I'm not sure its needed.

Good luck.

PG

PG

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

04-10-2012 10:49 AM

Thanks PG. That was careless - of course hs_q01 isn't in the model I pasted. Are you saying my code should look like this?

proc surveylogistic;

class ebf (ref='1') hs_q01 (ref='1');

model ebf=hs_q01/glogit;

weight weight_ch;

strata community;

test intercept1=intercept2 OR

test hs_q011=hs_q012?

run;

This isn't running. I don't have an 'intercept1, 2 etc' or a hs_q011 in my model that I've defined. Right?

Solution

04-10-2012
11:48 AM

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

04-10-2012 11:48 AM

Try a simplified program first:

proc surveylogistic data=final;

class hs_q01(ref='1');

model ebf(ref='1') = hs_q01 / glogit;

test intercept = intercept1;

run;

and see if that will work. We can then build from there.

PG

PG

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

05-03-2012 03:12 PM

So, I tried the codes today on a diferent data set and they worked! Thanks for the help.