[R] Understanding lm-based analysis of fractional factorial experiments

Peter Claussen dakotajudo at me.com
Wed Mar 6 16:18:36 CET 2013


On Mar 6, 2013, at 4:46 AM, Kjetil Kjernsmo <kjekje at ifi.uio.no> wrote:

> All,
> 
> I have just returned to R after a decade of absence, and it is good to see that R has become such a great success! I'm trying to bring Design of Experiments into some aspects of software performance evaluation, and to teach myself that, I picked up "Experiments: Planning, Analysis and Optimization" by Wu and Hamada. I try to reproduce an analysis in the book using lm, but have to conclude I don't understand what lm does in this context, even though I end up at the desired result. I'm currently using R 2.15.2 on a recent Fedora system, but I get the same result on Debian Wheezy and Debian Squeeze. I think the discussion below can be followed without having the book at hand though.
> 
> I'm working with tables 5.2 and 5.5 in the above mentioned book. Table 5.2 contains data from the "Leaf spring experiment". The dataset is also in this zip file:
> 
> ftp://ftp.wiley.com/public/sci_tech_med/experiments-planning/data%20sets.zip
> 
> I've learned from the book that the effects can be found using a linear model and double the coefficients. So, I do
> > leaf <- read.table("/ifi/bifrost/a03/kjekje/fag/experimental-planning/book-datasets/LeafSpring table 5.2.dat", col.names=c("B", "C", "D", "E", "Q", paste("r", 1:3, sep=""), "yavg", "ssq", "lnssq"))
> > leaf.lm <- lm(yavg ~ B * C * D * E * Q, data=leaf)
> > leaf.lm
> 

I'll ignore the rest of your question, in the hope that this will answer them sufficiently.

You probably want a simple linear model, specified in R using "+" instead of "*".

> leaf.lm <- lm(yavg ~ B + C + D + E + Q, data=leaf)
> leaf.lm

Call:
lm(formula = yavg ~ B + C + D + E + Q, data = leaf)

Coefficients:
(Intercept)           B+           C+           D+           E+           Q+  
    7.50084      0.22125      0.17625      0.02875      0.10375     -0.25960  

Does this give you the numbers you expect?

Peter


> 
> 
> Kjetil
> -- 
> Kjetil Kjernsmo
> PhD Research Fellow, University of Oslo, Norway
> Semantic Web / SPARQL Query Federation
> kjekje at ifi.uio.no http://www.kjetil.kjernsmo.net/
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list