SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChuksManuel
Pyrite | Level 9

Can anyone help me figure out how i can write a contrast statement for a 3 variable model....each model having only 2 levels (coded 0,1) in SAS. I can't find anywhere that explains this concept well. I am trying to work off this example, but it used a 2 variable model and each variable with 3 levels. Please i need help.

proc logistic data = logit_sim desc;
class x1 (ref = '1') x2 (ref = '1') / param=ref;
model y = x1 x2;
contrast 'x1 = 1 x2 1 v 2' x2 1    /e estimate = parm;
contrast 'x1 = 1 x2 1 v 3' x2 0 1  /e estimate = parm;
contrast 'x1 = 1 x2 2 v 3' x2 1 -1 /e estimate = parm;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Contrasts are generally not needed to compare one level to another. Instead, you can use the LSMEANS statement which has any number of options available to do statistical testing.


Contrasts are generally needed when you want to compare more complicated relationships than "is one level different than another level", for example, if you wanted to evaluate if 3*(mean of level 1)–2*(mean of level 2)–0.5*(mean of level 3).

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

Contrasts are generally not needed to compare one level to another. Instead, you can use the LSMEANS statement which has any number of options available to do statistical testing.


Contrasts are generally needed when you want to compare more complicated relationships than "is one level different than another level", for example, if you wanted to evaluate if 3*(mean of level 1)–2*(mean of level 2)–0.5*(mean of level 3).

--
Paige Miller

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 610 views
  • 0 likes
  • 2 in conversation