BookmarkSubscribeRSS Feed

Examples of writing CONTRAST and ESTIMATE statements

Started ‎12-06-2022 by
Modified ‎12-07-2022 by
Views 646

The article described below can be seen in this SAS Note.

 

The CONTRAST and ESTIMATE statements allow for estimation and testing of any linear combination of model parameters. However, a common subclass of interest involves comparison of means and most of the examples below are from this class. While examples in this class provide good examples of the above process for determining coefficients for CONTRAST and ESTIMATE statements, there are other statements available that perform means comparisons more easily. These statements include the LSMEANS, LSMESTIMATE, and SLICE statements that are available in many procedures. The ODDSRATIO statement in PROC LOGISTIC and the similar HAZARDRATIO statement in PROC PHREG are also available. While the main purpose of this note is to illustrate how to write proper CONTRAST and ESTIMATE statements, these additional statements are also presented when they can provide equivalent analyses.

 

This note focuses on assessing the effects of categorical (CLASS) variables in models containing interactions. All of the statements mentioned above can be used for this purpose. To assess the effects of continuous variables involved in interactions or constructed effects such as splines, see this note. Note that some functions, like ratios, are nonlinear combinations and cannot generally be obtained with these statements. To estimate, test, or compare nonlinear combinations of parameters, see the NLEST and NLMeans macros.

Version history
Last update:
‎12-07-2022 10:06 AM
Updated by:
Contributors

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags