BookmarkSubscribeRSS Feed
aboalzahra1423
Calcite | Level 5

Hi,

I want to run a repeated measure in proc mixed with double nest (site is nested in calf and calf is nested in tx) but I am not success to do it. Would you please to help revise my code below? with an example of data of two calves.

 

data dex1;

input calf time site $ tx $ log10cfu;

datalines;

9 -1 Ear control 0

9 -1 Eye control 0

9 -1 Nose control 0

30 7 Ear Dex 0

30 7 Eye Dex 0

30 7 Nose Dex 3.574031268

;

proc mixed method=reml covtest data=dex1;

class calf time site tx;

model log10cfu= site time tx tx*time/ddfm=satterth solution;

random calf site site*calf site*time calf*time calf*tx calf*time*tx calf*time*tx*site;

lsmeans time*tx/ alpha=0.05 cl tdiff Pdiff;

repeated time /sub= site (calf tx) type=arh(1) r rcorr;

run;

 

Many thanks for help,

 

Hussain

 

2 REPLIES 2
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Consider (assuming that I understand your experimental design correctly):

 

proc mixed method=reml covtest data=dex1;
  class calf time site tx;
  model log10cfu= tx site tx*site time time*tx time*site time*tx*site / 
    ddfm=satterth solution;
  random calf(tx);
  *random site*calf(tx); /* this statement could be included with arh(1) or not; 
    for most other types, it is excluded because it is redundant to the 
    repeated statement */
  repeated time / subject=site*calf(tx) type=arh(1) r rcorr;
  lsmeans time*tx / alpha=0.05 cl tdiff Pdiff;
run;

 

In the MIXED procedure, fixed effects that are identified in the MODEL statement are not duplicated in the RANDOM statement, so you would not have site or site*time in RANDOM.

 

calf*time*tx*site should be excluded from RANDOM because it identifies the residual variance; if you include it, your model is overspecified.

 

In my opinion, some of your terms in RANDOM are either wrong (like calf, rather than calf(tx) ) or partition variance unnecessarily (like calf*time and calf*time*tx.

 

 

aboalzahra1423
Calcite | Level 5

Thank you so much sld. I appreciate your help.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 2 replies
  • 1296 views
  • 0 likes
  • 2 in conversation