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
- /
- Repeated measure analysis/anova

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
- Permalink
- Email to a Friend
- Report Inappropriate Content

2 weeks ago

Hi,

I am using a hand-held moisture meter to monitor loss of moisture during different stages of growth in corn cobs that have a gradient of moisture. There is data of two years related to eight treatments (Trt), four replications taken weekly for nine weeks.

Currently, I just need to test whether the meter detects the moisture differences in treatments? Can someone, please review the attached program and suggest if my approach is correct?

Lastly, I have used proc Glimmix to get the lsmeans of Trt*time and have requested a default plot. Is there any way to customize the graph for space between lines (trt) and to select types of lines, please? I will appreciate help with codes, please. Thank you.

Fridge

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

Posted in reply to fridge_wpg

2 weeks ago

If the response is normally distributed, then it is possible to specify the same model in MIXED and GLIMMIX.

In the code you provided, you specify two different statistical models: the structures of the fixed effects components are the same, but the structures of the random effects components are different. And "subject=trt" is wrong. These issues suggest that you may not have an adequate understanding of mixed models, your experimental design, and how to specify it as a mixed model. I recommend studying SAS® for Mixed Models, Second Edition, and then following up with any questions.

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

2 weeks ago

Hi,

Thank you very much for your input on the question and I agree with your assessment that I do not have an adequate understanding of the subject in question. I have the book now " SAS for Mixed Models" but would like to pick your brain if I may please. In the statistical model given below, you mentioned in your post that the subject=Trt is wrong! (but it gives me the expected results) Can you please explain that a little? In the experiment, the treatment means difference over time is being investigated. Now if I change the subject=Trt (time) then I get a non-sig result for trt*time that is against my observation and I have trouble understanding at the moment.

(The data with the program code is attached)

proc mixed data=drydown_weekly_avg;

class year rep trt time;

model Moist = trt|time / ddfm=kr;

random year (rep);

repeated /subject= Trt type=AR (1);

lsmeans Trt*Time/slice=time;

run;

Quit;

Thank you very much for your time on this

Fridge

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

Posted in reply to fridge_wpg

a week ago

The "subject" is the design unit on which repeated measurements are made. It should be a random effects factor, which TRT is not (TRT is a fixed effects factor).

I don't have a clear sense of your experimental design, so I'm not going to speculate what the appropriate subject might be. The appropriate subject will involve REP, but YEAR might play a role as well, and you have not clearly identified the role of YEAR in your study. Is YEAR a fixed effects (and so affects the mean of the response) or is it a random effect (and so affects the variance of the response)?

The appropriate subject specification also depends upon how factors--notably REP, in your case--are coded. Keep in mind that you are providing information to the PROC: you are identifying a random effects factor and its levels. When reps are coded the same for all levels of TRT (as in your data set), you need to specify more than just REP to tell the procedure that you have different REPs for different levels of TRT: think REP(TRT).

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

a week ago

Hi,

I cannot thank you enough for your input on my posts. It has helped me understand many issues of repeated measure analysis to which I was blindfolded. Although, I read the relevant part of the book "SAS for Mixed Models" that you recommend, however, your post was more beneficial.

My experimental design was RCBD containing 4 blocks/rep, 8 treatments, time (repeated measurements on treatments weekly for 9 weeks). The experiment was done for two years.

The objective of the experiment was to test whether the device used to take the moisture measurements on the 8 treatments can detect the differences in treatments and across time?

Generally, in agricultural experiments, the rep and year differences are of not much interest and therefore, considered random effects.

Considering your suggestion when I modified the program code as below:

proc mixed data=weekly_moisture;

class year rep trt time;

model Moist = trt|time|year/ ddfm=kr;

random rep; *Note I have not nested the rep in year as it gives infinite tvalue in the LSMEAN tables;

repeated /subject = Rep (Trt) type= AR (1);

lsmeans Trt*Time/slice=time;

run;

Quit;

