BookmarkSubscribeRSS Feed
raja777pharma
Fluorite | Level 6

Hi Team,

I am new to Proc Mixed to use it for ANOVAL model.

 

As per below, i have to use Proc Mixed for ANCOVA model.

"The Change From Baseline in LSM compared between study treatments at week 48 using ANCOVA with study treatments as the main effect in the model and baseline score as a covariate."

 

In my dataset variables are : TRT(Treatments distinct values are 1,2,3) , AVAL(Value),AVISIT(Week 48 value) , CHG (Change ) , BASE(Baseline)

 

I am using below statement , but not sure is correct one as per above statement , and how to use Main model and covariate 

 

proc mixed data=inds covtest ; 
  class trt ;    
  model chg =  trt base;  
  lsmeans trt  cl alpha=0.20; 
  ods output Diffs=fib_dif;
  ods output LSMeans=fib_means;
run;

please let me is above statement is correct , if not  let me now how to adjust the code.

 

Thank you,

Raja.

 

6 REPLIES 6
Ksharp
Super User

Form your code, You are building a FIXED model ,not MIXED model.

If you need MIXED model, you need include RANDOM effect.

 

proc mixed data=inds covtest ; 
  class subjectid  trt avisit;    
  model chg =  trt base avisit /s ;  
 random int/subject=subjectid s ;
 repeated avisit/subject=subjectid type=ar(1);
  lsmeans trt  /cl alpha=0.1; 
run;

And @SteveDenham @lvm @StatDave  could give you right code.

sbxkoenk
SAS Super FREQ

Hello,

 

I moved this topic thread to "Statistical Procedures"-board.

 

I think this is the code you need:

title 'all pairwise comparisons';
*ods select lsmeans diffs;
proc mixed data=inds covtest ; 
  class patientid trt ;    
  model AVISIT /*(Week 48 value)*/ =  trt base / ddfm=kr2 s;
  random patientid; 
  lsmeans trt / diff cl alpha=0.20;
  ods output Diffs=trt_diffs;
  ods output LSMeans=trt_lsmeans;
run;
title; 

Koen

sbxkoenk
SAS Super FREQ

Or a random coefficient model:

title 'all pairwise comparisons';
*ods select lsmeans diffs;
proc mixed data=inds covtest ; 
  class patientid trt ;    
  model AVISIT /*(Week 48 value)*/ =  trt base / ddfm=kr2 s;
 *random patientid; 
  random int  / type=un subject=patientid;
  lsmeans trt / diff cl alpha=0.20;
  ods output Diffs=trt_diffs;
  ods output LSMeans=trt_lsmeans;
run;
title; 

Understanding the Subject= Effect in SAS Mixed Models Software
SAS Software YouTube channel
https://www.youtube.com/watch?v=pX88W9xViJ8

 

SAS Global Forum 2012 -- Paper 332-2012
Tips and Strategies for Mixed Modeling with SAS/STAT® Procedures
Kathleen Kiernan, Jill Tao, and Phil Gibbs, SAS Institute Inc., Cary, NC, USA
https://support.sas.com/resources/papers/proceedings12/332-2012.pdf

 

Koen

SteveDenham
Jade | Level 19

I have a different issue - doing an ANCOVA with the baseline as a covariate runs into an issue if the response is the change from baseline. This is a situation where regression to the mean is one issue, and the algebraic relationship between the baseline and the change from baseline is often a major problem. I think you should consider one of the following approaches: analyze the change score as an ANOVA, analyze the individual scores as a repeated measures ANOVA or analyze the "post" measurement using the "pre" measure as a covariate in an ANCOVA.  Any one of these approaches can be implemented in PROC MIXED, and any one of them will give a less biased result.

 

For a quick tutorial on analysis of change scores, see this link from the Vanderbilt University Medical Center:

https://biostat.app.vumc.org/wiki/Main/MeasureChange2 

 

SteveDenham

sbxkoenk
SAS Super FREQ

@SteveDenham wrote:

... or analyze the "post" measurement using the "pre" measure as a covariate in an ANCOVA.


That's the approach I took in both programs I posted yesterday in this topic thread.

 

Koen

SteveDenham
Jade | Level 19

Indeed it is, Koen. I mistakenly believed that the variable AVISIT was still the deviation from baseline.

 

SteveDenham

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
  • 1233 views
  • 4 likes
  • 4 in conversation