BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChuksManuel
Pyrite | Level 9

Hello statisticians,

Please i'll be glad to get any input on this as mixed models are not my strong suit. It's a clinical trial data comparing 2 treatments. 

I want to know

1. if the two treatments differ in their effects on length (outcome)
2. If there's a  difference in the pattern of  change between subjects receiving the two treatments and if  one treatment show results more quickly? 

Attached is my code

proc mixed data= new1 COVTEST method=ml;
Class ID treat monthcat;
MODEL lenght= month  treat month*treat /solution;
RANDOM intercept month /SUB=ID TYPE=UN G V;
 repeated  monthcat/subject=id type=toep  r ;
run;

 

ChuksManuel_0-1587622147898.png

 

My thought is that Number 1 is asking for treatment effects on outcome, so i will use -0.1278. But what does the negative effect mean?

Then what does "pattern of change" imply in number 2. Is it the treatment*time effect?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

@ChuksManuel wrote:

Hello statisticians,

Please i'll be glad to get any input on this as mixed models are not my strong suit. It's a clinical trial data comparing 2 treatments. 

I want to know

1. if the two treatments differ in their effects on length (outcome)
2. If there's a  difference in the pattern of  change between subjects receiving the two treatments and if  one treatment show results more quickly? 

Attached is my code

proc mixed data= new1 COVTEST method=ml;
Class ID treat monthcat;
MODEL lenght= month  treat month*treat /solution;
RANDOM intercept month /SUB=ID TYPE=UN G V;
 repeated  monthcat/subject=id type=toep  r ;
run;

 

ChuksManuel_0-1587622147898.png

 

My thought is that Number 1 is asking for treatment effects on outcome, so i will use -0.1278. But what does the negative effect mean?

Then what does "pattern of change" imply in number 2. Is it the treatment*time effect?

 

 


Question 1: there is no statistically significant effect due to the main effect of TREAT. You can see this because the effect of TREAT=1 has a large p-value, which is in the PR>|t| column (a p-value>0.05 indicates the effect is not statistically significant, not different than a zero effect, with type I error rate of 0.05).

 

Question 2: There is a statistically significant effect due to MONTH. There is also a significant interaction effect MONTH*TREAT, which could indicate that the change in the effect of TREAT=1 due to MONTH is different than the change in effect of TREAT=2 due to MONTH.

--
Paige Miller

View solution in original post

6 REPLIES 6
PaigeMiller
Diamond | Level 26

@ChuksManuel wrote:

Hello statisticians,

Please i'll be glad to get any input on this as mixed models are not my strong suit. It's a clinical trial data comparing 2 treatments. 

I want to know

1. if the two treatments differ in their effects on length (outcome)
2. If there's a  difference in the pattern of  change between subjects receiving the two treatments and if  one treatment show results more quickly? 

Attached is my code

proc mixed data= new1 COVTEST method=ml;
Class ID treat monthcat;
MODEL lenght= month  treat month*treat /solution;
RANDOM intercept month /SUB=ID TYPE=UN G V;
 repeated  monthcat/subject=id type=toep  r ;
run;

 

ChuksManuel_0-1587622147898.png

 

My thought is that Number 1 is asking for treatment effects on outcome, so i will use -0.1278. But what does the negative effect mean?

Then what does "pattern of change" imply in number 2. Is it the treatment*time effect?

 

 


Question 1: there is no statistically significant effect due to the main effect of TREAT. You can see this because the effect of TREAT=1 has a large p-value, which is in the PR>|t| column (a p-value>0.05 indicates the effect is not statistically significant, not different than a zero effect, with type I error rate of 0.05).

 

Question 2: There is a statistically significant effect due to MONTH. There is also a significant interaction effect MONTH*TREAT, which could indicate that the change in the effect of TREAT=1 due to MONTH is different than the change in effect of TREAT=2 due to MONTH.

--
Paige Miller
SteveDenham
Jade | Level 19

Many times it is hard to decipher the SOLUTION vector, but @PaigeMiller has done a great job here.  Alternatively, look at the table of Type 3 tests.  You should see the following significance levels:

Month                 <0.0001

Treat                    0.5887

Month*Treat         0.0026

 

The p values and thus the inferences are the same as for t tests in the SOLUTION vector.

 

Now if you add an LSMEANS statement like this:

 

LSMEANS month treat month*treat/diff;

 

You will see that the difference between the main effects of treatment is 0.1278, with treatment 2 being greater by this amount.

 

SteveDenham

SteveDenham
Jade | Level 19

I just noticed something else curious (which is my way of saying oops, I missed something important).  You have month as a continuous variable in the model and monthcat as an effect in the random statement.

Consequently, you wont be able to include month or month*treat in the LSMEANS statement.

Interpretation of the Month effect now is wholly dependent on the values in the solution vector.  For month, there is an increase in length for treatment 2 of 0.4220 per month, whereas for treatment 1, it is (0.4220 - 0.1460 = 0.2760).  The test for month is whether that slope (here associated with treatment 2, the reference group) is different from zero.  The test after month*treat 1 is whether the slopes differ significantly.  Note that there is no specific test whether the slope associated with treatment 1 is different from zero.

You could get this test, but not the test of differences/interaction, by including a NOINT option in the model statement.

 

SteveDenham

ChuksManuel
Pyrite | Level 9
Thank you for the clarification
StatsMan
SAS Super FREQ

A bit more clarification. The /E3 option added to the MODEL statement will help you understand what hypotheses are being tested in the type-3 tests that PROC MIXED produces. If you want to play along at home 🙂 here is some simulated data that comes close to the situation you have:

 

 

data new1;
   call streaminit(672435);
   do id=1 to 200;
      treat=ceil(rand("uniform")*2);
      do month=1 to 6;
	     monthcat=month;
         length=2+month+rand("normal")*.5;
		 if treat=2 then length=length+month*treat/5;
		 output;
   end; end;
run;

proc mixed data= new1 COVTEST method=ml;
Class ID treat monthcat;
MODEL length= month  treat month*treat /solution e3;
RANDOM intercept month /SUB=ID TYPE=UN G V;
 repeated  monthcat/subject=id type=toep  r ;
lsmeans treat / at month=0 pdiff;
run;

The /E3 option will show the L vector used to produce the type-3 hypothesis tests. As @PaigeMiller so eloquently stated, you have to understand what the parameter estimates in the solution vector represent as well. Understanding the GLM parameterization of your class effects helps here, too. 

 

With this data and model, you get a solution vector (beta) of:

StatsMan_0-1587746709078.png

The interpretation of these parameters is crucial to understanding your hypothesis tests. Note the 0's in the parameters. They are there by design, a result of using the GLM parameterization of the class effect TREAT. The INTERCEPT estimate here is the effect of TREAT=2. The estimate for TREAT=1 is the difference between TREAT=1 and TREAT=2. The estimate for MONTH is the slope on month for TREAT=2. The estimate for MONTH*TREAT=1 is the difference in the slopes on MONTH for TREAT=1 vs TREAT=2. 

 

Let's look a little more at the parameter estimate for TREAT=1. That estimate is testing the difference between the effect of TREAT=1 vs TREAT=2. You can see that the p-value for this parameter estimate and the p-value for the type-3 test on TREAT:

StatsMan_1-1587747171537.png

 

But, we have an interaction in this model between TREAT and MONTH. Does the presence of that interaction influence how we interpret this test? Yep. Let's look at the result of the /E3 option for the TREAT test:

StatsMan_2-1587748004707.png

This test is comparing the two levels of treat, which are actually the intercepts of the two regression lines this model fits. So, at what value of MONTH are we comparing the levels of treat? At MONTH=0! That is probaby not an interesting comparison for the researcher here. 

 

In the code above, there is an LSMEANS statement that replicates the type-3 test on TREAT. Here is the result of that LSMEANS statement:

StatsMan_3-1587748310484.png

The difference in the LSMEANS at MONTH=0 reproduces the type-3 test on TREAT. You can also see that the parameter estimates for TREAT are reproduced from the solution vector. We see the intercept value from the solution vector as the LSMEAN for TREAT=2 and the sum of the intercept and the estimate for TREAT=1 as the LSMEAN for for TREAT=1.

 

So, the TREAT comparison at MONTH=0 is probably not a very interesting comparison. We can change that month value using the AT option on the LSMEANS statement. Try changing this to AT MONTH=6. Now the output for the LSMEANS statement tests for a difference in the two treatments at month 6:

StatsMan_4-1587748577390.png

The test here is highly significant, and probably of much more use to the researcher. We can use other month values as well in additional LSMEANS statements to see when the difference in the treatment methods becomes statistically important.

 

Sorry for the long post!

 

 

ChuksManuel
Pyrite | Level 9
Thank you so much for this explanation. I get it now!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6654 views
  • 3 likes
  • 4 in conversation