Hi, i need to create a fractional factorial design sufficient to estimate the main effects. The factors may have any number of levels, let's say any number from 2 to 6. I've tried to use the library conf.design , but i cannot figure out how to write the code. For example, what is the code for a design with 5 factors (2x3x3x5x2) and only main effects not confounded? thanks in advance! Roberto Furlan University of Turin, Italy PS: i've already tried to send this email, sorry if you 've received it again! ---------------------------------------- La mia Cartella di Posta in Arrivo ?? protetta con SPAMfighter 188 messaggi contenenti spam sono stati bloccati con successo. Scarica gratuitamente SPAMfighter!
I'm not sure what you mean by a "fractional factorial" design here. In general, when dealing with complex designs of the sort you appear to be thinking about, small orthogonal designs don't exist. You might wish to look at the AlgDesign package to generate an efficient design to estimate only main effects. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA "The business of the statistician is to catalyze the scientific learning process." - George E. P. Box> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Roberto Furlan > Sent: Friday, January 20, 2006 12:37 PM > To: r-help at stat.math.ethz.ch > Subject: [R] fractional factorial design in R > > Hi, > i need to create a fractional factorial design sufficient to > estimate the > main effects. > The factors may have any number of levels, let's say any > number from 2 to 6. > I've tried to use the library conf.design , but i cannot > figure out how to > write the code. > For example, what is the code for a design with 5 factors > (2x3x3x5x2) and > only main effects not confounded? > > thanks in advance! > Roberto Furlan > University of Turin, Italy > > PS: i've already tried to send this email, sorry if you 've > received it > again! > > ---------------------------------------- > La mia Cartella di Posta in Arrivo ?? protetta con SPAMfighter > 188 messaggi contenenti spam sono stati bloccati con successo. > Scarica gratuitamente SPAMfighter! > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
>Roberto Furlan wrote: > >Hi, >i need to create a fractional factorial design sufficient to estimate the >main effects. >The factors may have any number of levels, let's say any number from 2 to 6. >I've tried to use the library conf.design , but i cannot figure out how to<write the code.>For example, what is the code for a design with 5 factors (2x3x3x5x2) and >only main effects not confounded? > >thanks in advance! >Roberto Furlan >University of Turin, ItalyHi Roberto, unfortunately, fractional factorial designs typically require all factors to have the same number of levels. Hence, your 2x3x3x5x2 example is not a simple special case of a fractional factorial design. There are some special plans for mixed level designs, but the conf.design function requires all factors to have the same number of levels, as you can also find in its help: ?????? p: The common number of levels for each factor.?? Must be a prime ?????????????????? number. ffDesMatrix from package BHH2 is even worse, since it requires all factors to have 2 levels: k: numeric. The number of 2-levels design factors in the designs. (Note that designs with two level-factors only can accommodate a few four- level factors, by combining two main effects plus their interaction for the three degrees of freedom of the 4-level factor. For doing this, I would recommend to have someone plan the design who really knows what he/she is doing.) Regards, Ulrike
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.