Programming the statistical procedures from SAS

Using CONTRAST or ESTIMATE to test for simple effects

Reply
Occasional Contributor
Posts: 5

Using CONTRAST or ESTIMATE to test for simple effects

[ Edited ]

Hello everyone!

 

I am using PROC GLM to test some models for some result from out experiments and we have some pre-planned contrasts.

 

We have two classification variables CLASSVAR_01 and CLASSVAR_02. The former has 2 levels and the latter has 4 levels. We are running the analysis for about 20 dependent variables. Each dependent variable by default are supposed to have 4 replicates, however there are quite a number of missing values within the observations.

 

I understand that using the SLICE= option on the LSMEANS can be used to output the test for a "simple effect," as can CONTRAST and ESTIMATE options with the appropriate coefficients on the variables of interest to us. Of course, both of options are available in PROC GLM and PROC MIXED.

 

Which of ESTIMATE and CONTRAST would be more appropriate to handle the simple effect comparison between the classification variables despite the presence of missing values in some of the recorded observations for our dependent variables.

 

Thanks in advance for your help!

 

Dami.

 

 

Respected Advisor
Posts: 3,066

Re: Using CONTRAST or ESTIMATE to test for simple effects

[ Edited ]
Posted in reply to dammie_101

I would use LSMEANS to compare levels of the same variable. 

 

I would not use CONTRAST or ESTIMATE because they require more work on your part, although I would expect they would produce the same results.


CONTRAST and ESTIMATE are useful only when you have some linear combination of levels you want to test or estimate, other than combinations that involve only a single -1 and a single +1 and possibly one or more zeros in the equation of the linear combination; for example if you want a contrast of -1 2 -1, then you have to use the CONTRAST statement; if you want a contrast of -1 0 1 (which is the simple effect comparison you mentioned) don't do this via CONTRAST statements.

--
Paige Miller
Occasional Contributor
Posts: 5

Re: Using CONTRAST or ESTIMATE to test for simple effects

[ Edited ]
Posted in reply to PaigeMiller

Thank you very much for your reply Mr. Paige. 

 

May i ask why you suggested to not use contrast for the kind of simple effect which we are interested in?

If I may elaborate...

 

The levels of CLASSVAR_01 are AA and BB...

The levels of CLASSVAR_02 are 0000, 1111, 2222 and 3333.

 

We want to test for DEPENDENT_VAR_Q  with respect to the class variables in this form;

 

AA_0000 vs BB_0000;

 

I consulted a couple of academic articles to guide on how to develop constrast coefficients and

I have constructed a contrast coefficient for this linear combination and my code looks something like this:

 

PROC GLM DATA = EXP_02 ORDER = DATA;

CLASS classvar_01 classvar_02;

MODEL dependent_var_q = classvar_01 classvar_02 classvar_01*classvar_02;

CONTRAST  'L1-of-class1 at L2 of class2 VS L2-of class1 at L2 of class2'

                      classvar_01 1 -1 classvar_01*classvar_02 0 1 0 0 0 -1 0 0;

run;

 

do you think i would run into a problem with this?

 

Thank you once again!

 

Respected Advisor
Posts: 3,066

Re: Using CONTRAST or ESTIMATE to test for simple effects

Posted in reply to dammie_101

LSMEANS for the interaction of CLASSVAR_01 and CLASSVAR_02 gives you this without constructing a CONTRAST or ESTIMATE statement, I don't see why you want to do the additional work to create CONTRAST or ESTIMATE statements.

--
Paige Miller
Occasional Contributor
Posts: 5

Re: Using CONTRAST or ESTIMATE to test for simple effects

Posted in reply to PaigeMiller

Yes, I do understand.

 

However, the comparison-wise error rate which arises with multiplicity of testing is avoided (at least that is what I am inclined to think).

 

And these two groups are basically of high importance to the study, hence the reason behind the pre-planned comparison between them. Results that we have collated from other experiments have have exhibited a trend for these groups and we are trying to define this trend.

Respected Advisor
Posts: 3,066

Re: Using CONTRAST or ESTIMATE to test for simple effects

Posted in reply to dammie_101

@dammie_101 wrote:

Yes, I do understand.

 

However, the comparison-wise error rate which arises with multiplicity of testing is avoided (at least that is what I am inclined to think).


The PDIFF option of LSMEANS allows you to specify if you want the T test option (not controlling for multiplicity of testing) or the TUKEY option (which does control for multiplicity of testing). Seems like you want the T test option.

--
Paige Miller
Occasional Contributor
Posts: 5

Re: Using CONTRAST or ESTIMATE to test for simple effects

Posted in reply to PaigeMiller

Separate from the aforementioned test, we actually intend to subject all other class combinations to a post-hoc test. Would it be appropriate to use the following code...

..............

LSMEANS classvar_01*classvar_02 /LINES ADJUST = TUKEY;

RUN;

 

....or would you be kind enough to help with the code which matches what you said in your last reply?

Respected Advisor
Posts: 3,066

Re: Using CONTRAST or ESTIMATE to test for simple effects

Posted in reply to dammie_101

Yes, if the LINES statement works on interaction effects, then go ahead and use it. (Somewhere in the back of my mind, I thought LINES doesn't work on interactions, but this isn't stated in the documentation, so if it works, that's the way to go)

--
Paige Miller
Ask a Question
Discussion stats
  • 7 replies
  • 116 views
  • 0 likes
  • 2 in conversation