BookmarkSubscribeRSS Feed
Martina4
Calcite | Level 5

What does the SAS warning "Tests for SIMPLE effect Harvest are not performed because no LSMEANS effects other than itself contain it" mean?

 

I am trying to run statistics are different harvesting yield from my study but keep getting this message following my lsmeans code.

Here is my code:

 

proc sort data=WORK.SSG2016harvests;
by block legume trt harvest;
run;
proc mixed;
class legume trt harvest;
model sorgyd = harvest;
random block;
lsmeans harvest / slice=harvest diff;
contrast 'cut 1 vs cut 2' harvest 1 -1 0 0;
contrast 'cut 1 vs cut 3' harvest 1 0 -1 0;
contrast 'cut 1 vs cut 4' harvest 1 0 0 -1;
contrast 'cut 2 vs cut 3' harvest 0 1 -1 0;
contrast 'cut 2 vs cut 4' harvest 0 1 0 -1;
contrast 'cut 3 vs cut 4' harvest 0 0 1 -1;
run;

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I don't think that you can use HARVEST in two places in the LSMEANS statement.

--
Paige Miller
ballardw
Super User

From proc mixed documentation:

SLICE= fixed-effect | (fixed-effects)

specifies effects by which to partition interaction LSMEANS effects. This can produce what are known as tests of simple effects (Winer 1971). For example, suppose that A*B is significant, and you want to test the effect of A for each level of B. The appropriate LSMEANS statement is as follows:

lsmeans A*B / slice=B;

 

 

 

Since HARVEST has no interaction term in the first part of the LSMEANS, (and no other variables in the model statement to interact with) the slice option has nothing to partition.

 

I believe this syntax should use the slice option but whether the model is what you need or want is another story:

proc mixed;
class legume trt harvest;
model sorgyd = harvest legume trt;
random block;
lsmeans harvest*trt / slice=harvest diff;
contrast 'cut 1 vs cut 2' harvest 1 -1 0 0;
contrast 'cut 1 vs cut 3' harvest 1 0 -1 0;
contrast 'cut 1 vs cut 4' harvest 1 0 0 -1;
contrast 'cut 2 vs cut 3' harvest 0 1 -1 0;
contrast 'cut 2 vs cut 4' harvest 0 1 0 -1;
contrast 'cut 3 vs cut 4' harvest 0 0 1 -1;
run;

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 702 views
  • 0 likes
  • 3 in conversation