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.
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.
Great! Thank you both!
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.
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.
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.