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;
contrast 'hypotheis' , class 1 vs class 2 alpha=0.01;
Thanks in advance!
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;
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:
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;
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;
and dis worked. just posting for info
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 .
12-12-2014 07:14 PM
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.