BookmarkSubscribeRSS Feed
deleted_user
Not applicable
We are working with a linear regression model that includes interaction terms. The regression output in SAS gives us parameter estimates for the interaction term, but my question is what if we wanted to look at the different contrasts between the two variables.

Example:

Interaction treat*sex. treat has two levels exp and control. our output gives the estimate for treat*sex but what about the estimates for exp*sex and control*sex?

In other procs I know there are options available such as the contrast, estimate and lsmeans statements. Is there something similar in proc reg? We have solved this problem by writing some code but wanted to know if there was an option built into proc reg that we were not aware of.

Secondly, if there was how would we then summarize the data using proc mianalyze?
2 REPLIES 2
Paige
Quartz | Level 8
There is no CONTRAST, ESTIMATE or LSMEANS statement in PROC REG.

Which leads me to ask, why don't you use PROC GLM or PROC MIXED or PROC GLIMMIX for this purpose? Message was edited by: Paige
deleted_user
Not applicable
Yes, I can definitely use proc glm but I am not sure how to then use MIANALYZE and summarize the lsmeans for all 5 imputations.

My model looks like this with txcode_ybocv26 and txcode_sex as my interaction terms:

proc reg data=yboc outest=outreg5 covout;
model ybocv8 = txcode ybocv26 comorbiddx sri2 qlqapv56 sex txcode_ybocv26 txcode_sex/clb; weight weight;
by _imputation_;
title "FINAL MODEL";
run;
proc mianalyze data=outreg5;
modeleffects intercept txcode ybocv26 comorbiddx sri2 qlqapv56 sex txcode_ybocv26 txcode_sex;
run;

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1976 views
  • 0 likes
  • 2 in conversation