BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Arthur2
Calcite | Level 5

Hi,

I'm using proc mixed as follows:

proc mixed data = mydata (where=(treatn in (1,2,3))) plots=all;
by estremn estrem atypen atype paramcd param avisitn avisit ;
class treatn;
model aval = treatn base/residual outp=resid;
lsmeans treatn / pdiff=control('3');
run;

The difference of lsmeans and SE for 2 treatments (treatn=1,2) is required to be estimated from placebo (treatn=3) as 'placebo - treatment'. I believe currently pdiff is giving the difference as 'treatment - placebo'.
Help is required to reverse the direction of the difference so that I can get the difference of each treatment from placebo.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Arthur2,

 

You can use the LSMESTIMATE statement (instead of the PDIFF option of the LSMEANS statement) to request the statistics for these differences (or for more general linear combinations).

lsmeans treatn;
lsmestimate treatn 'placebo vs. trt 1' -1  0 1,
                   'placebo vs. trt 2'  0 -1 1;

View solution in original post

4 REPLIES 4
FreelanceReinh
Jade | Level 19

Hi @Arthur2,

 

You can use the LSMESTIMATE statement (instead of the PDIFF option of the LSMEANS statement) to request the statistics for these differences (or for more general linear combinations).

lsmeans treatn;
lsmestimate treatn 'placebo vs. trt 1' -1  0 1,
                   'placebo vs. trt 2'  0 -1 1;
SteveDenham
Jade | Level 19

@FreelanceReinh , nice to see that your answer matches mine.  This thread is duplicated, and I am not sure how to merge the two.

 

SteveDenham

FreelanceReinh
Jade | Level 19

@SteveDenham: That's funny. Rather, I am glad to see that my tentative idea matches a real expert's advice. 🙂

I wasn't aware of the duplicate thread. I think only moderators, super users and very few others have the privileges to merge threads.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 4 replies
  • 2066 views
  • 0 likes
  • 4 in conversation