turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- SAS code proc mixed ?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-10-2015 02:34 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-10-2015 12:10 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-16-2015 05:46 AM

Thanks Sllva

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-11-2015 10:18 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-16-2015 05:59 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-17-2015 07:58 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-18-2015 11:01 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-18-2015 02:07 PM

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