Hi,
I'm using the following code.
ods graphics on;
ods output lsmeans=estimate
diffs=diff;
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;
ods output close;
ods graphics off;
The aim is to get the LS means, SE and the difference of LS means and SEs from plcebo(treatn=3) to each of the treatments (treatn=1,2) as 'placebo - treatment. I believe currently the code is generating the diffrence other way round as (treatment - placebo).
Need to know how to reverse the direction of difference to get the difference.
Thanks
From the top of my head:
1) Change the sign of variable aval (this will also change the sign of residuals),
or
2) Change the sign of LS means and confidence interval limits (if any) in lsmeans and diffs datasets.
Make sure you label those differences appropriately in your result tables, since you are going against standard practice.
From the top of my head:
1) Change the sign of variable aval (this will also change the sign of residuals),
or
2) Change the sign of LS means and confidence interval limits (if any) in lsmeans and diffs datasets.
Make sure you label those differences appropriately in your result tables, since you are going against standard practice.
Use an LSMESTIMATE statement that utilizes the coefficients in the direction of interest. For example,
lsmestimate treatn 'Placebo - trt 1' -1 0 1,
'Placebo - trt 2' 0 -1 1;
SteveDenham
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.