Hello,
Never use ESTIMATE or CONTRAST statements when you can also achieve the wished for analyses by using LSMEANS, SLICE, or LSMESTIMATE statements.
If ESTIMATE or CONTRAST statements cannot be avoided, take care because they are sometimes difficult to specify (program) correctly. Below are some blogs and usage notes on correct usage!
The magical ESTIMATE (and CONTRAST) statements
By Chris Daman on SAS Learning Post April 23, 2012
https://blogs.sas.com/content/sastraining/2012/04/23/the-magical-estimate-and-contrast-statements/
"Easy button" for ESTIMATE statements
By Chris Daman on SAS Learning Post April 25, 2012
https://blogs.sas.com/content/sastraining/2012/04/25/easy-button-for-estimate-statements/
ESTIMATE Statements - the final installment
By Chris Daman on SAS Learning Post May 2, 2012
https://blogs.sas.com/content/sastraining/2012/05/02/estimate-statements-the-final-installment/
How to write CONTRAST and ESTIMATE statements in SAS regression procedures?
By Rick Wicklin on The DO Loop June 6, 2016
https://blogs.sas.com/content/iml/2016/06/06/write-contrast-estimate-statements-sas-regression-procedures.html
Usage Note 24447: Examples of writing CONTRAST and ESTIMATE statements
https://support.sas.com/kb/24/447.html
Usage Note 67024: Using the ESTIMATE or CONTRAST statement or Margins macro to assess continuous variable effects in interactions and splines
67024 - Using the ESTIMATE or CONTRAST statement or Margins macro to assess continuous variable effects in interactions and splines (sas.com)
When a model contains interactions, it is often of interest to assess the effect of one of the interacting variables. When the variable of interest is categorical, and therefore is specified in the CLASS statement, this is most easily done using the LSMEANS, SLICE, or LSMESTIMATE statement. But when the variable of interest is continuous, these statements cannot be used. Two procedures, LOGISTIC and PHREG, provide statements that can estimate the effect of increasing a continuous predictor by a specified number of units. However, when the modeled response is not binomial or a time to event, these procedures are not appropriate. Nevertheless, the HAZARDRATIO statement in PROC PHREG can still be used to provide contrast coefficients that can be used in CONTRAST or ESTIMATE statements to test or estimate the effect of a continuous predictor. This can be done for a continuous predictor involved in one or more interactions and even in constructed effects such as splines. In the case of generalized linear models that don’t use the identity link, it is important to note that the estimated effect using these coefficients is not a difference in response means. For these models, an alternative and generally easier solution is provided by the Margins macro, which can estimate the required difference in means. Both of these approaches are discussed and illustrated in this note.
Koen
... View more