BookmarkSubscribeRSS Feed
kchanp01
Calcite | Level 5

Hi,

 

I am analyzing data from a randomized block design study. We have two independent variables (Treatment and Site), two covariate and one blocking factor (categorical). As I use a block design, I wonder what is a proper way to set up an ANCOVA model. I use SAS EG to do the analyses but I've told that  mayneed to modified the code myself to include a blocking factor. Do I just add one more factor in the classification variable option in Linear Model? How can I make sure that SAS would treat the block variable separately from the two independent variables I have? Below is my code from SAS EG.

 

PROC GLM DATA=work1;
CLASS Treatment Site Block;
MODEL Tb_BVTV= Treatment Site Treatment*Site Block Covariate(1) Covariate (2)
/
SS3
SOLUTION
SINGULAR=1E-07
;
LSMEANS Treatment Site Treatment*Site / PDIFF=ALL ADJUST=TUKEY ;
RUN;

 

 

Any advice would be appreciated.

Thank you!

1 REPLY 1
SteveDenham
Jade | Level 19

You may have received an answer already, but this is a classic case where a mixed model approach is superior to PROC GLM.  See Littell et al.'s SAS for Mixed Models, 2nd ed. for examples.  In your case, I would suggest

 

PROC MIXED DATA=work1;
CLASS Treatment Site Block;
MODEL Tb_BVTV= Treatment Site Treatment*Site  Covariate(1) Covariate (2)
/

SOLUTION;
RANDOM Block;
LSMEANS Treatment Site Treatment*Site / DIFF=ALL ADJUST=TUKEY ;
RUN;

 

Steve Denham

 

 

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
  • 1 reply
  • 1715 views
  • 0 likes
  • 2 in conversation