- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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)?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just add the diff option to the lsmeans statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It only gives CI for each fixed parameter estimates, I need CI for the linear combination, i.e. 4.8+(-4.7)=0.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just add the diff option to the lsmeans statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;