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) [EMAIL PROTECTED] 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. ______________________________________________ R-help@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