BookmarkSubscribeRSS Feed
jgreenberg321
Fluorite | Level 6

Thank you very much for the detailed explanation. Overall, that makes a lot of sense and is very much appreciated! One quick follow-up: it seems like the difference in lsmeans should help us understand the effect size of the desired comparison, but is there an easy method for determining statistical significance of the specified comparison? If not, that's OK.  

PaigeMiller
Diamond | Level 26

Yes, both the LSMEANS statement and the SLICE statement have a number of options that will produce significance tests. See the SAS documentation for details.

--
Paige Miller
jgreenberg321
Fluorite | Level 6

Great! Thank you both!

StatDave
SAS Super FREQ

You can use a single SLICE statement as I showed before even though there are other interactions including a 3-way interaction. Comparisons like we are discussing are all just comparisons of estimates produced by linear combinations of model parameters. The LSMEANS, SLICE, and LSMESTIMATE statements all estimate and test linear combinations of model parameters just like is done in ESTIMATE or CONTRAST statements. They just determine the coefficients of the linear combinations for you which is why they are preferred to the ESTIMATE and CONTRAST statements where you must properly determine the coefficients. See this note that discusses all of this in detail with lots of examples. Just like in the LSMEANS statement, you can add the E option in the SLICE statement to see the coefficients that the statement uses. If you want different coefficients, you can add other options (like OM/OM= and BYLEVEL - see the SLICE and LSMEANS documentation) or you can use these coefficients as a starting point for doing a specialized ESTIMATE or CONTRAST statement, though you still have to specify coefficients that define an estimable contrast.

jgreenberg321
Fluorite | Level 6

Thank you for pointing that all out. One other thing that was pointed out to me is that treating all of my binary (0/1) variables as numerical rather than categorical predictors simplified the specifications. To obtain the correct p-value, I could then do something as simple as:

 

estimate 'triple interaction' race_dichot*exposure*period 1;

 

This doesn't work for obtaining least squared means, but does seem like a good/simple approach for getting p-values for terms. 

StatDave
SAS Super FREQ

There is no reason to use that ESTIMATE statement since it just re-estimates the interaction parameter that will already appear (with a test) in the Parameter Estimates table. ... or, it would if that were an estimable contrast.

jgreenberg321
Fluorite | Level 6
Right. Though I can combine that with other terms to test joint hypotheses, with a simplified specification format. I know the other approaches work too, but I had a harder time figuring out all of the relevant coefficients.
StatDave
SAS Super FREQ
... which is why I suggest not using the CONTRAST or ESTIMATE statement at all.
jgreenberg321
Fluorite | Level 6
I understand that. I just haven't fulled grasped how one can test multiple joint hypotheses using slice or lsmestimate without specifying coefficients. I'm sure it is possible, but I just do not quite understand it. In one of the examples you linked, they showed:


proc logistic data=uti;
freq count;
class diagnosis treatment/param=glm;
model response = diagnosis treatment diagnosis*treatment;

lsmestimate diagnosis*treatment 'A vs C complicated' 1 0 -1 / exp;

run;

They explain how this compares the first and third values from the lsmeans table. While I had some difficulty making the same extrapolations to other models, it seems like the harder problem is then combining terms (e.g. treatment*diagnosis AND diagnosis are > 0). Again, I'm sure that is possible, but I just haven't really gotten it using the other approaches.

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
  • 23 replies
  • 6379 views
  • 5 likes
  • 4 in conversation