## How to build a Proc Mixed model: repeated pig data ?

Occasional Contributor
Posts: 13

# How to build a Proc Mixed model: repeated pig data ?

(1) Prepared 4 different diets for pig industry:

dietIngredient AIngredient B
A_low_B_lowLowLow
A_high_B_lowHighLow
A_low_B_highLowHigh
A_high_B_highHighHigh

(2) Twelve (12) group pigs were randomly assigned to one of the diets, so 3 group pigs per diet treat.

(3) Twelve group pigs' weight (total) was monitored for 30 days (daily total weight).

The following questions might be asked:

• (1)  Does the ingredient A affect pig performance?
• (2) Does the ingredient B affect pig performance?
• (3) Does age affect pig performance?
• (4)  Is there evidence of interactions among ingredient A, B and Age?

I have tried to build the flowing model, but I am not so sure it is correct, please help:

Title "proc mixture";

proc mixed data=pigs;

Class group ingredA ingredB Age ;

Model Weight =ingredA|ingredB;

random group;

repeated Age/type=cs subject=group;

run;

Posts: 2,655

## Re: How to build a Proc Mixed model: repeated pig data ?

This is close, but does not address possible interactions between age and the ingredients.  How about:

proc mixed data=pigs;

Class group ingredA ingredB Age ;

Model Weight =ingredA|ingredB|Age;

random group;

repeated Age/type=cs subject=group;

run;

There are several other covariance structures you may want to investigate.  In particular, heterogeneous compound symmetry (type=csh), and, if the age variable is equally spaced in time, autoregressive structures such as ar(1) and arh(1).

In addition, if the interaction of Age with the dietary factors is significant (either two-way or three-way), when it comes time to compare marginal means using the lsmeans statement, you will want to look at the AT= option.

I would strongly recommend looking at Littel et al.'s SAS for Mixed Models, 2nd ed., which is a storehouse of information on repeated measures analysis of covariance.

Steve Denham

Discussion stats