Hello all,
I'm running mixed models using PROC MIXED.
Here are my codes:
proc mixed data=try covtest;
class month pid;
model outc=age male month|treatment / s;
random int / subject=pid;
run;
Results:
Standard
Effect month Estimate Error DF t Value Pr > |t|
treatment 4.8044 0.7133 12E3 6.74 <.0001
treatment*month 4 -4.6793 1.1857 12E3 -3.95 <.0001
treatment*month 5 -3.3753 0.8922 12E3 -3.78 0.0002
treatment*month 6 -2.9591 0.8697 12E3 -3.40 0.0007
treatment*month 7 -0.3250 0.8824 12E3 -0.37 0.7126
treatment*month 8 0 . . . .
I want to get the treatment effects in each month, i.e. 4.8 + (-4.7) = 0.1 in month 4, 4.8 + (-3.4) = 1.4 in month 5. Is there any way to get confidence intervals for the calculated values (0.1, 1.4, etc)?
Just add the diff option to the lsmeans statement.
Have you tried adding CL to your MODEL statement?
model outc=age male month|treatment / s CL;
displays confidence limits for fixed-effects parameter estimates |
It only gives CI for each fixed parameter estimates, I need CI for the linear combination, i.e. 4.8+(-4.7)=0.1
Use the LSMEANS statement, with a CL option.
proc mixed data=try covtest; class month treatment pid; /*notice that I have added treatment as a class effect */ model outc=age male month|treatment / s; random int / subject=pid; LSMEANS month*treatment/cl; run;
Steve Denham
Thanks Steve.
I tried your codes, LSMEANS show CI for the means of the outcome variable in each specified groups, not exactly what I was trying to calculate.
I want to get CI for 4.8+(-4.7)=0.1. It won't be significant if CI spans zero.
Just add the diff option to the lsmeans statement.
Great! I got it right, thanks Steve and lvm.
Here are my complete codes for share.
ods output diffs=diffdata;
proc mixed data=try covtest;
class month pid treatment;
model outc=age male month|treatment / s;
lsmeans month*treatment / cl diff;
random int / subject=pid;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.