02-15-2016 02:21 PM
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;
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)?
02-15-2016 03:01 PM - edited 02-15-2016 03:02 PM
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
02-15-2016 03:16 PM - edited 02-15-2016 03:19 PM
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;
02-15-2016 03:48 PM
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.
02-15-2016 05:12 PM - edited 02-15-2016 05:13 PM
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;
Need further help from the community? Please ask a new question.