[R] R: fractional factorial design in R

Bob Wheeler rwheeler at echip.com
Wed Jan 25 01:14:44 CET 2006


I think you need to add factors="all" to gen.factorial(), otherwise the 
model df will be less than what you expect.

gen.orthogonal.design(c(2,2,3,3,3,3,2,2),numCards=16)

statistical.model at googlemail.com wrote:
> sorry, some small mistakes in the previuos syntax. This works!
> 
> design.test <- gen.orthogonal.design(c(2,4,3),numCards=16)
> design.test
> 
> gen.orthogonal.design <- function(listFactors,numCards){
> 	library(AlgDesign)
> 	FactorsNames<-c("A","B","C","D","E","F","G","H","J","K","L")
> 	numFactors<-length(listFactors)
> 	
> dat<-gen.factorial(listFactors,center=FALSE,varNames=FactorsNames[1:numFacto
> rs])
> 	
> desPB<-optFederov(~.,dat,nRepeats=20,approximate=FALSE,nTrials=numCards)
> 	design<-desPB$design#[,2:(numFactors+1)]
> 	cat("Number of trials: ", fill=T, length(design[,1]), append=T)
> 	print(cor(design))
> 	return(design)
> }
> 
> However, it is necessary to run the function and guess numCards until the
> correlation matrix is diagonal and all levels are selected for the final
> design.
> Any idea how to solve this problem without an iterative function?
> 
> Roberto Furlan
> University of Turin, Italy
> 
> ----------------------------------------
> La mia Cartella di Posta in Arrivo è protetta con SPAMfighter
> 188 messaggi contenenti spam sono stati bloccati con successo.
> Scarica gratuitamente SPAMfighter!
> 

-- 
Bob Wheeler --- http://www.bobwheeler.com/
    ECHIP, Inc. --- Randomness comes in bunches.




More information about the R-help mailing list