# Re: [R] Learning to do randomized block design analysis

From: T.K. <taekyunk_at_gmail.com>
Date: Wed, 5 Dec 2007 14:16:37 -0800

Dear R-Helpers

(1)

After a night's sleep, I realized why the other helpers think differently from me.
I agree with others that it may be better to use multi-stratum model but I was a bit surprised since they seem to think 'block' variable should *not* be a fixed effect.

1. Others seemed to think, "Kevin is trying to estimate 'multi-stratum' model since he is using Error(block)"
2. I thought "Kevin is trying to estimate a simple ANOVA model (*not* random effects model) but did not use the right R code"

I thought so for the following reasons.
1) I looked up the book in Amazon and browsed the index using ' Search Inside' function. It does not seem to cover random effects model. 2) The description of the book says it uses Minitab so I guessed Kevin is getting R code from somewhere else.
3) In addition, Kevin's code looked very similar to the example code of 'aov'.
The example code of 'aov' has the following code segment involving 'block' variable
## as a test, not particularly sensible statistically npk.aovE <- aov(yield ~ N*P*K + Error(block), npk) So, I guessed Kevin might have gotten his code from here. After emailing Kevin, I found that he is using the code from 'split-plot' section of MASS, so my guess is not that far off.

(2)

I got this new bits of information from Kevin.

The data set is from a psychological experiment and subjects are *assigned* to one of the blocks according to their scores on a test. Subjects with the lowest scores are assigned to block A, and highest to block E. These blocks were *not* randomly chosen from a larger set of blocks. Then the treatment was randomized within each 'block'.

Given this new information, I think it is okay to solve Kevin's question simply by using
aov(Score.changes ~ Therapy + Block, data=table) assuming the fixed effects of 'block'.

I would appreciate your correction if I am mistaken here.

T.K. (Tae-kyun) Kim
Ph.D. student
Department of Marketing