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
- /
- need help

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

12-11-2014 07:30 PM

I have data with response variable(survived = yes or no) and independent variable (class= first class, second class, third class) and I want to do multiple comparison to test whether b co-efficient of class 1 = class 2 using SAS.

I was trying proc glm along with contrast statement. Can anyone please help how to structure this code to test at alpha level 0.01.

So far, I have used

proc glm data=titanic;

class class;

model survived=class;

contrast 'hypotheis' , class 1 vs class 2 alpha=0.01;

run;

Thanks in advance!

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

12-11-2014 09:20 PM

Couple of things:

1. You typically don't model binary response data with GLM, but something like proc logistic or logistic regression

2. The Titanic data actually has 4 class variables 1, 2, 3 and crew

I'm not sure how to write the contrast statements b/c they drive me nuts, but a basic proc logistic will produce the results:

**proc** **logistic** data=titanic;

class class (ref='1')/param=ref;

model survived(event='1') = class;

**run**;

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

12-11-2014 09:35 PM

Thank you. I wanted to test this at alpha 0.01? how can I do that.

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

12-11-2014 09:43 PM

I believe, though not certain, when you test something with a particular alpha, you're checking to see if the p-value is above or below that value to make your judgement of significance.

Here's a good reference on contrast/estimate statements in SAS:

http://support.sas.com/resources/papers/proceedings11/351-2011.pdf

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

12-12-2014 06:51 PM

Thank you everyone.

I asked my professor today and he told me to use this code

proc glm data=work.two;

class class;

model surviveds= class ;

estimate 'class 1 vs. class 2' class 1 -1 0;

estimate 'class 2 vs. class 3' class 0 1 -1;

estimate 'class 1 vs. class 3' class 1 0 -1;

run;

and dis worked. just posting for info

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

12-12-2014 07:02 PM

I'd ask about the fact that survived is a binary data point. But hey, what do I know

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

12-12-2014 11:38 PM

I'm glad to hear this is only a course problem and not part of some research as I would think that GENDER and AGE should also be included in the model. But hey, what do I know .

PG

PG

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

12-12-2014 07:14 PM

Hello reeza

I asked sas techncial support for help and even dey told glm is not used for binary data. They forwarded me with code using proc logistic. while i was discussing he did not clear this point. so i am still confused.