BookmarkSubscribeRSS Feed
razi
Calcite | Level 5

1. Consider a multi-year trial to compare 5 treatments. The treatments were observed in each of 3 years, randomized complete block design with 4 block was used. Both year and the block are random effects.


2. Consider a multi-location (4), multi-year (3) trial to compare 6 treatments. The treatments were observed at 4 locations and in each of 3 years, randomized complete block design with 4 block was used. Location, year and the block are random effects.


Could someone provide SAS code (proc mixed)?

Thanks

7 REPLIES 7
invisibleman
Fluorite | Level 6

You can perform your analysis as I described...

data EXPERIMENT_DATA;

input LOCATION YEAR BLOCK TREATMENT VARIABLE1;

cards;

1 1 1 1 10

1 1 1 2 10.5

1 2 2 1 11

1 2 2 2 12

2 1 1 1 10

2 1 1 2 13

2 2 2 1 12.5

2 2 2 2 13

3 1 1 1 13

3 1 1 2 15

3 2 2 1 13.5

3 2 2 2 17

4 1 1 1 18

4 1 1 2 19

4 2 2 1 10

4 2 2 2 21

;

title "With treatment as random";

proc mixed data=EXPERIMENT_DATA;

class LOCATION YEAR BLOCK TREATMENT;

model VARIABLE1=;

random LOCATION|YEAR|TREATMENT BLOCK(LOCATION)/solution;

run;

title "With treatment as fixed";

proc mixed data=EXPERIMENT_DATA;

class LOCATION YEAR BLOCK TREATMENT;

model VARIABLE1=TREATMENT;

random YEAR|LOCATION BLOCK(LOCATION)/solution;

run; title;

Mensagem editada por: Alysson SIlva

razi
Calcite | Level 5

Thanks Sllva

SteveDenham
Jade | Level 19

One thing to consider is whether the same experimental units are observed over years. That is--are experimental units randomized to treatment and block, and then followed over time (REPEATED) or are they selected and randomized separately each year (in which case Alysson's code is what you need)?

Steve Denham

razi
Calcite | Level 5

Dear Denham

1. It was the second case. They were selected and randomized separately each year. I got the code. Thanks

2. In case, if same experimental units are observed over years. Taking years as random. Would you provide me the code?

3. Another situation, if we take multiple observations from same experimental units in the same year or multiple years? For example, we grow some perennial fodder (Rhode grass)  and take multiple cuts (say 5) in year 1 and take 3 cuts in year 2. How we would handle this data considering year random and repeated measurements from same experimental units. Thanks

kind regards

Rizwan Maqbool  

SteveDenham
Jade | Level 19

In answer to 2:

proc mixed data=EXPERIMENT_DATA;

class LOCATION YEAR BLOCK TREATMENT;

model VARIABLE1=TREATMENT YEAR TREATMENT*YEAR;

random LOCATION BLOCK(LOCATION)/solution;

repeated YEAR/subject=block(location) type=ar(1); /*Note that other types may be used here, such as ARH(1) or UN.  Check each and select the one with the smallest corrected AIC*/

run;

In answer to 3:

Consider CUTTINGDAY as day post randomization to treatment on which the cutting is made.  You might want to try:

proc mixed data=EXPERIMENT_DATA;

class LOCATION YEAR BLOCK TREATMENT cuttingday;

model VARIABLE1=TREATMENT cuttingday cuttingday*treatment;

random YEAR|LOCATION BLOCK(LOCATION)/solution;

repeated cuttingday/subject=block*location*year type=sp(pow)(dayc);

/*Because the cutting days are almost assuredly unequally spaced in time the spatial power covariance structure is appropriate.  You will need to define dayc in the dataset EXPERIMENT_DATA as equal to cuttingday.  It is used as a continuous variable, rather than categorical.  Where this could get very complicated is that cuttingday is very likely to differ by year.  In that case, I would recommend moving to a radial smoothing analysis using PROC GLIMMIX, as in Example 44.6 of the SAS/STAT 13.2 documentation. */

run;

Good luck.

Steve Denham

razi
Calcite | Level 5

Thank you  Denham for detailed response and suggestion for choosing correct covariance structure.

In agronomic studies, Multi-cuts of perennial fodders or leachates and soil extracts from lysimeter (multiple readings) data, we analyze it as repeated measures.

1. my question is could we analyze plant growth data (for example leaf area index or leaf area duration) as repeated measures. Suppose we have used same plants for multiple measurements. In case no, t then why?

2. Leaf area index (LAI) was measured at 45, 60, 75 and 90 days after sowing from a experiment laid out RCBD with 5 treatments. Could you possibly suggest statistical analysis that a) tells us trend over time b) could you suggest some graphs (e.g simple line graph with lettering)? 

Thanks

kind regards

Rizwan

SteveDenham
Jade | Level 19

At this point, I strongly recommend that you obtain a copy of SAS for Mixed Models, 2nd ed. by Littell et al., and Generalized Linear Mixed Models by Walt Stroup.  There are tons of examples there for the kind of questions you are asking.

Steve Denham

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
  • 7 replies
  • 4558 views
  • 6 likes
  • 3 in conversation