Changing the subj=Rep (Trt) and adding year as the fixed effect decreases the fit statistics (AIC, AICC, and BIC) substantially.

I will appreciate any comment you may have. Thank you again.

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

Posted in reply to fridge_wpg

a week ago

You said you were measuring corn cobs. But to set up a correct model, I need to know what comprises a block, and what comprises a rep. I also need to know whether you have different blocks and reps in the two years: was the same rep followed across two years, or did you have new reps in the second year?

In other words, I need a more complete description of your experimental protocol.

I'd say you are understating the importance of random effects. Replications are random effects, and they are critically important in defining the inference space of your study. Year can be random or fixed; in my opinion, with a small number of years (e.g., 2) in field experiments you are better off thinking of year as fixed, not random. It's an arguable point, though.

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

a week ago

Design | Treatment | Replication | # of years the exp. was repeated | # of weekly measurements |

RCBD | 8 | 4 | 2 | 9 |

What was measured in treatments?

I measured the moisture content of 10 corn cobs in each treatment with a handheld electronic device. If I find a significant difference in treatment means across time, I will interpret that the meter is effective in differentiating the moisture content.

Replications (Rep)

Replication is a mere repetition of the experiment, done four-time comprising of the same all treatments in every rep but obviously randomized within the rep. I referred reps as blocks previously, which is actually not *correct*. So no blocks, only reps.

Years

Followed the same experimental protocol and same exact order of replications and treatments every year.

That is how the model looks like now after input from SID (thank you)

**proc** **mixed** data _;

class year rep trt time;

model Moist = trt|time|year / ddfm=kr;

random year(rep);

repeated /subject= Rep (Trt) type= AR (**1**);

lsmeans Trt*Time/slice=time;

**run**;**Quit**;

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

Posted in reply to fridge_wpg

a week ago

The information I'm seeking is what you would provide in a Methods section of a manuscript. (You have to write it eventually, you might as well do it now.) My rule of thumb is that the Methods description should allow a reader to duplicate your study. What you have provided is not yet enough, so more questions :

This a field study or a lab study?

What are your TRTs?

What is the experimental unit to which a level of TRT is randomly assigned?

What is a REP? I want to know how a REP relates to a corn cob, or clusters of corn cobs. Is a REP the experimental unit to which a level of TRT is assigned? Or is it a block of experimental units?

Is each value of MOIST measured on one corn cob, or is it the mean of 10 corn cobs? I'm trying to figure out where "10 corn cobs" works in here.

Is MOIST a percentage?

What is TIME (e.g., days?), and what are the levels of TIME? Are the levels equally spaced?

Do you measure MOIST on the *same* corn cob nine times, or do you use a different corn cob each time?

Do you use different corn cobs in different years? Do you use different REPs (whatever they are) in different years? Do you use different experimental units for TRTs in different years?

Within each year, are all four REPs run simultaneously or do you run one REP to completion, then the second, then third, then fourth?

Within each REP, are all eight TRTs run simultaneously or sequentially?

Your MOIST values are very similar among REPs (i.e., there is very little variability), apart from some notably odd values which might be typos or outliers. In my experience, agricultural data are typically quite noisy, so your data are uncommon in this regard.

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

Posted in reply to fridge_wpg

a week ago

Hello. I have been helped by Sid before. Hello, Sid.

I may not be a good position to advise anyone in this community, but I can share good sources you can utilize to have a better understanding about mixed model and how you link the model to the SAS codes.

If you read the attached two articles, it will help you a lot when designing your mixed model.

I think the most important thing is to determine what will be your level-1 variable and what will be your level-2 variable, etc.

If you have more than two levels, it gets very complicated though.

Once you are sure about your equation, you know what goes to fixed and random statements.

I think that is why Sid asks what is the relationship among year, rep, and trt: whether the trt 1 on the year 2015 is the same trt 1 in year 2016, etc.

Hope this helps.

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

Posted in reply to nlpurumi

a week ago

I can only attach one article at a time. Here is the second article.