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

2007-12-05 Thread T.K.
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. A. Others seemed to think,

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

2007-12-04 Thread T.K.
I agree that it is better to use your way. However, in my defense, I thought simply how to recover the specific numbers that Kevin wants to get. > I don't understand why R doesn't output a value for F and Pr for the > Error (Block) dimension, as my textbook shows 12.807 and 0.0015 > respectively.

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

2007-12-04 Thread Ben Bolker
Bert Gunter wrote: > > Let's be careful here. aov() treats block as a **random** error component > of > variance. lm() treats block as a **fixed effect**. That's a different > kettle of fish. Perhaps both Kevin and the authors of his textbook need to > read up on fixed versus random effects an

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

2007-12-04 Thread T.K.
I found that you can do the same thing with 'aov' as well. Sorry for any confusion. :) > model.aov <- aov(Score.changes ~ Therapy + Block, data=table1) > summary(model.aov) Df Sum Sq Mean Sq F value Pr(>F) Therapy 2 260.93 130.47 15.259 0.001861 ** Block4 438.00 109.5

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

2007-12-04 Thread Bert Gunter
what sorts of tests make sense for each. Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of T.K. Sent: Tuesday, December 04, 2007 2:46 PM To: Zembower, Kevin Cc: r-help@r-project.org Subject: Re: [R] Lear

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

2007-12-04 Thread T.K.
This seems to work. The trick is to use 'lm' instead of 'aov'. > model.aov <- lm(Score.changes ~ factor(Therapy) + factor(Block), data=table) > anova(model.aov) Analysis of Variance Table Response: Score.changes Df Sum Sq Mean Sq F value Pr(>F) factor(Therapy) 2 260.93 130.47

[R] Learning to do randomized block design analysis

2007-12-04 Thread Zembower, Kevin
We just studied randomized block design analysis in my statistics class, and I'm trying to learn how to do them in R. I'm trying to duplicate a case study example from my textbook [1]: > # Case Study 13.2.1, page 778 > cd <- c(8, 11, 9, 16, 24) > dp <- c(2, 1, 12, 11, 19) > lm <- c(-2, 0, 6, 2, 11