BookmarkSubscribeRSS Feed
MM15
Calcite | Level 5

Hello,

I am using Proc Mixed for a 3 condition, 3 time point repeated measures analysis. I am attempting to use an estimate statement to assess change over time for the (1) 2 treatment conditions combined compared to the control condition and (2) the 2 treatment conditions compared to each other. I have searched notes and read everything I could find about the coding for estimates but I am still not getting it right. I don't understand how to code to compare the change over time across the groups rather than the group averages across the 3 time points. To simplify, I tried coding to compare Time 1 to Time 2 only, but it's still not working. Here is some of the code I have tried to calculate (1) above:

 

proc mixed data=e1_long;
class condition time ID;
model intent = condition time condition*time /solution;
repeated time/subject=id type=ar(1);
estimate 'Both Tx vs. Control-T1 vs T2'

time 1 -1 0 /*this coding will creates an estimate, but the way the condition*time is split up is wrong*/
condition 1 -.5 -.5/e;
estimate 'Both Tx vs. Control-T1 vs T2'

time 1 -1 0 /*this coding will not create an estimate*/
condition*time .3333 .3333 0
-.167 -.167 0
-.167 -.167 0/E;
lsmeans condition*time ;
run;

Can anyone help me with this coding?

6 REPLIES 6
jiltao
SAS Super FREQ

If you send in the Class Level Information table from the PROC MIXED output, that would be helpful for us to provide the ESTIMATE syntax. Also, do you want two treatments vs. control averaged overall all time points? or two treatments vs. control at time1 compared with two treatments vs. control at time2? For the two treatments comparison, do you want it to be averaged over all time points? or some specific time points? Or some something else? Please be more specific.

Thanks,

Jill

MM15
Calcite | Level 5

Thank you for your reply and patience with a novice proc mixed user. The output is attached. The question I want to answer is: is the change over time in my outcome measure between the 2 tx groups combined vs. the control group significantly different? (I am considering this analogous to the F-value for the condition*time result in the Type 3 Test of Fixed Effects output, except combining the results of the 2 tx groups into 1 group. By the way, I know the answer will be yes based on the results I have looked at, but I wanted a test statistic to report.) My second question is: is the tx1 group significantly different than the tx2 group? I realize I could run separate proc mixed models to get both of these answers, but I thought an advantage of proc mixed was that I could use the results from the one model to answer all of these questions.

jiltao
SAS Super FREQ

Thanks for providing additional information.

Please see if the following ESTIMAT statements work for you --

estimate '2 tx vs control'  condition -1 0.5 0.5;

estimate 'tx1 vs tx2' condition 0 1 -1;

Please give it a try and let us know how it goes.

Thanks,

Jill

MM15
Calcite | Level 5

Jill, I tried that statement at the beginning, but assumed the results cannot be what I'm looking for based on the findings. Please see attached the results with that coding (clearly not significant) compared to the results when I run a separate model with the 2 tx groups combined into one group (clearly significant). This comparison would have to be significant given the increase in the outcome measure over time for the tx groups and no increase for the control groups. 

jiltao
SAS Super FREQ

What the ESTIMATE statement does is to compare the conditions averaged over the three time points. From the output you sent, it seems to me that the average is pretty close between the control and the two treatments, so the results make sense to me.

If you want to compare the conditions at a specific time point, you might get the result you expected. For example,

estimate 'two tx vs control at time 1' condition -1 0.5 0.5 condition*time -1 0 0 0.5 0 0 0.5 0 0;

--Jill

Ksharp
Super User
That would be more simple to compare by LSMEANS or SLICE or LSMESTIMATE:

lsmeans condition*time /diff ;
lsmestimate condition*time 'condition1_time1- condition1_time2' 1 -1 0 0 0 0 0 0 0;
lsmestimate condition*time 'condition1_time1- condition1_time3' 1 0 -1 0 0 0 0 0 0;
slice condition*time / sliceby(condition='1') diff;

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 301 views
  • 1 like
  • 3 in conversation