BookmarkSubscribeRSS Feed
dammie_101
Obsidian | Level 7

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.

 

 

7 REPLIES 7
PaigeMiller
Diamond | Level 26

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
dammie_101
Obsidian | Level 7

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!

 

PaigeMiller
Diamond | Level 26

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
dammie_101
Obsidian | Level 7

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.

PaigeMiller
Diamond | Level 26

@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
dammie_101
Obsidian | Level 7

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?

PaigeMiller
Diamond | Level 26

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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 2264 views
  • 0 likes
  • 2 in conversation