72
Package ‘FrF2’ September 30, 2016 Title Fractional Factorial Designs with 2-Level Factors Version 1.7-2 Depends R(>= 2.13.0), DoE.base(>= 0.25) Imports sfsmisc(>= 1.0-26), BsMD, utils, scatterplot3d, igraph(>= 0.7), methods Suggests FrF2.catlg128 Date 2016-09-29 Author Ulrike Groemping Maintainer Ulrike Groemping <[email protected]> Description Regular and non-regular Fractional Factorial 2-level designs can be created. Furthermore, analysis tools for Fractional Factorial designs with 2-level factors are offered (main effects and interaction plots for all factors simultaneously, cube plot for looking at the simultaneous effects of three factors, full or half normal plot, alias structure in a more readable format than with the built-in function alias). License GPL (>= 2) LazyLoad yes LazyData yes Encoding latin1 URL http://prof.beuth-hochschule.de/groemping/DoE/, http://prof.beuth-hochschule.de/groemping/ NeedsCompilation no Repository CRAN Date/Publication 2016-09-30 10:24:57 R topics documented: FrF2-package ........................................ 2 add.center .......................................... 5 1

Package 'FrF2' - Cran

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Package 'FrF2' - Cran

Package ‘FrF2’September 30, 2016

Title Fractional Factorial Designs with 2-Level Factors

Version 1.7-2

Depends R(>= 2.13.0), DoE.base(>= 0.25)

Imports sfsmisc(>= 1.0-26), BsMD, utils, scatterplot3d, igraph(>=0.7), methods

Suggests FrF2.catlg128

Date 2016-09-29

Author Ulrike Groemping

Maintainer Ulrike Groemping <[email protected]>

Description Regular and non-regular Fractional Factorial 2-level designscan be created. Furthermore, analysis tools for FractionalFactorial designs with 2-level factors are offered (maineffects and interaction plots for all factors simultaneously,cube plot for looking at the simultaneous effects of threefactors, full or half normal plot, alias structure in a morereadable format than with the built-in function alias).

License GPL (>= 2)

LazyLoad yes

LazyData yes

Encoding latin1

URL http://prof.beuth-hochschule.de/groemping/DoE/,

http://prof.beuth-hochschule.de/groemping/

NeedsCompilation no

Repository CRAN

Date/Publication 2016-09-30 10:24:57

R topics documented:FrF2-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2add.center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1

Page 2: Package 'FrF2' - Cran

2 FrF2-package

aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9blockpick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12BsProb.design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15CatalogueAccessors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17CIG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22compromise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26cubePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28DanielPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29estimable.2fis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32fold.design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36FrF2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38FrF2Large . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53IAPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57pb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60splitplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65StructurePickers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Index 71

FrF2-package Fractional Factorial designs with 2-level factors

Description

This package creates regular and non-regular Fractional Factorial 2-level designs. Furthermore,analysis tools for Fractional Factorial designs with 2-level factors are offered (main effects andinteraction plots for all factors simultaneously, cube plot for looking at the simultaneous effects ofthree factors, full or half normal plot, alias structure in a more readable format than with the built-infunction alias).

The package works together with packages DoE.base and DoE.wrapper.

Details

The package is still subject to development; most key functionality is now included. Please contactme, if you have suggestions.

This package designs and analyses Fractional Factorial experiments with 2-level factors. Regular(function FrF2) and non-regular (function pb) 2-level fractional factorial designs can be gener-ated. Function FrF2) can generate regular fractional factorials as blocked or split-plot designs, andhard-to-change factors can be specified in order to keep the number of level changes low. Regularresolution V designs larger than those obtainable from function FrF2 can be created by functionFrF2Large (these are not guaranteed to be optimal). Analysis facilities work for completely aliaseddesigns only, i.e. e.g. not for analysing Plackett-Burman designs with interactions.

Functions fac.design, fractionate or oa.design from Chambers and Hastie (1993) have beenused as role models e.g. for the option factor.names or for outputting a data frame with attributes.

Page 3: Package 'FrF2' - Cran

FrF2-package 3

However, S compatibility has not been considered in devising this package. The original above-mentioned functions are not available in R; similar functions have been from package DoE.base areavailable together with other general functionality for experimental designs.

In terms of analysis, package FrF2 works on linear models and enables convenient main effectsand interaction plots (functions MEPlot and IAPlot) similar to those offered by Minitab softwarefor all factors simultaneously, even though especially the interactions are often aliased, i.e. themodel is typically singular. For the (less frequent) case of suspected three-factor-interactions, func-tion cubePlot displays a cube with corners labeled with the (modeled) means of three factorssimultaneously. Furthermore, the function DanielPlot from package BsMD has been modified toautomatically label effects significant according to the Lenth-criterion, and to provide more usagecomfort to the analyst. Finally, the function aliases determines the alias structure of a FractionalFactorial 2-level design in a format more suitable for human readers than the output from the built-infunction alias.

Author(s)

Ulrike Groemping

Maintainer: Ulrike Groemping <[email protected]>

References

Box G. E. P, Hunter, W. C. and Hunter, J. S. (2005) Statistics for Experimenters, 2nd edition. NewYork: Wiley.

Chambers, J.M. and Hastie, T.J. (1993). Statistical Models in S, Chapman and Hall, London.

Chen, J., Sun, D.X. and Wu, C.F.J. (1993) A catalogue of 2-level and 3-level orthogonal arrays.International Statistical Review 61, 131-145.

Daniel, C. (1959) Use of Half Normal Plots in Interpreting Two Level Experiments. Technometrics,1, 311-340.

Groemping, U. (2014). R Package FrF2 for Creating and Analyzing Fractional Factorial 2-LevelDesigns. Journal of Statistical Software, 56, Issue 1, 1-56. http://www.jstatsoft.org/v56/i01/.

Hedayat, A.S., Sloane, N.J.A. and Stufken, J. (1999) Orthogonal Arrays: Theory and Applications,Springer, New York.

Lenth, R.V. (1989) Quick and easy analysis of unreplicated factorials. Technometrics, 31, 469-473.

Mee, R. (2009). A Comprehensive Guide to Factorial Two-Level Experimentation. New York:Springer.

Montgomery, D.C. (2001). Design and Analysis of Experiments (5th ed.). Wiley, New York.

Plackett, R.L.; Burman, J.P. (1946) The design of optimum multifactorial experiments. Biometrika33, 305-325.

Ryan, K.J. and Bulutoglu, D.A. (2010). Minimum Aberration Fractional Factorial Designs WithLarge N. Technometrics 52, 250-255.

Sanchez, S.M. and Sanchez, P.J. (2005). Very Large Fractional Factorial and Central CompositeDesigns. ACM Transactions on Modeling and Computer Simulation 15, 362-377.

Page 4: Package 'FrF2' - Cran

4 FrF2-package

See Also

The key design generating functions: FrF2, pb, FrF2LargeS3 class designRelated packages: DoE.base, DoE.wrapper, BsMD;Graphical analysis functions: MEPlot, IAPlot, cubePlot, DanielPlotAnalysis of alias structure for linear models of FrF2 designs: aliases

Examples

### for examples on design generation, cf. functions pb and FrF2

### Injection Molding Experiment. Box et al. 1978.data(BM93.e3.data, package="BsMD") #from BsMDiMdat <- BM93.e3.data[1:16,2:10] #only original experiment# make data more user-friendlycolnames(iMdat) <- c("MoldTemp","Moisture","HoldPress","CavityThick","BoostPress",

"CycleTime","GateSize","ScrewSpeed", "y")# linear model with all main effects and 2-factor interactionsiM.lm <- lm(y ~ (.)^2, data = iMdat)# determine aliasesaliases(iM.lm)# coded versionaliases(iM.lm, code=TRUE)# normal plot of effects, default is autolabel with alpha=0.05DanielPlot(iM.lm)DanielPlot(iM.lm,code=TRUE)DanielPlot(iM.lm,code=TRUE,alpha=0.5)# half normal plot of effectsDanielPlot(iM.lm,code=TRUE,alpha=0.5,half=TRUE)# main effects plotsMEPlot(iM.lm)# interaction plotsIAPlot(iM.lm)# interaction plots with attention drawn to aliasesaus <- IAPlot(iM.lm, show.alias=TRUE)# alias groups corresponding to interaction plotsaliases(iM.lm)$aliases[9:15]# returned objectaus# cube plot of three factors# (not very useful for this model, for demonstration only)

## per default, modeled means are shown## this does not make a difference here, since the main effect of## ScrewSpeed is confounded with the MoldTemp:HoldPress:BoostPress## interaction, so that the three-factor-interaction is indirectly included## in the modeled meanscubePlot(iM.lm, "MoldTemp", "HoldPress", "BoostPress")## modeled means without a three-factor interactioncubePlot(lm(y ~ (MoldTemp+HoldPress+BoostPress)^2, data = iMdat),

"MoldTemp", "HoldPress", "BoostPress")## modeled=FALSE reverts to showing the apparent three-factor interaction

Page 5: Package 'FrF2' - Cran

add.center 5

cubePlot(lm(y ~ (MoldTemp+HoldPress+BoostPress)^2, data = iMdat),"MoldTemp", "HoldPress", "BoostPress", modeled=FALSE)

## cubePlot also works on raw datacubePlot(iMdat$y, iMdat$MoldTemp, iMdat$HoldPress, iMdat$BoostPress)

## plotting functions also work directly on designs,## if these have been generated from functions FrF2 or pb:

plan <- FrF2(16, 7)plan <- add.response(plan, rnorm(16))MEPlot(plan)IAPlot(plan)DanielPlot(plan)

add.center Function to add center points to a 2-level fractional factorial

Description

This function adds center points to a 2-level fractional factorial design. All factors must be quanti-tative!

Usage

add.center(design, ncenter, distribute=NULL, ...)

Arguments

design a data frame of class design that contains a 2-level fractional factorial (regular ornon-regular); design must neither be a split-plot nor a long version parameterdesign.For function add.center, the design must not contain center points yet, whileit has to contain center points for function iscube.For function add.center, blocked and replicated (or repeated measurement)designs must be in the original run order (column run.no in run.order attributein ascending order), as the algorithm relies on the related runs being grouped asexpected. An error is thrown, if this condition is violated.

ncenter the number of center points to be added to each block

distribute the number of positions over which to distribute the center points within eachblock; note that the center points are not randomized but placed evenly through-out the (hopefully randomdomized) design (but see also the details section);if distribute is NULL, center points are all added at the end for non-randomizeddesigns and are distributed as evenly as possible to beginning, middle and endof the experiment for randomized designs.distribute must neither be larger than ncenter nor than the number of runsof the design plus one.

... currently not used

Page 6: Package 'FrF2' - Cran

6 add.center

Details

Function add.center adds center points to 2-level fractional factorial designs. Instead of using thisfunction directly, center points should usually be added directly with calls to functions FrF2 or pb.These make use of function add.center for this purpose.

Center points are added to designs for three main reasons: they provide a repeated benchmarkrun that can alert the experimenter to unplanned changes in experimental conditions, they providean independent estimate of experimental error, and finally they provide a possibility for checkingwhether a first order model is sufficient. Especially for the first purpose, package FrF2 follows therecommendation in Montgomery (2001, p.275). To distinguish them from the center points, theoriginal fractional factorial runs are called “cube points”.

Addition of center points does not affect estimates for main effects and interactions. The differencebetween the averages of cube points and center points gives an indication whether quadratic termsmight be needed in the model.

For blocked designs and properly replicated designs, ncenter center points are added to each (repli-cation) block. In case of repeated measurements, center points are also measured repeatedly.

Center points are distributed as evenly as possible over the distribute selected positions through-out each block. distribute=1 always adds all center points at the end of each block. If distribute > 1,(each block of) the design starts and ends with a (group of) center point(s), and the distributepositions for placing center points are as evenly placed throughout (each block of) the design aspossible.If ncenter is not a multiple of distribute, some center point groups have one more center pointthan others. If ncenter%%distribute is one or two only, the beginning and (for two) the end of(each block of) the design have one more center point, otherwise the ncenter%%distribute extracenter points are randomized over the center point positions.

Function iscube from package DoE.base provides a logical vector that is TRUE for cube pointsand FALSE for center points, which allows to use of simple functions for “clean” 2-level fractionalfactorials like MEPlot.

Value

A data frame of class design with ncenter center point runs per block (or per replication block)added to the design (and its desnum and run.order attributes). The run.no.in.std.order column ofrun.order is “0” for the center points.

Existing response values for cube runs are preserved, and response values for the new center pointruns are NA. Note, however, that center points should be added BEFORE running the experimentin order to benefit from all their useful properties; this should best be done within functions pb orFrF2.

The design is identifiable as a design with center points by the suffix .center to the type elementof attribute design.info, and the elements ncube and ncenter are added (with the updated nrunsbeing their sum). The element coding is also added to the design.info, in order to support steepestascent/descent analysis from the center point.

Note

This function is still somewhat experimental.

Page 7: Package 'FrF2' - Cran

add.center 7

Author(s)

Ulrike Groemping

References

Montgomery, D.C. (2001). Design and Analysis of Experiments (5th ed.). Wiley, New York.

See Also

See also as pb, FrF2

Examples

## purely technical exampleplan <- FrF2(8,5, factor.names=c("one","two","three","four","five"))add.center(plan, 6)add.center(plan, 6, distribute=1)add.center(plan, 6, distribute=6)add.center(plan, 6, distribute=4)

## very artificial analysis exampleplan <- FrF2(8,4, factor.names=list(one=c(0,10),two=c(1,3),three=c(25,32),four=c(3.7,4.8)))

## add some response datay <- c(2+desnum(plan)%*%c(2,3,0,0) +

1.5*apply(desnum(plan)[,c(1,2)],1,"prod") + rnorm(8))## the "c()" makes y into a vector rather than a 1-column matrix

plan <- add.response(plan, y)## analysing this design provides an impression

MEPlot(lm(y~(.)^2, plan))IAPlot(lm(y~(.)^2, plan))DanielPlot(lm(y~(.)^2,plan), half=TRUE, alpha=0.2)

## tentative conclusion: factors one and two do something## wonder whether the model with one and two and their interaction is sufficient## look at center points (!!! SHOULD HAVE BEEN INCLUDED FROM THE START,## but maybe better now than not at all)## use distribute=1, because all center points are run at the end

planc <- add.center(plan, 6, distribute=1)## conduct additional runs for the center points

y <- c(y, c(2+desnum(planc)[!iscube(planc),1:4]%*%c(2,3,0,0) +1.5*apply(desnum(planc)[!iscube(planc),][,c(1,2)],1,"prod") + rnorm(6)))

## add to the designplanc <- add.response(planc, y, replace=TRUE)

## sanity check: repeat previous analyses for comparison, with the help of function iscube()MEPlot(lm(y~(.)^2, planc, subset=iscube(planc)))IAPlot(lm(y~(.)^2, planc, subset=iscube(planc)))DanielPlot(lm(y~(.)^2, planc, subset=iscube(planc)), half=TRUE, alpha=0.2)

## quick check whether there a quadratic effect is needed: is the cube indicator significant ?summary(lm(y~(.)^2+iscube(planc), planc))

## (in this unrealistic example, the quadratic effect is dominating everything else;## with an effect that strong in practice, it is likely that

## one would either have expected a strong non-linearity before conducting the experiment,## OR that the effect is not real but the result of some stupid mistake

Page 8: Package 'FrF2' - Cran

8 aliases

## alternatively, the check can be calculated per hand (cf. e.g. Montgomery, Chapter 11):(mean(planc$y[iscube(planc)])-mean(planc$y[!iscube(planc)]))^2*8*6/(8+6)/var(y[!iscube(planc)])## must be compared to the F-quantile with 1 degree of freedom## is the square of the t-value for the cube indicator in the linear model

aliases Alias structure for fractional factorial 2-level designs

Description

Functions to examine the alias structure of a fractional factorial 2-level design

Usage

aliases(fit, code = FALSE, condense=FALSE)aliasprint(design, ...)## S3 method for class 'aliases'print(x, ...)

Arguments

fit a linear model object with only 2-level factors as explanatory variables; the func-tion will return an error, if the model contains partially aliased effects (like in-teractions in a Plackett-Burman design for most cases)

code if TRUE, requests that aliasing is given in code letters (A, B, C etc.) insteadof (potentially lengthy) variable names; in this case, a legend is included in theoutput object.

condense if TRUE, reformats the alias information to be comparable to the version calcu-lated by internal function alias3fi; does not work with models with higher than3-way interactions; for up to 3-way interactions, the output may be more easilyreadible

design a data frame of class design that should contain a fractional factorial 2-leveldesign; the function does not print anything if the design is of different nature

x an object of class aliases that should be the output from function aliases

... further arguments to function print.default;the quote argument cannot be used

Value

Function aliasprint returns NULL and is called for its side effects only.

Per default, Function aliases returns a list with two elements:

legend links the codes to variable names, if code=TRUE.

aliases is a list of vectors of aliased effects.

Page 9: Package 'FrF2' - Cran

block 9

If option condense is TRUE, the function returns a list with elements legend, main, fi2 and fi3; thismay be preferrable for looking at the alias structure of larger designs.

The output object of function aliases has class aliases, which is used for customized printingwith the print method.

Author(s)

Ulrike Groemping

References

Box G. E. P, Hunter, W. C. and Hunter, J. S. (2005) Statistics for Experimenters, 2nd edition. NewYork: Wiley.

See Also

FrF2-package for information on the package, alias for the built-in R-function, IAPlot for effectsplots

Examples

### Injection Molding Experiment. Box et al. 1978.data(BM93.e3.data, package="BsMD") #from BsMDiMdat <- BM93.e3.data[1:16,2:10] #only original experiment# make data more user-friendlycolnames(iMdat) <- c("MoldTemp","Moisture","HoldPress","CavityThick",

"BoostPress","CycleTime","GateSize","ScrewSpeed","y")# determine aliases with all 2-factor-interactionsaliases(lm(y ~ (.)^2, data = iMdat))# coded versionaliases(lm(y ~ (.)^2, data = iMdat), code=TRUE)# determine aliases with all 3-factor-interactionsaliases(lm(y ~ (.)^3, data = iMdat), code=TRUE)# show condensed formaliases(lm(y ~ (.)^3, data = iMdat), code=TRUE, condense=TRUE)# determine aliases for unaliased modelaliases(lm(y ~ ., data = iMdat))

block Statistical and algorithmic aspects of blocking in FrF2

Description

This help page documents the statistical and algorithmic details of blocking in FrF2

Page 10: Package 'FrF2' - Cran

10 block

Details

Blocking is done with the purpose to balance the design with respect to a factor that is known orstrongly suspected to have an influence but is not in itself of interest, and it is usually assumed thatblock factors do not interact with experimental factors. Examples are batches of material that arenot large enough to accomodate the complete experiment so that e.g. half the experiment is doneon the first batch and the other half on the second batch (two blocks). The block factor should beorthogonal to the experimental factors, at least to their main effects. Per default, it is also requestedthat the block factor is orthogonal to the 2-factor interactions. This can be changed by the user, ifno such design can be found.

Blocking is currently implemented for regular fractional factorial designs only.There are two principal ways to handle blocked designs, manual definition (i.e. the user specifiesexactly which columns are to be used for which purpose) and automatic definition. Each situationhas its specifics. These are detailed below. For users with not so much mathematical/statisticalbackground, it will often be best to use the automatic way, specifying the treatement factors ofinterest via nfactors or factor.names and a single number for blocks or WPs. Users with moremathematical background may want to use the manual definitions, perhaps in conjunction with pub-lished catalogues of good block designs, or after inspecting possibilities with functions blockpickor blockpick.big.

Manual definition of blocked designs for regular fractional factorials The user can start from adesign with a number of factors and manually specify which factors or interactions are to beused as block generators. If this route is chosen, blocks can be a vector of factor names orfactor letters, or of the same form as generators, except that not only base factors but all factorscan be used and single factors are permitted (which would lead to resolution II designs if usedin generators). For example,block = Letters[c(2,4,5)]orblock = list(2,4,5)specify that the 2nd, 4th and 5th factor are to be used as block generators, whileblock = c("Day","Shift")indicates that the named factors “Day” and “Shift” specified in factor.names are to be treatedas blocking factors). In this case, the number of blocks is calculated, and a new factor withthe default name “Blocks” (in general the name chosen in option block.name) is generated,which would for example contain as levels the Day/Shift combinations. It is also possible tochoose interaction effects rather than factors themselves as block generators, e.g.block = c("ABCD","EFGH")orblock = list(c(1,2,3,4),c(5,6,7,8)) .Finally, it is also possible to specify choice of blocks using a vector of Yates column numbers,in order to be able to use catalogued blocking structures of this form, e.g. from Sitter, Chenand Feder (1997).The block main effects are defined by the k.block specified effect and all interactions betweenthem. The specified block effects are required to be independent from each other, whichimplies that they generate 2^k.block blocks.CAUTION: If the user manually generates a blocked design, it is his/her responsibility toensure a good choice of design (e.g. by using a catalogued design from Bisgaard 1994, Sun,Wu and Chen 1997, Sitter, Chen and Feder (1997), or Cheng and Wu 2002).

Automatic definition of blocked designs for regular fractional factorials If the user only speci-

Page 11: Package 'FrF2' - Cran

block 11

fies the number of blocks required for the experiment, function FrF2 automatically generatesthe blocks. For full factorial designs, function FrF2 uses the Sun, Wu and Chen (1997) cata-logue of blocked designs (implemented in function blockpick). Otherwise, depending on thesize of the problem, function FrF2 uses function blockpick or function blockpick.big forfinding an appropriate allocation of block generator columns: Smaller problems(choose(nruns-1-nfactors,k.block) < 100000)are treated with blockpick.The search for an appropriate blocked design starts with the overall best unblocked design (interms of aberration or MaxC2, if requested). If this best design does not yield an adequateblocking possibility, the search continues with the next best design and so forth.For the smaller problems, function blockpick looks for k.block independent subsets amongthe eligible columns of the design. (The eligible columns are all columns of the Yates ma-trix that are neither occupied by treatment main effects nor by 2fis among treatments (ifalias.block.2fis=FALSE, which is the default), or all columns of the Yates matrix that arenot occupied by treatment main effects (if alias.block.2fis=TRUE). Note that no effort ismade to avoid aliasing with 2-factor interactions, if alias.block.2fis=TRUE is chosen.For the larger problems, function blockpick.big permutes the k~base factors of candidatedesigns with nfactors + k.block factors in search of a design the first k.block~factorsof which can be used for block construction. In the latter case, any specification of design(via options design or generators) is ignored. Note that function blockpick.big is notguaranteed to find an existing blocked design.Sun, Wu and Chen (1997) provide a catalogue of blocked designs with a few quality criteria,and they state that there is no single best design, but that the choice depends on the situation.FrF2 always comes up with one specific solution design. Comparisons to the catalogueddesigns in Sun, Wu and Chen (1997) have shown that the designs found in FrF2 are often butnot always isomorphic to the catalogued ones. Differences do occur, especially if the basedesigns are resolution III, or if blockpick.big has to be used. Users who want to be certainto use a “best” blocked design should manually implement a specific catalogued design orinspect several solutions from functions blockpick blockpick.big.

Please contact me with any suggestions for improvements.

Author(s)

Ulrike Groemping

References

Bisgaard, S. (1994a). Blocking generators for small 2\^(k-p) designs. J. Quality Technology 26,288-294.

Chen, J., Sun, D.X. and Wu, C.F.J. (1993) A catalogue of 2-level and 3-level orthogonal arrays.International Statistical Review 61, 131-145.

Cheng, C.-S. and Tsai, P.-W. (2009). Optimal two-level regular fractional factorial block and split-plot designs. Biometrika 96, 83-93.

Cheng, S.W. and Wu, C.F.J. (2002). Choice of optimal blocking schemes in 2-level and 3-leveldesigns. Technometrics 44, 269-277.

Sitter, R.R., Chen, J. and Feder, M. (1997). Fractional Resolution and Minimum Aberration inBlocked 2n-k Designs. Technometrics 39, 382–390.

Page 12: Package 'FrF2' - Cran

12 blockpick

Sun, D.X., Wu, C.F.J. and Chen, Y.Y. (1997). Optimal blocking schemes for 2\^p and 2\^(n-p)designs. Technometrics 39, 298-307.

See Also

See Also FrF2 for regular fractional factorials, catlg for the Chen, Sun, Wu catalogue of designsand some accessor functions, and splitplot for the statistical aspects of split-plot designs.

Examples

########## automatic blocked designs ##################### from a full factorial ##FrF2(8,3,blocks=2)## with replicationrun.order(FrF2(8,3,blocks=2,wbreps=2))run.order(FrF2(8,3,blocks=2,wbreps=2,repeat.only=TRUE))run.order(FrF2(8,3,blocks=2,bbreps=2))run.order(FrF2(8,3,blocks=2,bbreps=2,wbreps=2))

## automatic blocked design with fractionsFrF2(16,7,blocks=4,alias.block.2fis=TRUE)## isomorphic non-catalogued design as basisFrF2(16,gen=c(7,11,14),blocks=4,alias.block.2fis=TRUE)## FrF2 uses blockpick.big and ignores the generatorFrF2(64,gen=c(7,11,14),blocks=16,alias.block.2fis=TRUE)

########## manual blocked design ####################### example that shows why order of blocks is not randomized### can of course be randomized by user, if appropriateFrF2(32,9,blocks=c("Day","Shift"),alias.block.2fis=TRUE,

factor.names=list(Day=c("Wednesday","Thursday"), Shift=c("Morning","Afternoon"),F1="",F2="",F3="",F4="",F5="",F6="",F7=""), default.levels=c("current","new"))

blockpick Function to show potential block assignments

Description

Functions to investigate potential assignments of blocks and show alias information of resultingdesigns, meant for expert users

Usage

blockpick(k, gen, k.block, design = NULL, show = 10,alias.block.2fis = FALSE, select.catlg = catlg)

blockpick.big(k, gen, k.block, design = NULL, show = 10,alias.block.2fis = FALSE, select.catlg = catlg)

Page 13: Package 'FrF2' - Cran

blockpick 13

Arguments

k the number of base factors (designs have 2^k runs)gen vector of generating columns from Yates matrix; for a full factorial, choose

gen = 0 or gen=numeric(0) for no generating columns; but note that there isalways just the one and only catalogued design returned for a full factorial.For function blockpick, gen refers to the generators of the base design only,and block columns are automatically added by blockpick.For function blockpick.big, gen refers to the generators for treatment factorsand block generators. In fact, blockpick.big will always use the first k.block(base) factors for block generation. Hence, for example for generating a designin 64 runs and 7 factors with 32 blocks, gen must have 6 entries in order toaccomodate the 7 treatment factors together with the 5 block generators.

k.block number of base factors needed for constructing blocks; there will be 2^k.blockblocks in the design

design design name (character string) of a specific design from the catalogue given inselect.catlg

show numeric integer indicating how many results are to be shown; the search forpossible allocations stops, once show variants have been found. Note that thebest designs may not be found early in the process, especially if a large numberof eligible columns is available and many blocks are needed (e.g. full factorialin 64 runs with 16 blocks). In such cases, increasing show may lead to finding abetter design (but may also increase calculation time from long to unbearable).

alias.block.2fis

logical, indicates whether 2fis may be aliased with blocksselect.catlg design catalogue of class catlg

Details

Function blockpick is used per default by function FrF2 for problems with choose(nruns-1-nfactors,k.block) < 100000,otherwise blockpick.big is used. blockpick is preferrable for smaller problems, because it willfind a design, if it exists. However, it may take a long time and/or much storage space in problemswith large numbers of runs and blocks.

Both functions investigate the potential assignment of blocks such that main effects of treatmentfactors are not aliased with block main effects. It is left to the user whether or not 2fis amoongtreatment effects may be aliased with block main effects (option alias.block.2fis).

Following Sun, Wu and Chen (1997), there is no single best block assignment. blockpick usestheir catalogue for full factorials (implemented up to 256 runs). For fractional factorials, it developsdesigns according to a principle similar to that underlying the Sun Wu Chen catalogue that worksalso in uncatalogued situations.

Function blockpick.big uses a strategy similar to splitpick and leftadjust and often findsa solution quickly where blockpick does not work with the given ressources. However, it is notguaranteed to find existing solutions or a best solution.

Value

The function blockpick outputs a list of entries with information on at most show suitable assign-ments. It ends with an error, if no suitable solution can be found.

Page 14: Package 'FrF2' - Cran

14 blockpick

gen generator column numbers of the base design (w.r.t. the Yates matrix)

basics named vector with number of runs (nruns), number of blocks (nblocks), num-ber of treatment factors (ntreat) and resolution of base design (res.base); thevector is numeric or character, depending on whether resolution is known ex-actly or as “5+” only

blockcols matrix with at most show rows; each row contains the k.block column numbers(w.r.t. the Yates matrix) of the block generators for the current assignment (the2^k.block-1 columns for block main effects can be obtained from these).

alias.2fis.block

list of character vectors, which contain the 2fis aliased with block main effectsfor the respective rows of blockcols

nblock.2fis vector with number of 2fis aliased with block main effects for the respectiverows of blockcols

nclear.2fis vector with number of 2fis clear (of aliasing with block main effects and treat-ment main effects or 2fis) for the respective rows of blockcols

clear.2fis list of character vectors, which contain the 2fis that are counted in nclear.2fisfor the respective rows of blockcols

Author(s)

Ulrike Groemping

References

Chen, J., Sun, D.X. and Wu, C.F.J. (1993) A catalogue of 2-level and 3-level orthogonal arrays.International Statistical Review 61, 131-145.

Sun, D.X., Wu, C.F.J. and Chen, Y.Y. (1997). Optimal blocking schemes for 2\^p and 2\^(n-p)designs. Technometrics 39, 298-307.

See Also

See Also FrF2

Examples

## look at possibilities for running a 32 run design with 6 factors in 8 blocks## running this without alias.block.2fis=TRUE throws an error: not possible## Not run: blockpick(k=5,design="6-1.1",k.block=3)## the 8th to 10th design have more clear 2fis than the earlier onesblockpick(k=5,design="6-1.1",k.block=3,alias.block.2fis=TRUE)## function FrF2 can be used to manually accomodate thisdes32.6fac.8blocks.MaxC2 <- FrF2(32,6,blocks=c(3,12,21))summary(des32.6fac.8blocks.MaxC2)## automatic block generation leads to more aliased 2fissummary(FrF2(32,6,blocks=8,alias.block.2fis=TRUE))

## look at possibilities for blocking design 7-3.1 from Chen, Sun, Wu catalogueblockpick(4,design="7-3.1",k.block=2,alias.block.2fis=TRUE)

Page 15: Package 'FrF2' - Cran

BsProb.design 15

## big design## running this throws an error on many machines because of too little memory## Not run: blockpick(6,design="7-1.2",k.block=5,alias.block.2fis=TRUE)## for obtaining a design for this scenario with blockpick.big,## the number of factors must be increased to 7+k.block=12## designs 12-6.1 and 12-6.2 dont do it, 12-6.3 doesbpb <- blockpick.big(6,design="12-6.3",k.block=5,alias.block.2fis=TRUE)bpb## based on the result of blockpick.big, a blocked design can be obtained as follows:## (not run for saving check time on CRAN)## Not run:des64.7fac.32blocks <- FrF2(64,gen=bpb$gen[1,], blocks = as.list(1:5),

alias.block.2fis=TRUE)str(des64.7fac.32blocks)## if the seven factors are to be named A,...,G:des64.7fac.32blocks <- FrF2(64,gen=bpb$gen[1,], blocks = as.list(1:5),

alias.block.2fis=TRUE, factor.names=c(paste("b",1:5,sep=""),Letters[1:7]))str(des64.7fac.32blocks)

## End(Not run)

BsProb.design Bayesian posterior probabilities from Box and Meyer method

Description

The function calculates Bayesian posterior probabilities according to Box and Meyer (1993) forscreening experiments with 2-level factors. The function is modified from function BsProb inpackge BsMD with the purpose of providing usage comfort for class design objects.

Usage

BsProb.design(design, mFac = NULL, response=NULL, select=NULL, mInt = 2, p = 0.25, g = 2,ng = 1, nMod = 10)

Arguments

design an experimental design of class design with the type element of the design.infoattribute containing “FrF2” or “pb” and at least one response variable

response NULL or a character string that specifies response variable to be used, mustbe an element of response.names(obj); if NULL, the first response fromresponse.names(obj) is used

mFac integer. Maximum number of factors included in the models. The default is thenumber of factors in the design.

select vector with position numbers of the factors to be included;default: all factors.

Page 16: Package 'FrF2' - Cran

16 BsProb.design

mInt integer <= 3. Maximum order of interactions considered in the models. Thiscan strongly impact the result.

p numeric. Prior probability assigned to active factors. This can strongly impactthe result.

g numeric vector. Variance inflation factor(s) gamma associated to active and in-teraction factors; see "Details" section

ng integer <=20. Number of different variance inflation factors (g) used in calcula-tions.

nMod integer <=100. Number of models to keep with the highest posterior probability.

Details

Factor and model posterior probabilities are computed by the Box and Meyer (1993) Bayesianprocedure. The design factors - or a selection of these given by column numbers in select - areconsidered together with the specified response or the first response of the design. The functionhas been adapted from function BsProb in package BsMD, and a vignette in that package (../../BsMD/doc/BsMD.pdf) explains details of the usage regarding the parameters.

If g, the variance inflation factor (VIF) gamma, is a vector of length 1, the same VIF is used forfactor main effects and interactions. If the length of g is 2 and ng is 1, g[1] is used for factormain effects and g[2] for the interaction effects. If ng greater than 1, then ng values of VIFsbetween g[1] and g[2] are used for calculations with the same gamma value for main effects andinteractions. The function calls the FORTRAN subroutine bm and captures summary results. Thecomplete output of the FORTRAN code is save in the BsPrint.out file in the working directory.The output is a list of class BsProb for which print, plot and summary methods are available frompackage BsMD.

Value

cf. documentation of function BsProb

Author(s)

Daniel Meyer, ported to R by Ernesto Barrios, port adapted to designs by Ulrike Groemping.

References

Barrios, E. (2013). Using the BsMD Package for Bayesian Screening and Model Discrimination.Vignette. ../../BsMD/doc/BsMD.pdf.

Box, G. E. P and R. D. Meyer (1986). An Analysis for Unreplicated Fractional Factorials. Techno-metrics 28, 11-18.

Box, G. E. P and R. D. Meyer (1993). Finding the Active Factors in Fractionated Screening Exper-iments. Journal of Quality Technology 25, 94-105.

See Also

plot.BsProb, print.BsProb, summary.BsProb, BsMD

Page 17: Package 'FrF2' - Cran

CatalogueAccessors 17

Examples

### there are several success stories and recommendations for this method### in the simulated example here (not fabricated,### it was the first one that came to my mind),### the method goes wrong, at least when using mInt=2 (the default, because### Daniel plots work quite well for pure main effects models):### active factors are A to E (perhaps too many for the method to work),### the method identifies F, J, and L with highest probability### (but is quite undecided)plan <- pb(12)dn <- desnum(plan)set.seed(8655)y <- dn%*%c(2,2,2,2,3,0,0,0,0,0,0) + dn[,1]*dn[,3]*2 - dn[,5]*dn[,4] + rnorm(12)/10plan.r <- add.response(plan, response=y)plot(bpmInt2 <- BsProb.design(plan.r), code=FALSE)plot(bpmInt1 <- BsProb.design(plan.r, mInt=1), code=FALSE) ## much better!summary(bpmInt2)summary(bpmInt1)### For comparison: A Daniel plot does not show any significant effects according### to Lenths method, but makes the right effects stick outDanielPlot(plan.r, half=TRUE, alpha=1)

CatalogueAccessors Catalogue file and accessor functions

Description

Functions to select elements or extract information from design catalogues of class catlg

Usage

res(catlg)## S3 method for class 'catlg'res(catlg)nruns(catlg)## S3 method for class 'catlg'nruns(catlg)nfac(catlg)## S3 method for class 'catlg'nfac(catlg)WLP(catlg)## S3 method for class 'catlg'WLP(catlg)nclear.2fis(catlg)## S3 method for class 'catlg'nclear.2fis(catlg)clear.2fis(catlg)## S3 method for class 'catlg'

Page 18: Package 'FrF2' - Cran

18 CatalogueAccessors

clear.2fis(catlg)all.2fis.clear.catlg(catlg)

dominating(catlg)## S3 method for class 'catlg'dominating(catlg)catlg## S3 method for class 'catlg'catlg[i]## S3 method for class 'catlg'print(x, name="all", nruns="all", nfactors="all",

res.min=3, MaxC2=FALSE, show=10,gen.letters=FALSE, show.alias=FALSE, ...)

block.catlg

Arguments

catlg Catalogue of designs of class catlg (cf. details section)

i vector of index positions or logical vector that can be used for indexing a catlgobject

x an object of class catlg

name character vector of entry names from x; default “all” means: no selection made

nruns numeric integer (vector), giving the run size(s) for entries of x to be shown;default “all” means: no selection made

nfactors numeric integer (vector), giving the factor number(s) for entries of x to beshown; default “all” means: no selection made

res.min numeric integer giving the minimum resolution for entries of x to be shown

MaxC2 logical indicating whether designs are ordered by minimum aberration (default,MaxC2=FALSE) or by maximum number of clear 2fis (MaxC2=TRUE)

show integer number indicating maximum number of designs to be shown; default is10

gen.letters logical indicating whether the generators should be shown as column num-bers (default, gen.letters=FALSE) or as generators with factor letters (e.g.E=ABCD, gen.letters=TRUE)

show.alias logical indicating whether the alias structure (up to 2fis) is to be printed

... further arguments to function print

block.catlg data frame with block generators for full factorial designs up to 256~runs, takenfrom Sun, Wu and Chen (1997)

Details

The class catlg is a named list of design entries. Each design entry is again a list with the followingitems:

res resolution, numeric, i.e. 3 denotes resolution III and so forth

Page 19: Package 'FrF2' - Cran

CatalogueAccessors 19

nfac number of factors

nruns number of runs

gen column numbers of additional factors in Yates order

WLP word length pattern (starting with words of length 1, i.e. the first two entries are 0 for alldesigns in catlg)

nclear.2fis number of clear 2-factor interactions (i.e. free of aliasing with main effects or other2-factor interactions)

clear.2fis 2xnclear.2fis matrix of clear 2-factor interactions (clear to be understood in the abovesense); this matrix represents each designs clear interaction graph, which can be used in au-tomated searches for designs that can accomodate (i.e. clearly) a certain requirement set of2-factor interactions; cf. also estimable.2fis

all.2fis.clear vector of factors with all 2-factor interactions clear in the above sense

dominating logical that indicates whether the current design adds a CIG structure that has notbeen seen for a design with less aberration (cf. Wu, Mee and Tang 2012 p.196 for dominatingdesigns); TRUE, if so; FALSE, if current CIG is isomorphic to previous one or has no edges(IMPORTANT: the dominance assessment refers to the current catalogue; for designs withmore than 64 runs, it is possible that a design marked dominating in catalogue catlg is notdominating when considering ALL non-isomorphic designs).This element is helpful in omitting non-promising designs from a search for a clear design.This element may be missing. In that case, all catalogue entries are assumed dominating.

Reference to factors in components clear.2fis and all.2fis.clear is via their position number(element of (1:nfac)).

The print function for class catlg gives a concise overview of selected designs in any designcatalogue of class catlg. It is possible to restrict attention to designs with certain run sizes, numbersof factors, and/or to request a minimum resolutions. Designs are ordered in decreasing quality,where the default is aberration order, but number of clear 2fis can be requested alternatively. Thebest 10 designs are displayed per default; this number can be changed by the show option. Optionsgen.letters and show.alias influence the style and amount of printed output.

The catalogue catlg, which is included with package FrF2, is of class catlg and is a living object,since it has to be updated with recent research results for larger designs. In particular, new MAdesigns may be found, or it may be proven that previous “good” designs are in fact of minimumaberration.

Currently, the catalogue contains

• the Chen, Sun and Wu (1993) 2-level designs (complete list of 2-level fractional factorialsfrom 4 to 32~runs, complete list of resolution IV 2-level fractional factorials with 64~runs).Note that the Chen Sun Wu paper only shows a selection of the 64~run designs, the completecatalogue has been obtained from Don Sun and is numbered according to minimum aberration(lower number = better design); numbering in the paper is not everywhere in line with thisnumbering.

• minimum aberration (MA) resolution III designs for 33 to 63 factors in 64 runs. The firstfew of these have been obtained from Appendix G of Mee 2009, the designs for 38 and morefactors have been constructed by combining a duplicated minimum aberration design in 32runs and the required number of factors with columns 32 to 63 of the Yates matrix for 64 rundesigns. Using complementary design theory (cf. e.g. Chapter 6.2.2 in Mee 2009), it can be

Page 20: Package 'FrF2' - Cran

20 CatalogueAccessors

shown that the resulting designs are minimum aberration (because they are complementary tobasically the same designs as the designs in 32 runs on which they are based). The author isgrateful to Robert Mee for pointing this out.

• the MA designs in 128 runs:

– for up to 24 factors obtained from Xu (2009),– for 25 to 64 factors taken from Block and Mee (2005, with corrigendum 2006),– for 65 to 127 factors (resolution III): up to 69 factors coming from Appendix G in Mee,

whereas the designs for 70 or more factors have been constructed according to the sameprinciple mentioned for the 64 run designs.

• various further “good” resolution IV designs in 128 runs obtained by evaluating designs fromthe complete catalogue by Xu (2009, catalogue on his website) w.r.t. aberration and number ofclear 2fis (including also all designs that yield minimum aberration clear compromise designsaccording to Groemping 2010).Note that the complete catalogue of non-isomorphic resolution IV designs in 128 runs isavailable for up to 24 factors. For up to 23 factors, it is separately provided in package(FrF2.catlg128), since it is quite large and should not be forced upon users of this pack-age who do not need it; the very large catalogue for 24 factors can be separately downloadedfrom the authors website (as an R work space).

• the best (MA) resolution IV or higher designs in256 runs for up to 36 factors (resolution V up to 17 factors),512 runs for up to 29 factors (resolution V for up to 23 factors).These have been taken from Xu (2009) with additions by Ryan and Bulutoglu (2010).

• Further “good” resolution IV designs with up to 80 factors in 256 runs and up to 160 factorsin 512 runs have also been implemented from Xu (2009).

• the best (MA) resolution V or higher design for each number of factors or a “good” such de-sign (if it is not known which one is best) in1024 runs (up to 33 factors, MA up to 28 factors, resolution VI up to 24 factors),2048 runs (up to 47 factors, MA up to 32 factors, resolution VI up to 34 factors),and 4096 runs (up to 65 factors, MA up to 26 factors, resolution VI up to 48 factors).

Most of the large designs in catlg have been taken from Xu (2009), where complete cata-logues of some scenarios are provided (cf. also his website) as well as “good” (not necessarilyMA) designs for a larger set of situations. Some of the good designs by Xu (2009) have laterbeen shown to be MA by Ryan and Bulutoglu (2010), who also found some additional largerMA designs, which are also included in catlg. Non-MA designs that were already availablebefore Bulutoglu (2010) are still in the catalogue with their old name. (Note that designs thatare not MA and cannot be placed in the ranking do not have a running number in the designname; for example, the MA 2048 runs design in 28 factors is named 28-17.1, the older previ-ous design that was not MA is named 28-17 (without “.1” or another placement, because thedesigns position in the ranking of all designs is not known.))

There are also some non-regular 2-level fractional factorial designs of resolution V which may beinteresting, as it is possible to increase the number of factors for which resolution V is possible (cf.Mee 2009, Chapter 8). These are part of package DoE.base, which is automatically loaded withthis package. With versions higher than 0.9-14 of that package, the following arrays are available:L128.2.15.8.1, which allows 4 additional factors and blocking into up to 8 blocksL256.2.19, which allows just 2 additonal factors

Page 21: Package 'FrF2' - Cran

CatalogueAccessors 21

L2048.2.63, which allows 16 additional factors. These non-regular arrays should be fine for mostpurposes; the difference to the arrays generated by function FrF2 lies in the fact that there is partialaliasing, e.g. between 3-factor interactions and 2-factor interactions. This means that an affected3-factor interaction is partially aliased with several different 2-factor interactions rather than beingaliased either fully or not at all.

Value

[ selects a subset of designs based on i, which is again a list of class catlg, even if a singleelement is selected. res, nruns, nfac, nclear.2fis and dominating return a named vector, theprint method does not return anything (i.e. it returns NULL), and the remaining functions return alist.

Author(s)

Ulrike Groemping

References

Block, R. and Mee, R. (2005) Resolution IV Designs with 128 Runs Journal of Quality Technology37, 282-293.

Block, R. and Mee, R. (2006) Corrigenda Journal of Quality Technology 38, 196.

Chen, J., Sun, D.X. and Wu, C.F.J. (1993) A catalogue of 2-level and 3-level orthogonal arrays. Int.Statistical Review 61, 131-145.

Groemping, U. (2010). Creating clear designs: a graph-based algorithm and a catalogue of clearcompromise plans. Reports in Mathematics, Physics and Chemistry, report 05/2010, DepartmentII, Beuth University of Applied Sciences Berlin.

Mee, R. (2009). A Comprehensive Guide to Factorial Two-Level Experimentation. New York:Springer.

Ryan, K.J. and Bulutoglu, D.A. (2010). Minimum Aberration Fractional Factorial Designs WithLarge N. Technometrics 52, 250-255.

Sun, D.X., Wu, C.F.J. and Chen, Y.Y. (1997). Optimal blocking schemes for 2\^p and 2\^(n-p)designs. Technometrics 39, 298-307.

Wu, H., Mee, R. and Tang, B. (2012). Fractional Factorial Designs With Admissible Sets of ClearTwo-Factor Interactions. Technometrics 54, 191-197.

Xu, H. (2009) Algorithmic Construction of Efficient Fractional Factorial Designs With Large RunSizes. Technometrics 51, 262-277.

See Also

See also FrF2, oa.design

Examples

c8 <- catlg[nruns(catlg)==8]nclear.2fis(c8)clear.2fis(c8)

Page 22: Package 'FrF2' - Cran

22 CIG

all.2fis.clear.catlg(c8)

## usage of print function for inspecting catalogued designs## the first 10 resolution V+ designs in catalogue catlgprint(catlg, res.min=5)## the 10 resolution V+ designs in catalogue catlg with the most factors## (for more than one possible value of nfactors, MaxC2 does usually not make sense)print(catlg, res.min=5, MaxC2=TRUE)

## designs with 12 factors in 64 runs (minimum resolution IV because## no resolution III designs of this size are in the catalogue)## best 10 aberration designsprint(catlg, nfactors=12, nruns=64)## best 10 clear 2fi designsprint(catlg, nfactors=12, nruns=64, MaxC2=TRUE)## show alias structureprint(catlg, nfactors=12, nruns=64, MaxC2=TRUE, show.alias=TRUE)## show best 20 designsprint(catlg, nfactors=12, nruns=64, MaxC2=TRUE, show=20)

## use vector-valued nrunsprint(catlg, nfactors=7, nruns=c(16,32))## all designs (as show=100 is larger than available number of designs)## with 7 or 8 factors in 16 runsprint(catlg, nfactors=c(7,8), nruns=16, show=100)

## the irregular resolution V arrays from package DoE.base (from version 0.9-17)## designs can be created from them using function oa.design## Not run:## not run in case older version of DoE.base does not have theselength3(L128.2.15.8.1)length4(L128.2.15.8.1) ## aliasing of 2fis with block factorlength4(L128.2.15.8.1[,-16])

length3(L256.2.19)length4(L256.2.19)

##length3(L2048.2.63)##length4(L2048.2.63) do not work resource wise## but the array is also resolution V (but irregular)

## End(Not run)

CIG Clear interactions graph from catlg entry

Description

Function CIG creates a clear interactions graph (CIG) from a catlg design (design name must begiven). Function CIGstatic allows to create a static graph from a dynamically-adjusted one.

Page 23: Package 'FrF2' - Cran

CIG 23

Usage

CIG(design, select.catlg=catlg, static=FALSE, layout=layout.auto, label="num",plot=TRUE, ...)

CIGstatic(graph, id, label="num", xlim=c(-1,1), ylim=c(1,-1), ...)gen2CIG(nruns, gen)

Arguments

design a character string that identifies a design in the cataloge specified by optionselect.catlg,OR a class catlg object with a single entry,OR a formula with all main effects and the requested clear 2-factor interactions,OR a character vector of length more than one with two-letter combinations ofthe clear 2-factor interactions,OR a numeric two-row matrix with factor numbers of the clear 2-factor interac-tions,OR a character two-row matrix with factor names of the clear 2-factor interac-tions.The first two are for graphing design CIGs, the other ones for requirement setCIGs.

... further arguments to be passed to function tkplot, or graphical parameters tobe passed to plot.

select.catlg name of catalogue (not in quotes); only relevant, if design is a character string

static logical. If TRUE, a static graphic is produced, otherwise an interactive graphicis created that can be modified by moving aroung nodes; only relevant forplot=TRUE

layout ignored for static=FALSE;possible values are two-column matrices with number of rows equal to the num-ber of vertices of the graph, or layout parameters for function plot.igraph asdescribed in plot.common and layout;default: layout.auto (changed with version 1.6, was layout.circle before

label in effect for catlg object only (character design name or class catlg object);a character string that decides for numeric labels or character labels; any stringother than the default will invoke the factor letters as labels

plot a logical that decides whether a plot is requested (default: TRUE);plotting can be suppressed, if graph creation is desired for calculating graphcharacteristics with functions from package igraph (e.g. clique.number, largest.cliques,independence.number, degree)

graph a graph object from package igraph, or a list whose first element is such a graphobject (like the output from function CIG)

id identification number of the interactive graph to be reproduced in static form;this number can be found in the header line of the graphics window

xlim horizontal axis limits

ylim vertical axis limits (per default reversed in order to exactly reproduce the inter-active graph)

Page 24: Package 'FrF2' - Cran

24 CIG

nruns number of runs of the design to be graphed

gen generator (vector of Yates matrix column numbers)

Details

The design depicted in CIG has to be the name (character string) of a regular fractional factorial2-level design present in select.catlg.

Clear 2fis are depicted as edges in the graph. In the interactive graph, users can change the layoutmanually or with the menus. For example, the Reingold-Tilford layout can be chosen, with a rootvertex specified; this sometimes helps in identifying groups of vertices that are not connected witheach other.

Previous versions of package igraph used to internally number the vertices from 0 to number ofvertices -1, not from 1 to number of vertices. This has been changed in June 2012 (FrF2 adapted tothis change with version 1.5).

Function CIGstatic serves the purpose to statically create the current interactively modified graph;the usual annotation possibilities for plots are available.

Function gen2CIG returns a graph object that can be plotted or otherwise investigated with graph-related functionality.

Value

For plot=FALSE or plot=TRUE with static=TRUE, function CIG visibly (plot=FALSE) or invisibly(plot=TRUE) returns a graph from package igraph.For plot=TRUE with static=FALSE, the function returns a list with the first element graph theelement coords with the coordinates of that graph.Function CIGstatic works on the list produced by function CIG by plotting the graph staticallyusing the positioning from the current interactive picture.

Function gen2CIG returns a clear interactions graph that can e.g. be plotted with functions plot(plot.igraph) or tkplot.

Author(s)

Ulrike Groemping

References

Groemping, U. (2010). Creating clear designs: a graph-based algorithm and a catalogue of clearcompromise plans. Reports in Mathematics, Physics and Chemistry, report 05/2010, DepartmentII, Beuth University of Applied Sciences Berlin. (Preprint for IIE Transactions; IIE Transactions isavailable at http://www.tandfonline.com.)

See Also

plot.igraph, tkplot, plot.common

Page 25: Package 'FrF2' - Cran

CIG 25

Examples

## Not run:ex.CIG <- CIG("9-4.2")## play around with the dynamic graph until it looks right## look up its id number in the title bar of the graph window and use it for idpar(xpd=TRUE)CIGstatic(ex.CIG, id=1)

## End(Not run)

graph1 <- CIG("9-4.2", plot=FALSE) ### create graph object from design name### calculate graph propertiesrequire(igraph)degree(graph1)clique.number(graph1)independence.number(graph1)largest.cliques(graph1)

graph2 <- gen2CIG(32, c(7,11,14,29)) ### create graph object from generator columns### check isomorphism to graph1graph.isomorphic(graph1,graph2)

## Not run:## use a CIG for manual design search## requirement set:estim <- compromise(17,15:17)$requirement ## all interactions of factors 15 to 17 (P,Q,R)## graph the requirement set CIGCIG(estim)FrF2(128, 17, estimable=estim) ## will run for a very long time## interrupt with ESC key, after a short period of waitingFrF2.currentlychecked() ## displays the design that is currently checked

## should be 17-10.2407CIG("17-10.2407")## clearly, using columns 1, 8 and 9 for factors 15:17 does the job

## sometimes, the design where the algorithm got stuck, does not provide a solution## in that case, option select.catlg can be used for restricting the search designs## to designs further down in the catalogue, in order to find the next candidate## until final success is reached## e.g.which(names(catlg)=="17-10.2407")FrF2(128, 17, estimable=estim, select.catlg=catlg[2375:length(catlg)])## will run for a very long time## interrupting after short waiting time yieldsFrF2.currentlychecked() ## displays the design that is currently checked

## should be 17-10.4177

## note: in this example, option sort="high" would make the automatic search fast## so that manual treatment is not needed!

## End(Not run)

Page 26: Package 'FrF2' - Cran

26 compromise

compromise Function to support estimability requests for compromise designs

Description

Addelman (1962) and Ke and Wu (2005) discuss compromise plans of different types. Their cre-ation is supported by the function compromise.

Usage

compromise(nfactors, G1, class=3, msg=TRUE)

Arguments

nfactors overall number of factors

G1 vector with indices of factors in group G1 (cf. details)

class class of compromise designs that is to be generated; 1, 2, 3, or 4, cf. detailsbelow

msg logical stating whether the minnruns.clear element of the result should bereported in a message

Details

For compromise plans, the factors are decomposed into a group G1 and a group G2. The differentclasses of compromise plans require estimability of different subsets of 2fis in addition to maineffects:

Class 1: all 2fis within group G1 are estimableClass 2: all 2fis within group G1 are estimable, as well as all 2fis within group G2Class 3: all 2fis within group G1 are estimable, as well as all 2fis between groups G1 and G2Class 4: all 2fis between groups G1 and G2 are estimable

The function returns a list of four components (cf. section “Value”). They can be used as inputfor the function FrF2, if compromise plans are to be created. Both distinct designs (Addelman1962) and clear designs (Ke, Tang and Wu 2005) can be constructed, depending on the settings ofoption clear in function FrF2. More explanations on specifying estimability requirements for 2fisin general are provided under estimable.2fis.

Value

Value is a list of the four components perms.full, requirement, class, and minnrun.clear.The last two components are purely imformative, while the first two provide input parameters forfunction FrF2.requirement can be used for specifying the required 2fis in the estimable option, both withclear=FALSE and clear=TRUE. For clear=FALSE, perms.full can be used in the perms option

Page 27: Package 'FrF2' - Cran

compromise 27

for speeding up the search into a hopefully realistic time frame.minnrun.clear indicates the minimum number of runs needed for a clear design.

Note that the catalogue catlg contains all designs needed for accomodating existing clear com-promise designs in up to 128 runs (even minimum aberration among all existing clear compromisedesigns; for a catalogue of these, cf. Gr\"omping 2010).

Author(s)

Ulrike Groemping

References

Addelman, S. (1962). Symmetrical and asymmetrical fractional factorial plans. Technometrics 4,47-58.

Gr\"omping, U. (2010). Creating clear designs: a graph-based algorithm and a catalogue of clearcompromise plans. Reports in Mathematics, Physics and Chemistry, report 05/2010, DepartmentII, Beuth University of Applied Sciences Berlin. (Preprint for IIE Transactions; IIE Transactions isavailable at http://www.tandfonline.com.)

Ke, W., Tang, B. and Wu, H. (2005). Compromise plans with clear two-factor interactions. Statis-tica Sinica 15, 709-715.

See Also

See Also FrF2 for creation of regular fractional factorial designs as well as estimable.2fis forstatistical and algorithmic information on estimability of 2-factor interactions

Examples

## seven factors two of which are in group G1C1 <- compromise(7, c(2,4), class=1)C1$perms.full ## the same for all classesC1$requirementC2 <- compromise(7, c(2,4), class=2)C2$requirementC3 <- compromise(7, c(2,4), class=3)C3$requirementC4 <- compromise(7, c(2,4), class=4)C4$requirement

## Not run:########## usage of estimable ###########################

## design with with BD clear in 16 runsFrF2(16,7,estimable = C1$requirement)## design with BD estimable on a distinct column in 16 runs (any design will do,## if resolution IV!!!FrF2(16,7,estimable = C1$requirement, clear=FALSE, perms=C1$perms.full)## all four classes, mostly clear, for 32 runsFrF2(32,7,estimable = C1$requirement)FrF2(32,7,estimable = C2$requirement) ## requires resolution V

## as clear class 2 compromise designs do not exist due to Ke et al. 2005

Page 28: Package 'FrF2' - Cran

28 cubePlot

FrF2(32,7,estimable = C2$requirement, clear=FALSE, perms=C2$perms.full)FrF2(32,7,estimable = C3$requirement)FrF2(32,7,estimable = C4$requirement)## two additional factors H and J that do not show up in the requirement setFrF2(32,9,estimable = C3$requirement)## two additional factors H and J that do not show up in the requirement setFrF2(32,9,estimable = C3$requirement, clear=FALSE)## note that this is not possible for distinct designs in case perms is needed,## because perms must have nfactors columns

## End(Not run)

cubePlot Cube plot for three-factor-effects

Description

A cube plot for the combined effect of three factors is produced (function cubePlot). Functionscubedraw, cubecorners, cubelabel and myscatterplot3d are not intended for users.

Usage

cubePlot(obj, eff1, eff2, eff3, main=paste("Cube plot for",respnam),cex.title=1.5,cex.lab=par("cex.lab"), cex.ax=par("cex.axis"),cex.clab=1.2, size=0.3, round=NULL,abbrev=4,y.margin.add=-0.2, modeled=TRUE)

Arguments

obj a vector of response values to be analyzedORa linear model object with 2-level factors or numerical 2-level variables (CAU-TION: numerical x-variable have to be coded as -1 and +1 only!); the structuremust be such that effects are either fully aliased or orthogonal, like in a fractionalfactorial 2-level design

eff1 cf. eff3

eff2 cf. eff3

eff3 effects to be included in the cube plot (x-, y-, z-direction), EITHER vectors ofequal length (two-level factors or numerical with the two values -1 and 1) ORvariable names of main effects within the obj linear model object (characterstrings)

main title for the plot, respnam is the name of the response variable as determinedfrom the call

cex.title multiplier for size of overall title (cex.main is multiplied with this factor)

cex.ax size of axis tick marks, defaults to cex.axis-parameter

Page 29: Package 'FrF2' - Cran

DanielPlot 29

cex.lab size of axis labels

cex.clab size of corner labels

size size of cube corners

round optional rounding of corner labels (digits argument for function round, e.g.round=0 for integers, round=-1 for multiples of 10, round=1 for 1 decimal place

abbrev number of characters shown for factor levels

y.margin.add adjustment parameter for placement of y-axis labeling

modeled TRUE (default: show modeled means; FALSE: show averagesNOTE: Even when showing modeled means, there also appears to be a three-factor-interaction, if the model contains an effect that is aliased with this inter-action!

Details

cubePlot produces a cube plot of the modeled means or averages of all combinations for threefactors. The other functions are internal and are called by cubePlot. myscatterplot3d is a modifiedversion of scatterplot3d, made more suitable for this situation.

Value

cubePlot is used for its side effects only.

Author(s)

Ulrike Groemping

References

Box G. E. P, Hunter, W. C. and Hunter, J. S. (2005) Statistics for Experimenters, 2nd edition. NewYork: Wiley.

See Also

FrF2-package for examples

DanielPlot Normal or Half-Normal Effects Plots

Description

The function is modified from the same-name function in packge BsMD with the purpose of pro-viding more usage comfort (correct effect sizes in case of factors, automatic annotation, automaticlabelling of the most significant factors only).

Page 30: Package 'FrF2' - Cran

30 DanielPlot

Usage

DanielPlot(fit, ...)## S3 method for class 'design'DanielPlot(fit, ..., response = NULL)## Default S3 method:DanielPlot(fit, code = FALSE, autolab = TRUE, alpha = 0.05, faclab = NULL,

block = FALSE, datax = TRUE, half = FALSE, pch = "*",cex.fac = par("cex.lab"), cex.lab = par("cex.lab"),cex.pch = par("cex"), cex.legend = par("cex.lab"),main = NULL, subtitle=NULL, ...)

Arguments

fit an experimental design of class design with the type element of the design.infoattribute containing “FrF2” or “pb”ORobject of class lm. Fitted model from lm or aov.

... further arguments to be passed to the default function, or graphical parametersto be passed to plot; note that one should not use pch for split-plot designs.

response NULL or a character string that specifies response variable to be used, mustbe an element of response.names(obj); if NULL, the first response fromresponse.names(obj) is used

code logical. If TRUE labels “A”,“B”, etc. are used instead of the names of the coeffi-cients (factors). A legend linking codes to names is provided.

autolab If TRUE, only the significant factors according to the Lenth method (signifi-cance level given by alpha) are labelled.

alpha significanc level for the Lenth method

faclab NULL or list. If NULL, point labels are automatically determined according to thesetting of code (i.e. A,B,C etc. for code=TRUE, natural effect names otherwise)and autolab (i.e. all effects are labelled if autolab=FALSE, only significant ef-fects are labelled if autolab=TRUE). Otherwise, faclab can be used for manuallabelling of certain effects and should be a list with idx (integer vector refer-ring to position of effects to be labelled) and lab (character vector of labels)components.

block logical. If TRUE, the first factor is labelled as “BK” (block).

datax logical. If TRUE, the x-axis is used for the factor effects the the y-axis for thenormal scores. The opposite otherwise.

half logical. If TRUE, half-normal plot of effects is display.

pch numeric or character. Points character.

cex.fac numeric. Factor label character size.

cex.lab numeric. Labels character size.

cex.pch numeric. Points character size.

cex.legend numeric. Legend size in case of codes.

main NULL or character. Title of plot. If NULL, automatic title is generated.

Page 31: Package 'FrF2' - Cran

DanielPlot 31

subtitle NULL or character. Sub title of plot. Should not be used for split-plot designs,because automatic subtitle is generated for these.

Details

The design underlying fit has to be a (regular or non-regular) fractional factorial 2-level design.Effects (except for the intercept) are displayed in a normal or half-normal plot with the effects inthe x-axis by default.

If fit is a design with at least one response variable rather than a linear model fit, the lm-methodfor class design is applied to it with degree high enough that at least one effect is assigned to eachcolumn of the Yates matrix, and the default method for DanielPlot is afterwards applied to theresulting linear model.

For split-plot designs, whole plot effects are shown as different plotting characters, because they arepotentially subject to larger variability, and one should not be too impressed, if they look impres-sively large, as this may well be indication of plot-to-plot variability rather than a true effect.

Value

The function returns an invisible data frame with columns: x, y, no, effect, coded (if coded plotwas requested) and pchs, for the coordinates, the position numbers, the effect names, the codedeffect names, and the plotting characters for plotted points.

The plotting characters are particularly useful for split-plot designs and can be used for subsequentseparate plotting of whole-plot and split-plot effects, if necessary.

Note

If you load package BsMD after package FrF2, a mere call to function DanielPlot will use thefunction from package BsMD rather than the one from package FrF2. You can explicitly requestusage of the FrF2 function by FrF2::DanielPlot.

Author(s)

Ernesto Barrios, modified by Ulrike Groemping.

References

Box G. E. P, Hunter, W. C. and Hunter, J. S. (2005) Statistics for Experimenters, 2nd edition. NewYork: Wiley.

Daniel, C. (1959) Use of Half Normal Plots in Interpreting Two Level Experiments. Technometrics1, 311–340.

Daniel, C. (1976) Application of Statistics to Industrial Experimentation. New York: Wiley.

Lenth, R.V. (1989) Quick and easy analysis of unreplicated factorials. Technometrics 31, 469–473.

Lenth, R.V. (2006) Lenth s Method for the Analysis of Unreplicated Experiments. To appear inEncyclopedia of Statistics in Quality and Reliability, Wiley, New York. Downloadable at http://www.wiley.com/legacy/wileychi/eqr/docs/sample_1.pdf.

Page 32: Package 'FrF2' - Cran

32 estimable.2fis

See Also

qqnorm, halfnormal, LenthPlot, BsMD-package

estimable.2fis Statistical and algorithmic aspects of requesting 2-factor interactionsto be estimable in FrF2

Description

This help page documents the statistical and algorithmic details of requesting 2-factor interactionsto be estimable in FrF2

Details

The option estimable allows to specify 2-factor interactions (2fis) that have to be estimable in themodel. Whenever a resolution V or higher design is available, this option is unnecessary, becauseall 2fis are estimable in the sense that they are not aliased with any main effect or any other 2fi.If resolution V or higher is not affordable, the option estimable can ensure that certain 2fis cannevertheless be estimated.

Per default, it is assumed that a resolution IV design is required, as it is normally not reasonableto allow main effects to be aliased with other 2-factor interactions in this situation. There are twotypes of estimability that are distinguished by the setting of option clear in function FrF2 (cf.Groemping 2010).

Let us first consider designs of at least resolution IV. With option clear=TRUE, FrF2 searches fora model for which all main effects and all 2fis given in estimable are clear of aliasing with anyother 2fis. This is a weaker requirement than resolution V, because 2fis outside those specified inestimable may be aliased with each other. But it is much stronger than what is done in case ofclear=FALSE: For the latter, FrF2 searches for a design that has a distinct column in the modelmatrix for each main effect and each interaction requested in estimable.

Users can explicitly permit that resolution III designs are included in the search of designs for whichthe specified 2fis are estimable (by the res3=TRUE option). In case of clear=TRUE, this leads to thesomewhat strange situation that main effects can be aliased with 2fis from outside estimable while2fis from inside estimable are not aliased with any main effects or 2fis.

With clear=TRUE, the algorithm compares the requirement set to catalogued sets of clear 2fis by agraph isomorphism algorithm from R-package igraph. For details of this algorithm, cf. Groemping(2012). With the catalogue catlg available in this package, the best (minimum aberration) existingclear designs are guaranteed to be found for up to 64 runs and have a good chance to be found for128 runs. For 128 runs, it is possible to load an additional large catalogue (package FrF2.catlg128)in order to also guarantee that the best clear design is found. For 256 and 512 runs, only one ortwo resolution IV designs of each size are catalogued so that option estimable can try to influenceallocation of factors to columns, but may fail although an appropriate clear design would existoutside the catalogued designs.The search for a clear design is often fast. If it isn’t, option sort of function FrF2 can help. Forthe occasional situation where this doesn’t help either, a manual search may help, see CIG for anexample of how to proceed.

Page 33: Package 'FrF2' - Cran

estimable.2fis 33

With clear=FALSE, the algorithm loops through the eligible designs from catlg.select fromgood to worse (in terms of MA) and, for each design, loops through all eligible permutations ofthe experiment factors from perms. If perms is omitted, the permutations are looped through inlexicographic order starting from 1:nfac or perm.start. Especially in this case, run times of thesearch algorithm can be very long. The max.time option allows to limit this run time. If thetime limit is reached, the final situation (catalogued design and current permutation of experimentfactors) is printed so that the user can decide to proceed later with this starting point (indicated bycatlg.select for the catalogued design(s) to be used and perm.start for the current permutationof experiment factors).

With clear=TRUE, the algorithm loops through the eligible designs from catlg.select from goodto worse (in terms of MA) and, for each design, uses a subgraph isomorphism check from packageigraph. There are two such algorithms, VF2 (the default, Cordella et al. 2001) and LAD (in-troduced with version 1.7 of package FrF2, Solnon 2010), which can be chosen with the methodoption. Run times of the subgraph isomorphism search are often fast, but can also be very very slowin unlucky situations. Where the VF2 algorithm is particularly slow, the LAD algorithm is oftenfast (see Groemping 2014b). Especially for the VF2 algorithm, run times may strongly depend onthe ordering of factors, which can be influenced by the option sort. As the slowness of the processis intrinsic to the subgraph isomorphism search problem (which is NP-complete), a max.time op-tion analogous to the clear=FALSE situation would be of very limited use only and is therefore notavailable. Instead, it is possible to have a look at the number of the design that was in the process ofbeing searched when the process was interrupted (with the command FrF2.currentlychecked()).

Note that - according to the structure of the catalogued designs and the lexicographic order ofchecking permutations - the initial order of the factors has a strong influence on the run time forlarger or unlucky problems. For example, consider an experiment in 32~runs and 11~factors, forsix of which the pairwise interactions are to be estimable (Example 1 in Wu and Chen 1992).estimable for this model can be specified asformula("~(F+G+H+J+K+L)^2")ORformula("~(A+B+C+D+E+F)^2").The former runs a lot faster than the latter (I have not yet seen the latter finish the first catalogueddesign, if perms is not specified). The reason is that the latter needs more permutations of theexperiment factors than the former, since the factors with high positions change place faster andmore often than those with low positions.

For this particular design, it is very advisable to constrain the permutations of the experiment factorsto the different subset selections of six factors from eleven, since permutations within the sets do notchange the possibility of accomodating a design. The required permutations for the second versionof this example can be obtained e.g. by the following code:

perms.6 <- combn(11,6)perms.full <- matrix(NA,ncol(perms.6),11)for (i in 1:ncol(perms.6))perms.full[i,] <- c(perms.6[,i],setdiff(1:11,perms.6[,i]))

Handing perms.full to the procedure using the perms option makes the second version of the re-quested interaction terms fast as well, since up to almost 40 Mio permutations of experiment factorsare reduced to at most 462. Thus, whenever possible, one should try to limit the permutationsnecessary in case of clear=FALSE.

In order to support relatively comfortable creation of distinct designs of some frequently-used types

Page 34: Package 'FrF2' - Cran

34 estimable.2fis

of required interaction patterns, the function compromise has been divised: it supports creation ofthe so-called compromise plans of classes 1 to 4 (cf. e.g. Addelman 1962; Ke, Tang and Wu 2005;Groemping 2012). The list it returns also contains a component perms.full that can be used asinput for the perms option.

Please contact me with any suggestions for improvements.

Author(s)

Ulrike Groemping

References

Addelman, S. (1962). Symmetrical and asymmetrical fractional factorial plans. Technometrics 4,47-58.

Chen, J., Sun, D.X. and Wu, C.F.J. (1993). A catalogue of 2-level and 3-level orthogonal arrays.International Statistical Review 61, 131-145.

Cordella, L.P., Foggia, P., Sansone, C. and Vento, M. (2001). An improved algorithm for matchinglarge graphs. Proc. of the 3rd IAPR TC-15 Workshop on Graphbased Representations in PatternRecognition, 149–159.

Groemping, U. (2010). “Clear” and “Distinct”: two approaches for regular fractional factorialdesigns with estimability requirements. Reports in Mathematics, Physics and Chemistry, report02/2010, Department II, Beuth University of Applied Sciences Berlin.

Groemping, U. (2012). Creating clear designs: a graph-based algorithm and a catalogue of clearcompromise plans. IIE Transactions 44, 988–1001. Preprint available at http://www1.beuth-hochschule.de/FB_II/reports/Report-2010-005.pdf.

Groemping, U. (2014a). R Package FrF2 for Creating and Analyzing Fractional Factorial 2-LevelDesigns. Journal of Statistical Software, 56, Issue 1, 1-56. http://www.jstatsoft.org/v56/i01/.

Groemping, U. (2014b). A Note on Dominating Fractional Factorial Two-Level Designs With ClearTwo-Factor Interactions. Technometrics 56, 42–45.

Ke, W., Tang, B. and Wu, H. (2005). Compromise plans with clear two-factor interactions. Statis-tica Sinica 15, 709-715.

Solnon, C. (2010). AllDifferent-based Filtering for Subgraph Isomorphism. Artificial Intelligence174, 850–864.

Wu, C.F.J. and Chen, Y. (1992) A graph-aided method for planning two-level experiments whencertain interactions are important. Technometrics 34, 162-175.

See Also

See also FrF2 for regular fractional factorials, catlg for the Chen, Sun, Wu (1993) and largercatalogues of designs and some accessor functions, and function compromise for a conveniencefunction to handle estimability requests for compromise plans

Page 35: Package 'FrF2' - Cran

estimable.2fis 35

Examples

########## usage of estimable ############################# design with all 2fis of factor A estimable on distinct columns in 16 runsFrF2(16, nfactors=6, estimable = rbind(rep(1,5),2:6), clear=FALSE)FrF2(16, nfactors=6, estimable = c("AB","AC","AD","AE","AF"), clear=FALSE)FrF2(16, nfactors=6, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"),

clear=FALSE)## formula would also accept self-defined factor names## from factor.names instead of letters A, B, C, ...

## estimable does not need any other inputFrF2(estimable=formula("~(A+B+C)^2+D+E"))

## estimable with factor names## resolution three must be permitted, as FrF2 first determines that 8 runs## would be sufficient degrees of freedom to estimate all effects## and then tries to accomodate the 2fis from the model clear of aliasing in 8 runsFrF2(estimable=formula("~one+two+three+four+two:three+two:four"),

factor.names=c("one","two","three","four"), res3=TRUE)## clear=FALSE allows to allocate all effects on distinct columns in the## 8 run MA resolution IV designFrF2(estimable=formula("~one+two+three+four+two:three+two:four"),

factor.names=c("one","two","three","four"), clear=FALSE)

## 7 factors instead of 6, but no requirements for factor GFrF2(16, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"),

clear=FALSE)## larger design for handling this with all required effects clearFrF2(32, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"),

clear=TRUE)## 16 run design for handling this with required 2fis clear, but main effects aliased## (does not usually make sense)FrF2(16, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"),

clear=TRUE, res3=TRUE)

## example for necessity of perms for the clear=FALSE case## based on Wu and Chen Example 1

## Not run:## runs per default about max.time=60 seconds, before throwing error with## interim results## results could be used in select.catlg and perm.start for restarting with## calculation of further possibilitiesFrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE)## would run for a long long time (I have not yet been patient enough)FrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE,

max.time=Inf)

## End(Not run)## can be easily done with perms,## as only different subsets of six factors are non-isomorphicperms.6 <- combn(11,6)perms.full <- matrix(NA,ncol(perms.6),11)

Page 36: Package 'FrF2' - Cran

36 fold.design

for (i in 1:ncol(perms.6))perms.full[i,] <- c(perms.6[,i],setdiff(1:11,perms.6[,i]))

## function compromise will calculate the necessary perms entries automaticallycompromise(11,1:6)$perms.fullFrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE,

perms = perms.full )

fold.design Function to create a foldover for 2-level fractional factorials

Description

This function creates a foldover design for a 2-level fractional factorial. The purpose is to dealias(some) effects. Per default, all factors are folded upon, which makes the resulting design at leastresolution IV. Different foldover versions can be requested.

Usage

fold.design(design, columns = "full", ...)

Arguments

design a data frame of class design that contains a 2-level fractional factorial; currently,design must neither be blocked nor a long version parameter design

columns indicates which columns to fold on; the default “full” folds on all columns, i.e.swaps levels for all columns.A specific fold on certain columns can be requested giving a character vector offactor names or a numeric vector of factor positions.See the details section for some statistical comments.

... currently not used

Details

Foldover is a method to dealias effects in relatively small 2-level fractional factorial designs. Thefolded design has twice the number of runs from the original design, and an additional column“fold” that distinguishes the original runs from the mirror runs. This column should be used inanalyses, since it captures a block effect on time (often the mirror runs are conducted substantiallylater than the original experiment).

Like most other software, this function conducts a full foldover per default, i.e. the mirror portionreverses the levels of all factors. In terms of the convenient -1/1 notation for factor levels, this canbe written as a multiplication with “-1” for the mirror portion of all factors. Thus, all confoundingrelations involving an odd number of factors (e.g. A=BC) are resolved, because the odd side of theequation involves a minus for the mirror runs, and the even side does not (since the minuses canceleach other). (These confounding relations are replaced by even ones for which the odd side of theequation is multiplied with minus the new mirror factor fold.)

There are many situations, for which the default full foldover is not the best possible foldoverfraction, cf. e.g. Li and Mee (2002). It is therefore possible to choose an arbitrary foldover fraction.

Page 37: Package 'FrF2' - Cran

fold.design 37

For example, folding on one particular factor alone dealiases all confounding relations for thatfactor, folding on two particular factors dealiases all confounding relations of these two with othersbut not of these two together with others and so on.

Folding Plackett-Burman designs also removes the (partial) aliasing with 2-factor interactions forall main effects that are mirrored.

Value

A data frame of class design with twice as many rows as design and the additional factor fold(added as the last factor for folded pb designs, as the first factor for splitplot designs, and as the lastbase factor for other folded regular fractional factorial designs).

Existing response values are of course preserved, and response values for the new mirror runs areNA.

The type in attribute design.info is suffixed with “.folded”, and nruns (and, if applicable, nWPs)is doubled, nfactors (and, if applicable, nfac.WP) is increased by one (for the factor fold, whichis a block factor and can also be treated as such, but will currently be treated as a fixed (whole plot)factor by any automated analysis routine). The creator element receives a list entry for the foldcolumns.For regular fractional factorials (design type starting with FrF2), the generator element is ad-justed (the generators for all generated fold factors now involve the folding factor), and an existingcatlg.entry element is replaced by a new generators element. The aliased element is adapted tothe new alias structure. Note that the fold factor enters as a new base factor and therefore is addedto the factor matrix after the first log2(nruns) factors. This implies that all factor letters previouslyused for the generated factors are changed - for avoiding confusion it is always recommended towork with factor names that are meaningful in a subject-matter sense.

Furthermore, for the regular fractional factorial designs, the column run.no.in.std.order in attributerun.order for the mirror portion of the design is populated such that the base factors remain in theconventional order when ordered by run.no.in.std.order (regardless whether or not they are includedin the fold; it is always possible to reorder runs such that the original base factors together with thefolding factor form the new base in standard order).

Note

This function is still somewhat experimental.

Author(s)

Ulrike Groemping

References

Li, H. and Mee, R. (2002). Better foldover fractions for resolution III 2^(k-p) designs. Technomet-rics 44, 278–283. New York: Springer.

Mee, R. (2009). A Comprehensive Guide to Factorial Two-Level Experimentation. New York:Springer.

Montgomery, D.C. (2001). Design and Analysis of Experiments (5th ed.). Wiley, New York.

Page 38: Package 'FrF2' - Cran

38 FrF2

See Also

See also as pb, FrF2

Examples

## create resolution III designplan <- FrF2(8,5, factor.names=c("one","two","three","four","five"))## add some resonse datay <- c(2+desnum(plan)%*%c(2,3,0,0,0) +

1.5*apply(desnum(plan)[,c(1,2)],1,"prod") + rnorm(8))## the "c()" makes y into a vector rather than a 1-column matrix

plan <- add.response(plan, y)DanielPlot(lm(y~(.)^2,plan), alpha=0.2, half=TRUE)## alias informationdesign.info(plan)## full foldover for dealiasing all main effectsplan <- fold.design(plan)design.info(plan)## further data, shifted by -2y <- c(y, desnum(plan)[9:16,1:5]%*%c(2,3,0,0,0) +

1.5*apply(desnum(plan)[9:16,c(1,2)],1,"prod") + rnorm(8))plan <- add.response(plan, y, replace=TRUE)linmod <- lm(y~(.)^2,plan)DanielPlot(linmod, alpha=0.2, half=TRUE)MEPlot(linmod)IAPlot(linmod)

## fold on factor a only (also removes main effect aliasing here)plan <- FrF2(8,5, factor.names=c("one","two","three","four","five"))aliasprint(plan)plan <- fold.design(plan, columns=1)aliasprint(plan)

## fold a Plackett-Burman design with 11 factorsplan <- pb(12)fold.design(plan)

FrF2 Function to provide regular Fractional Factorial 2-level designs

Description

Regular fractional factorial 2-level designs are provided. Apart from obtaining the usual minimumaberration designs in a fixed number of runs, it is possible to request highest number of free 2-factorinteractions instead of minimum aberration or to request the smallest design that fulfills certainrequirements (e.g. resolution V with 8 factors).

Page 39: Package 'FrF2' - Cran

FrF2 39

Usage

FrF2(nruns = NULL, nfactors = NULL, factor.names = if (!is.null(nfactors)) {if (nfactors <= 50) Letters[1:nfactors] else

paste("F", 1:nfactors, sep = "")} else NULL,default.levels = c(-1, 1), ncenter=0, center.distribute=NULL,generators = NULL, design = NULL,resolution = NULL, select.catlg=catlg,estimable = NULL, clear = TRUE, method="VF2", sort="natural",res3 = FALSE, max.time = 60,perm.start=NULL, perms = NULL,MaxC2 = FALSE, replications = 1, repeat.only = FALSE,randomize = TRUE, seed = NULL, alias.info = 2,blocks = 1, block.name = "Blocks", bbreps=replications, wbreps=1,alias.block.2fis = FALSE, hard = NULL, check.hard=10, WPs=1,nfac.WP=0,WPfacs=NULL, check.WPs = 10, ...)

FrF2.currentlychecked()

Arguments

nruns Number of runs, must be a power of 2 (4 to 4096), if given.The number of runs can also be omitted. In that case, if resolution is speci-fied, the function looks for the smallest design of the requested resolution thataccomodates nfactors factors. If the smallest possible design is a full factorialor not catalogued, the function stops with an error.If generators is specified, nruns is required.If estimable is specified and nruns omitted, nruns becomes the size of the small-est design that MIGHT accomodate the effects requested in estimable. If thisrun size turns out to be too low, an error is thrown. In that case, explicitly choosenruns as twice the run size given in the error message and retry.

nfactors is the number of 2-level factors to be investigated. It can be omitted, if it is ob-vious from factor.names, a specific catalogued design given in design, nrunstogether with generators, or estimable.If estimable is used for determining the number of factors, it is assumed thatthe largest main effect position number occurring in estimable coincides withnfactors.For blocked designs, block generator columns are not included in nfactors,except if the user explicitly specifies 2-level block generation factors as partof the fractional factorial design (e.g. a factor shift with levels morning andafternoon).For automatically-generated split-plot designs (cf. details section), nfactorssimply is the number of all factors (whole plot and split plot together). Ifnfac.WP < log2(WPs), the algorithm will add (an) artificial plot generationfactor(s).For manually-specified split-plot designs (through options generators or designtogether with WPfacs), the user must specify at least log2(WPs) split plot fac-tors, i.e. nfac.WP >= log2(WPs) is required (and must, if necessary, be

Page 40: Package 'FrF2' - Cran

40 FrF2

achieved by adding log2(WPs) - nfac.WP extra independent generator columnsfor the whole plot structure, which have to be counted in nfac.WP and nfactors).

factor.names a character vector of nfactors factor names or a list with nfactors elements;if the list is named, list names represent factor names, otherwise default factornames are used;the elements of the list areEITHER vectors of length 2 with factor levels for the respective factorOR empty strings. For each factor with an empty string in factor.names, thelevels given in default.levels are used;Default factor names are the first elements of the character vector Letters, orthe factors position numbers preceded by capital F in case of more than 50 fac-tors.

default.levels default levels (vector of length 2) for all factors for which no specific levels aregiven

ncenter number of center points per block; ncenter > 0 is permitted, if all factors arequantitative and the design is not a split-plot design

center.distribute

the number of positions over which the center points are to be distributed foreach block; if NULL (default), center points are distributed over end, begin-ning, and middle (in that order, if there are fewer than three center points) forrandomized designs, and appended to the end for non-randomized designs. formore detail, see function add.center, which does the work.

generators There are log2(nruns) base factors the full factorial of which spans the design(e.g. 3 for 8 runs). The generators specify how the remaining factors are to beallocated to interactions of these.generators can bea list of vectors with position numbers of base factors (e.g. c(1,3,4) stands forthe interaction between first, third and fourth base factor)a vector of character representations of these interactions, e.g. “ACD” stands forthe same interaction as abovea vector of columns numbers in Yates order (e.g. 13 stands for ACD). Note thatthe columns 1, 2, 4, 8, etc., i.e. all powers of 2, are reserved for the base factorsand cannot be used for assigning additional factors, because the design wouldbecome a resolution II design. For looking up which column number stands forwhich interaction, type e.g. names(Yates)[1:15] for a 16 run design.In all cases, preceding the respective entry with a minus sign (e.g. -c(1,3,4),“-ACD”, -13) implies that the levels of the respective column are reversed.WARNING: Minus signs do not cause an error, but neither have an effect in caseof automatic assignment of split-plot designs or hard-to-change columns.

design is a character string specifying the name of a design listed in the catalogue spec-ified as select.catlg, which is usually the catalogue catlg

resolution is the arabic numeral for the requested resolution of the design. FrF2 looksfor a design with at least this resolution. Option resolution does not work, ifestimable, blocks or WPs are specified, and neither if nruns is given.A design with resolution III (resolution=3) confounds main effects with 2-factor

Page 41: Package 'FrF2' - Cran

FrF2 41

interactions, a design with resolution IV confounds main effects with three-factor interactions or 2-factor interactions with each other, and designs withresolution V or higher are usually regarded as very strong, because all 2-factorinteractions are unconfounded with each other and with main effects.

select.catlg specifies a catalogue of class catlg from which an adequate design is selectedand adapted.The specified catalogue is used for design construction, unless generators ex-plicitly constructs a non-catalogued design. The default catlg is adequate formost applications.If a specific different catalogue of designs is available, this can be specifiedhere.Specification of a smaller subset of designs is useful, if estimable has beengiven and clear=FALSE, for restricting the search to promising designs.Names of catalogues from package FrF2.catlg128 can be given here withoutprior loading of that package; loading of the package and the selected cataloguewill then happen automatically, provided the package is installed (for version>=1.2 of package FrF2.catlg128; for earlier versions, the suitable catalogue hasto be manually loaded using the data() command).

estimable indicates the 2-factor interactions (2fis) that are to be estimable in the design.Consult the specific help file (estimable.2fis) for details of two different ap-proaches of requesting estimability, as indicated by the status of the clear op-tion. estimable cannot be specified together with block, splitplot, generatorsor design.estimable can bea numeric matrix with two rows, each column of which indicates one interac-tion, e.g. column 1 3 for interaction of the first with the third factorORa character vector containing strings of length 2 with capital letters from Letters(cf. package DoE.base) for the first 25 factors and small letters for the last 25(e.g. c("AB","BE")ORa formula that contains an adequate model formula, e.g.formula("~A+B+C+D+E+(F+G+H+J+K+L)^2")for a model with (at least) eleven factors.The names of the factors used in the formula can be the same letters usable inthe character vector (cf. above, A the first factor, B the second etc.), or they cancorrespond to the factor names from factor.names.

clear logical, indicating how estimable is to be used. See estimable.2fis.

method character string indicating which subgraph isomorphism search routine of pack-age igraph is used (graph.subisomorphic.vf2 or graph.subisomorphic.lad).The default "VF2" uses VF2 algorithm by Cordella et al. (2001), which was theonly available algorithm before version 1.7 of package FrF2. The alternative"LAD" uses the LAD algorithm by Solnon (2010), which was reported to be sub-stantially faster than VF2 especially for some notoriously difficult VF2 cases(see Grömping 2014b). This option is relevant for estimable with clear=TRUEonly.NOTE: The resulting design may be different for different settings of this option!

Page 42: Package 'FrF2' - Cran

42 FrF2

sort character string indicating how the estimability requirement and the candidatedesign clear 2fis are handed to the subgraph isomorphism search routine of pack-age igraph. The default "natural" leaves them in unchanged order (like inFrF2 versions up to 1.6). sort="high" and sort="low" sort both requirementset and candidate design graph according to vertex degrees (high first or lowfirst).This option is relevant for estimable with clear=TRUE only.It has been added, because pre-sorting of vertices sometimes speeds up thesearch by several orders of magnitude especially for the VF2 method.NOTE: The resulting design may be different for different settings of this option!

res3 logical; if TRUE, estimable includes resolution III designs into the search foradequate designs; otherwise resolution IV and higher designs are included only.

max.time maximum time for design search as requested by estimable, in seconds (default60); introduced for clear=FALSE situations because the search can take a longtime in complicated or unlucky situations; set max.time to Inf if you want toforce a search over an extended period of time; however, be aware that it maystill take longer than feasible (cf. also estimable.2fis)

perm.start used with estimable specified, and clear=FALSE.Provides a start permutation for permuting experiment factors (numeric vector).This is useful for the case that a previous search was not (yet) successful becauseof a time limit, since the algorithm notifies the user about the permutation atwhich it had to stop.

perms used with estimable specified, and clear=FALSE.Provides the matrix of permutations of experiment factors to be tried; each rowis a permutation. For example, for an 11-factor design with the first six factorsand their 2fis estimable, it is only relevant, which of the eleven factors are to beallocated to the first six experiment factors, and these as well as the other fivefactors can be in arbitrary order. This reduces the number of required permu-tations from about 40 Mio to 462. It is recommended to use perms wheneverpossible, if clear=FALSE, since this dramatically improves performance of thealgorithm.It is planned to automatically generate perms for certain structures like compro-mise designs in the (not so near) future.

MaxC2 is a logical and defaults to FALSE. If TRUE, maximizing the number of clear2-factor interactions takes precedence over minimizing aberration. Resolutionis always considered first. MaxC2 is ignored when using the estimable option.MaxC2=TRUE is not a recommended choice.

replications positive integer number. Default 1 (i.e. each row just once). If larger, each de-sign run is executed replication times. If repeat.only, repeated measurementsare carried out directly in sequence, i.e. no true replication takes place, and allthe repeat runs are conducted together. It is likely that the error variation gen-erated by such a procedure will be too small, so that average values should beanalyzed for an unreplicated design.Otherwise (default), the full experiment is first carried out once, then for thesecond replication and so forth. In case of randomization, each such blocks israndomized separately. In this case, replication variance is more likely suitable

Page 43: Package 'FrF2' - Cran

FrF2 43

for usage as error variance (unless e.g. the same parts are used for replicationruns although build variation is important).

repeat.only logical, relevant only if replications > 1. If TRUE, replications of each runare grouped together (repeated measurement rather than true replication). Thedefault is repeat.only=FALSE, i.e. the complete experiment is conducted inreplications blocks, and each run occurs in each block.

randomize logical. If TRUE, the design is randomized. This is the default. In case of repli-cations, the nature of randomization depends on the setting of option repeat.only.

seed optional seed for the randomization process

alias.info can be 2 or 3, gives the order of interaction effects for which alias informationis to be included in the aliased component of the design.info element of theoutput object.

blocks is EITHERthe number of blocks into which the experiment is subdividedOR a character vector of names of independent factors that are used as blockconstructorsOR a vector of Yates column numbers OR a list of generators similar to list en-tries for generators.In the latter case, the differences to generators are

• that numbers/letters refer to the factors of the experiment and not to columnnumbers of the Yates matrix

• that numbers/letters can refer to *all* nfactors factors rather than thelog2(nruns) base factors only,

• that one single number is always interpreted as the number of blocks ratherthan a column reference,

• that individual numbers are allowed in a list (i.e. individual factors specifiedin the experiment can be used as block factors) and

• that no negative signs are allowed.

If blocks is a single number, it must be a power of 2. A blocked design canhave at most nruns-blocks treatment factors, but should usually have fewerthan that.

If the experiment is randomized, randomization happens within blocks.

For the statistical and algorithmic background of blocked designs, see block.

block.name name of the block factor, default “Blocks”

bbreps between block replications; these are always taken as genuine replications, notrepeat runs; default: equal to replications; CAUTION: you should not mod-ify bbreps if you do not work with blocks, because the program code uses itinstead of replications in some places

wbreps within block replications; whether or not these are taken as genuine replicationsdepends on the setting of repeat.only

Page 44: Package 'FrF2' - Cran

44 FrF2

alias.block.2fis

logical indicating whether blocks may be aliased with 2fis (default: FALSE);the option is effective only for automatic block assignment (cf. block);it will often be necessary to modify this option, because there is otherwise nosolution.CAUTION: If alias.block.2fis=TRUE, no effort is made to avoid aliasing of2fis with block main effects, even if complete de-aliasing were possible.

hard gives the number of hard to change factors. These must be the first factors infactor.names. Implementation is via a non-randomized split-plot design withas few as possible whole plots (number of possible whole plots is determinedvia left-adjustment) and as few as possible non-hard factors within the wholeplot structure (by applying split-plot after left-adjustment).Observations within whole plots are randomized, whole plots themselves are notrandomized (contrary to split plot designs).From the statistical point of view, randomisation of whole plots is strongly pre-ferrable (cf. splitplot for a brief discussion of the difference). If this appearsfeasible, you may want to explicitly handle the situation by treating the hard tochange factors as whole-plot factors via WPs and nfac.WP.

check.hard is the number of candidate designs from the catalogue specified in select.catlgthat are checked for making hard-to-change factors change as little as possible.The default is 10 - if too many changes are needed, a larger choice might helpfind a design with fewer level changes (but will also take longer run time andwill find a worse design in terms of resolution / aberration).If you want to use the best design and do not want to compromise the confound-ing structure for ease-of-change reasons, set check.hard to 1.

WPs is the number of whole plots and must be a power of 2.If WPs > 1, at least one of nfac.WP or WPfacs must be given.If WPs = 1, all settings for split-plot related options are ignored.

For statistical and algorithmic information on treatment of split-plot designs seethe separate help file splitplot.

nfac.WP is the number of whole plot factors and must be smaller than WPs.The nfac.WP whole plot factors are counted within nfactors. Per default, thefirst nfac.WP factors are the whole plot factors.If a design is provided and whole plot factors are manually provided (design orgenerators option together with WPfacs), nfac.WP can be omitted (i.e. remains0). If given, it must coincide with the length of WPfacs.If nfac.WP is given without WPfacsonly, generators must not be given.If nfac.WP is omitted (i.e. remains 0) and WPs > 1, an error is thrown, becausethe situation is a block rather than a split-plot situation (and either it was forgot-ten to specify the number of whole plot factors, or blocks should be specified).

WPfacs is per default NULL. In this case, the first nfac.WP factors are considered wholeplot factors (and are, if necessary, automatically supplemented by additionalwhole plot constructor factors).If WPfacs is given, it must specify at least log2(WPs) whole plot factors. Acustom design must be specified with options design or generators, and therequested factors in WPfacs must indeed create a split-plot structure with WPs

Page 45: Package 'FrF2' - Cran

FrF2 45

whole plots. If the number of whole plots created by the whole plot factorsdiffers from WPs or factors other than the specified factors from WPfacs wouldin fact become whole plot factors as well, an error is thrown.WPfacs can be any ofa vector or list of factor position numbersORa character vector of factor position letters from LettersORa character vector with entries “F” followed by factor position numberORa character vector of factor names (this takes precedence over factor letters, i.e.if the factor names were B, A, C, D, and E, factor letter entries in the nfac.WPare interpreted as factor names, not position letters).It is not possible to specify additional whole plot generators from interactioneffects manually through WPfacs. Rather, all whole plot factors - even artificialones needed only to increase the number of plots - need to be included in thedesign factors.

check.WPs is the number of potential split-plot designs that are compared by function splitpickw.r.t. resolution of the whole plot portion of the design. This option is effective,if nfac.WP>k.WP (i.e. bad resolution possible) and nfac.WP not larger than halfthe number of plots (i.e. resolution better than III is possible). The default is10 - if not satisfied with the structure of the whole plot factors, a larger choicemight help find a better design (but also take longer run time).

... currently not used

Details

Per default, the function picks the best design from the default design catalogue catlg (a list objectof class catlg).Alternatively, the user can explicitly specify a design through accessing a specific catalogued designusing the design option or specifying non-catalogued generators via the generators option.Apart from generation of simple fractional factorial designs based on catalogued or non-cataloguedgenerators, function FrF2 allows specification of blocked designs and split-plot designs, as wellas specification of a set of 2fis that are required to be estimable. The implementation of thesepossibilities is explained in the separate help files block, splitplot and estimable.2fis. If youconsider to use option hard, it may also be worth while to look at the splitplot help file.Function FrF2 is still under development, although most features are now included, and the principlestructure of inputs and outputs should not change much any more. Please contact me with anysuggestions for improvements.Function FrF2.currentlychecked is meant as a diagnostic tool, when searching for designs withoption estimable and clear=TRUE. If the search takes very long, it can be interrupted, and thefunction returns a character string with the name of the design that was checked at the time ofinterruption.

Value

Function FrF2 returns a data frame of S3 class design that has attached attributes that can beaccessed by functions desnum, run.order and design.info.

Page 46: Package 'FrF2' - Cran

46 FrF2

The data frame itself contains the design with levels coded as requested. If no center points havebeen requested, the design columns are factors with contrasts -1 and +1 (cf. also contr.FrF2); incase of center points, the design columns are numeric.

The following attributes are attached to it:

desnum Design matrix in -1/1 coding

run.order a three column data frame;the first column (run.no.in.std.order) contains the run number in standardorder, possibly including a block number and in that case also a number for theoriginal position within the block,the second column (run.no) contains the actual run number as randomized,the third column contains (run.no.std.rp) contains the content of the first col-umn accumulated with a replication identifier, if applicable.A few remarks on the run number in standard order are needed here:In blocked and split plot designs, the run number in standard order refers to arow ordering with the first base factor changing slowest, different from the usualorder with the first base factor changing fastest. Also note that the run num-ber in standard order may not refer to the base columns one would naturallyexpect for designs created with blocking, estimable 2fis or split plot designs;the elements map for and/or orig.fac.order of the attribute design.info helpidentify which base factors drive the run number in standard order. (In case ofoption hard=TRUE, the remark on split plot designs applies, and the numberingrefers to the special slow change matrix from Cheng et al. 1998.)For blocked designs created internally with function blockpick.big, the runnumber in standard order is not easily related to the final design.

design.info list with the entries

type character string “full factorial”, “FrF2”, “FrF2.estimable”, “FrF2.generators”,“FrF2.blocked” or “FrF2.splitplot” depending on the type of design

nruns number of runs (replications are not counted)nfactors number of factors; since version 0.97, this is also true for designs of

type FrF2.blocked (nfactors is now equal to ntreat) and for designs oftype FrF2.splitplot, where nfactors is now the sum of nfac.WP andnfac.SP.

ntreat for designs of type FrF2.blocked only;number of treatment factors

nfac.WP for designs of type FrF2.splitplot only;number of whole plot factors (including extra factors that may have beenadded for whole plot construction); these are the first factors in the designdata frame

nfac.SP for designs of type FrF2.splitplot only;number of split-plot factors

nlevels for designs of type full factorial only;vector with number of levels for each factor (of course, all the nfactorsentries are “2” for FrF2)

factor.names list named with (treatment) factor names and containing as en-tries vectors of length two each with coded factor levels

Page 47: Package 'FrF2' - Cran

FrF2 47

FrF2.version version number of package FrF2, supporting correct usage ofFrF2-specific functionality in functions summary and generators methodsfor class design

nblocks for designs of type FrF2.blocked only;number of blocks

block.gen vector of columns of the Yates matrix for generating block factors incase of automatic block generationOR list of (vectors of) factor numbers in case the blocks argument specifiescertain factor combinations for blocking; ;for designs of type FrF2.blocked only

blocksize for designs of type FrF2.blocked only;size of each block (without consideration of wbreps)

nWPs for designs of type FrF2.splitplot only;number of whole plots

plotsize for designs of type FrF2.splitplot only;size of each plot (without consideration of repeat.only replications if appli-cable)

orig.fac.order designs of type FrF2.splitplot only;factor order of the design before reshuffling of factors in order to accomo-date the split plot request; the run number in standard order can only beinterpreted together with this information

catlg.entry for designs of type FrF2 only;list with one element, which is the entry of catlg on which the design isbased

generators for designs of type FrF2.generators only;character vector of generators in the form D=ABC etc.

base.design for designs of type FrF2.blocked or FrF2.splitplot only;gives a character string that contains the name of the base design in thecatalogue or the column numbers of generating columns in Yates matrix; incase of automatic block generation, the exclusion or inclusion of k.blockin the number of design factors / generators indicates whether the designwas generated using function blockpick or blockpick.big.

aliased.with.blocks for designs of type FrF2.blocked only;treatment effects that are aliased with block main effects, up to 2fis or 3fis,depending on the choice of alias.info

aliased alias structure of main effects, 2fis and possibly 3fis, depending onthe choice of alias.info; For non-blocked and non-split-plot designs,aliased is itself a list of the two or three components main, fi2, and op-tionally fi3, given in terms of factor letters from Letters (up to 50~factors)or F1, F2, and so forth (more than 50~factors). For blocked and split-plotdesigns, aliased is a single list with an entry for each column of the Yatesmatrix that accomodates aliased low-order effects, and entries are in termsof factor names.)

replication option setting in call to FrF2

repeat.only option setting in call to FrF2

bbreps for designs of type FrF2.blocked only; number of between block repli-cations

Page 48: Package 'FrF2' - Cran

48 FrF2

wbreps for designs of type FrF2.blocked only; number of within block repli-cations;repeat.only indicates whether these are replications or repetitions only

map the mapping relation between factors in the base design and experimentalfactors, after using option estimable and for split-plot designs

clear option setting in call to FrF2, in case of estimableres3 option setting in call to FrF2, in case of estimablerandomize option setting in call to FrF2

seed option setting in call to FrF2

creator call to function FrF2 (or stored menu settings, if the function has beencalled via the R commander plugin RcmdrPlugin.DoE)

ncube number of cube points per block, in case center points have been re-quested

ncenter number of center points per block, in case center points have beenrequested

Author(s)

Ulrike Groemping

References

Bingham, D.R., Schoen, E.D. and Sitter, R.R. (2004). Designing Fractional Factorial Split-PlotExperiments with Few Whole-Plot Factors. Applied Statistics 53, 325-339.

Bingham, D. and Sitter, R.R. (2003). Fractional Factorial Split-Plot Designs for Robust ParameterExperiments. Technometrics 45, 80-89.

Bisgaard, S. (1994a). Blocking generators for small 2\^(k-p) designs. J. Quality Technology 26,288-294.

Chen, J., Sun, D.X. and Wu, C.F.J. (1993) A catalogue of 2-level and 3-level orthogonal arrays.International Statistical Review 61, 131-145.

Cheng, C.-S., Martin, R.J., and Tang, B. (1998). Two-level factorial designs with extreme numbersof level changes. Annals of Statistics 26, 1522-1539.

Cheng, C.-S. and Tsai, P.-W. (2009). Optimal two-level regular fractional factorial block and split-plot designs. Biometrika 96, 83-93.

Cheng, S.W. and Wu, C.F.J. (2002). Choice of optimal blocking schemes in 2-level and 3-leveldesigns. Technometrics 44, 269-277.

Cordella, L.P., Foggia, P., Sansone, C. and Vento, M. (2001). An improved algorithm for matchinglarge graphs. Proc. of the 3rd IAPR TC-15 Workshop on Graphbased Representations in PatternRecognition, 149–159.

Groemping, U. (2012). Creating clear designs: a graph-based algorithm and a catalogue of clearcompromise plans. IIE Transactions 44, 988–1001. Preprint available at http://www1.beuth-hochschule.de/FB_II/reports/Report-2010-005.pdf.

Groemping, U. (2014a). R Package FrF2 for Creating and Analyzing Fractional Factorial 2-LevelDesigns. Journal of Statistical Software, 56, Issue 1, 1-56. http://www.jstatsoft.org/v56/i01/.

Page 49: Package 'FrF2' - Cran

FrF2 49

Groemping, U. (2014b). A Note on Dominating Fractional Factorial Two-Level Designs With ClearTwo-Factor Interactions. Technometrics 56, 42–45.

Huang, P., Chen, D. and Voelkel, J.O. (1998). Minimum-Aberration Two-Level Split-Plot Designs.Technometrics 40, 314-326.

Mee, R. (2009). A Comprehensive Guide to Factorial Two-Level Experimentation. New York:Springer.

Solnon, C. (2010). AllDifferent-based Filtering for Subgraph Isomorphism. Artificial Intelligence174, 850–864.

Sun, D.X., Wu, C.F.J. and Chen, Y.Y. (1997). Optimal blocking schemes for 2\^p and 2\^(n-p)designs. Technometrics 39, 298-307.

Wu, C.F.J. and Chen, Y. (1992) A graph-aided method for planning two-level experiments whencertain interactions are important. Technometrics 34, 162-175.

See Also

See alsoFrF2Large for regular fractional factorial designs with more than 4096 runs (these are not sup-ported by a design catalogue, except for a few resolution V designs which have not been checkedfor any optimality among the resolution V designs),pb for non-regular fractional factorials according to Plackett-Burman,catlg for the underlying design catalogue and some accessor functions,and block, splitplot or estimable.2fis for statistical and algorithmic information on the re-spective topic.

Examples

## maximum resolution minimum aberration design with 4 factors in 8 runsFrF2(8,4)## the design with changed default level codesFrF2(8,4, default.level=c("current","new"))## the design with number of factors specified via factor names

## (standard level codes)FrF2(8,factor.names=list(temp="",press="",material="",state=""))## the design with changed factor names and factor-specific level codesFrF2(8,4, factor.names=list(temp=c("min","max"),press=c("low","normal"),

material=c("current","new"),state=c("new","aged")))## a full factorialFrF2(8,3, factor.names=list(temp=c("min","max"),press=c("low","normal"),

material=c("current","new")))## a replicated full factorial (implicit by low number of factors)FrF2(16,3, factor.names=list(temp=c("min","max"),press=c("low","normal"),

material=c("current","new")))## three ways for custom specification of the same designFrF2(8, generators = "ABC")FrF2(8, generators = 7)FrF2(8, generators = list(c(1,2,3)))## more than one generatorFrF2(8, generators = c("ABC","BC"))FrF2(8, generators = c(7,6))

Page 50: Package 'FrF2' - Cran

50 FrF2

FrF2(8, generators = list(c(1,2,3),c(2,3)))## alias structure for three generators that differ only by signdesign.info(FrF2(16,generators=c(7,13,15),randomize=FALSE))$aliaseddesign.info(FrF2(16,generators=c(7,-13,15),randomize=FALSE))$aliaseddesign.info(FrF2(16,generators=c(-7,-13,-15),randomize=FALSE))$aliased## finding smallest design with resolution 5 in 7 factorsFrF2(nfactors=7, resolution=5)## same design, but with 12 center points in 6 positionsFrF2(nfactors=7, resolution=5, ncenter=12, center.distribute=6)

## maximum resolution minimum aberration design with 9 factors in 32 runs## show design information instead of design itselfdesign.info(FrF2(32,9))## maximum number of free 2-factor interactions instead of minimum aberration## show design information instead of design itselfdesign.info(FrF2(32,9,MaxC2=TRUE))

## usage of replication## shows run order instead of design itselfrun.order(FrF2(8,4,replication=2,randomize=FALSE))run.order(FrF2(8,4,replication=2,repeat.only=TRUE,randomize=FALSE))run.order(FrF2(8,4,replication=2))run.order(FrF2(8,4,replication=2,repeat.only=TRUE))

## Not run:## examples below do work, but are repeated in the## respective method's separate help file and are therefore prevented## from running twice

########## automatic blocked designs ##################### from a full factorial ##FrF2(8,3,blocks=2)## with replicationrun.order(FrF2(8,3,blocks=2,wbreps=2))run.order(FrF2(8,3,blocks=2,wbreps=2,repeat.only=TRUE))run.order(FrF2(8,3,blocks=2,bbreps=2))run.order(FrF2(8,3,blocks=2,bbreps=2,wbreps=2))

## automatic blocked design with fractionsFrF2(16,7,blocks=4,alias.block.2fis=TRUE,factor.names=c("MotorSpeed",

"FeedMode","FeedSizing","MaterialType","Gain","ScreenAngle","ScreenVibLevel"))## isomorphic non-catalogued design as basisFrF2(16,gen=c(7,11,14),blocks=4,alias.block.2fis=TRUE)## FrF2 uses blockpick.big and ignores the generatorFrF2(64,gen=c(7,11,14),blocks=16,alias.block.2fis=TRUE)

########## manual blocked design ####################### example that shows why order of blocks is not randomized### can of course be randomized by user, if appropriateFrF2(32,9,blocks=c("Day","Shift"),alias.block.2fis=TRUE,

factor.names=list(Day=c("Wednesday","Thursday"), Shift=c("Morning","Afternoon"),

Page 51: Package 'FrF2' - Cran

FrF2 51

F1="",F2="",F3="",F4="",F5="",F6="",F7=""), default.levels=c("current","new"))

########## hard to change factors ###################### example from Bingham and Sitter Technometrics 19999## MotorSpeed, FeedMode,FeedSizing,MaterialType are hard to changeBS.ex <- FrF2(16,7,hard=4,

factor.names=c("MotorSpeed", "FeedMode","FeedSizing","MaterialType","Gain","ScreenAngle","ScreenVibLevel"),

default.levels=c("-","+"),randomize=FALSE)design.info(BS.ex)BS.ex## NOTE: the design has 8 whole plots.## If randomize=FALSE is used like here, the first hard-to-change factors## do not always change between whole plots.## A conscious and honest decision is required whether this is## acceptable for the situation at hand!## randomize=TRUE would cause more changes in the first four factors.

########## automatic generation for split plot ############ 3 control factors, 5 noise factors, control factors are whole plot factors## 8 plots desired in a total of 32 runs## Bingham Sitter 2003BS.ex2a <- FrF2(32, 8, WPs=8, nfac.WP=3,

factor.names=c(paste("C",1:3,sep=""), paste("N",1:5,sep="")),randomize=TRUE)

## manual generation of this same designBS.ex2m <- FrF2(32, 8, generators=c("ABD","ACD","BCDE"),WPs=8, WPfacs=c("C1","C2","C3"), nfac.WP=3,

factor.names=c(paste("C",1:3,sep=""),paste("N",1:5,sep="")),randomize=TRUE)

## design with few whole plot factors## 2 whole plot factors, 7 split plot factors## 8 whole plots, i.e. one extra WP factor neededBSS.cheese.exa <- FrF2(32, 9, WPs=8, nfac.WP=2,

factor.names=c("A","B","p","q","r","s","t","u","v"))design.info(BSS.cheese.exa)## manual generation of the design used by Bingham, Schoen and Sitter## note that the generators include a generator for the 10th spplitting factor

## s= ABq, t = Apq, u = ABpr and v = Aqr, splitting factor rho=ApqrBSS.cheese.exm <- FrF2(32, gen=list(c(1,2,4),c(1,3,4),c(1,2,3,5),c(1,4,5),c(1,3,4,5)),

WPs=8, nfac.WP=3, WPfacs=c(1,2,10),factor.names=c("A","B","p","q","r","s","t","u","v","rho"))

design.info(BSS.cheese.exm)

########## usage of estimable ############################# design with all 2fis of factor A estimable on distinct columns in 16 runsFrF2(16, nfactors=6, estimable = rbind(rep(1,5),2:6), clear=FALSE)FrF2(16, nfactors=6, estimable = c("AB","AC","AD","AE","AF"), clear=FALSE)FrF2(16, nfactors=6, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"),

clear=FALSE)## formula would also accept self-defined factor names## from factor.names instead of letters A, B, C, ...

## estimable does not need any other input

Page 52: Package 'FrF2' - Cran

52 FrF2

FrF2(estimable=formula("~(A+B+C)^2+D+E"))

## estimable with factor names## resolution three must be permitted, as FrF2 first determines that 8 runs## would be sufficient degrees of freedom to estimate all effects## and then tries to accomodate the 2fis from the model clear of aliasing in 8 runsFrF2(estimable=formula("~one+two+three+four+two:three+two:four"),

factor.names=c("one","two","three","four"), res3=TRUE)## clear=FALSE allows to allocate all effects on distinct columns in the## 8 run MA resolution IV designFrF2(estimable=formula("~one+two+three+four+two:three+two:four"),

factor.names=c("one","two","three","four"), clear=FALSE)

## 7 factors instead of 6, but no requirements for factor GFrF2(16, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"),

clear=FALSE)## larger design for handling this with all required effects clearFrF2(32, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"),

clear=TRUE)## 16 run design for handling this with required 2fis clear, but main effects aliased## (does not usually make sense)FrF2(16, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"),

clear=TRUE, res3=TRUE)

## End(Not run)## example for the sort option added with version 1.6-1## and for usage of a catalogue from package FrF2.catlg128 (simplified with version 1.6-5)

## Not run:estim <- compromise(17,15:17)$requirement ## all interactions of factors 15 to 17 (P,Q,R)## VF2 algorithm without pre-sorting of verticesFrF2(128, 17, estimable=estim, select.catlg=catlg128.17) ## very slow,

## interrupt with ESC key## VF2 algorithm with pre-sorting of verticesFrF2(128, 17, estimable=estim, sort="high", select.catlg=catlg128.17) ## very fastFrF2(128, 17, estimable=estim, sort="low", select.catlg=catlg128.17) ## very fast## LAD algorithmFrF2(128, 17, estimable=estim, method="LAD", select.catlg=catlg128.17) ## very fast## guaranteed to be MA clear design## only works, if package FrF2.catlg128 is installed

## End(Not run)

## example for necessity of perms, and uses of select.catlg and perm.start## based on Wu and Chen Example 1

## Not run:## runs per default about max.time=60 seconds, before throwing error with## interim results## results could be used in select.catlg and perm.start for restarting with## calculation of further possibilitiesFrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE)## would run for a long long time (I have not yet been patient enough)FrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE,

max.time=Inf)

Page 53: Package 'FrF2' - Cran

FrF2Large 53

## can be easily done with perms,## as only different subsets of six factors are non-isomorphicperms.6 <- combn(11,6)perms.full <- matrix(NA,ncol(perms.6),11)for (i in 1:ncol(perms.6))

perms.full[i,] <- c(perms.6[,i],setdiff(1:11,perms.6[,i]))FrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE,

perms = perms.full )

## End(Not run)

FrF2Large Function to provide large (at least 8192 runs) regular Fractional Fac-torial designs that are not necessarily optimal, especially large reso-lution V designs.

Description

Large regular fractional factorial 2-level designs in 8192 or more runs are provided: Resolution Vdesigns in 8096 to 32768 runs with up to 120 factors according to the suggestion by Sanchez andSanchez 2005 are automatically created (these are not necessarily optimal). Furthermore, manualgeneration of large regular fractional factorial designs via specification of generators is possible.

Usage

FrF2Large(nruns, nfactors = NULL, factor.names = if (!is.null(nfactors)){if (nfactors <= 50)

Letters[1:nfactors]else paste("F", 1:nfactors, sep = "")} else NULL,default.levels = c(-1, 1), ncenter = 0, center.distribute = NULL,generators = NULL,replications = 1, repeat.only = FALSE,randomize = TRUE, seed = NULL, alias.info = 2, ...)

nrunsV(nfactors)

Arguments

nruns Number of runs, must be a power of 2 (8192 to 32768).The number of runs must match the number of factors. Function nrunsV can beused for determining the number of runs needed for a resolution V design, andfor advice on the function to be used.For more detail on specification of the number of runs, see the Details section.

nfactors is the number of 2-level factors to be investigated. It can be omitted, if it isobvious from options factor.names or generators.The number of factors must match the length of generators.

Page 54: Package 'FrF2' - Cran

54 FrF2Large

factor.names a character vector of nfactors factor names or a list with nfactors elements;if the list is named, list names represent factor names, otherwise default factornames are used;the elements of the list areEITHER vectors of length 2 with factor levels for the respective factorOR empty strings. For each factor with an empty string in factor.names, thelevels given in default.levels are used;Default factor names are the first elements of the character vector Letters, orthe factors position numbers preceded by capital F in case of more than 50 fac-tors.

default.levels default levels (vector of length 2) for all factors for which no specific levels aregiven

ncenter number of center points per block; ncenter > 0 is permitted, if all factors arequantitative and the design is not a split-plot design

center.distribute

the number of positions over which the center points are to be distributed foreach block; if NULL (default), center points are distributed over end, begin-ning, and middle (in that order, if there are fewer than three center points) forrandomized designs, and appended to the end for non-randomized designs. formore detail, see function add.center, which does the work.

generators There are log2(nruns) base factors the full factorial of which spans the design(e.g. 10 for 1024 runs). The generators specify how the remaining factors are tobe allocated to interactions of these.WARNING: Of course, with manual specification of generators, the structure ofthe design is in the users responsibility; the function only prevents confoundingof two main effects with each other.generators can bea list of vectors with position numbers of base factors (e.g. c(1,3,4) stands forthe interaction between first, third and fourth base factor)a vector of character representations of these interactions, e.g. “ACD” stands forthe same interaction as abovea vector of columns numbers in Yates order (e.g. 13 stands for ACD). Note thatthe columns 1, 2, 4, 8, etc., i.e. all powers of 2, are reserved for the base factorsand cannot be used for assigning additional factors, because the design wouldbecome a resolution II design. For looking up which column number stands forwhich interaction, type e.g. names(Yates)[1:15] for a 16 run design.WARNING: Contrary to function FrF2, it is not possible to precede generatorentries with a minus sign for reversing column levels; instead, the levels mustbe swapped.

replications positive integer number. Default 1 (i.e. each row just once). If larger, each de-sign run is executed replication times. If repeat.only, repeated measurementsare carried out directly in sequence, i.e. no true replication takes place, and allthe repeat runs are conducted together. It is likely that the error variation gen-erated by such a procedure will be too small, so that average values should beanalyzed for an unreplicated design.Otherwise (default), the full experiment is first carried out once, then for thesecond replication and so forth. In case of randomization, each such blocks is

Page 55: Package 'FrF2' - Cran

FrF2Large 55

randomized separately. In this case, replication variance is more likely suitablefor usage as error variance (unless e.g. the same parts are used for replicationruns although build variation is important).

repeat.only logical, relevant only if replications > 1. If TRUE, replications of each runare grouped together (repeated measurement rather than true replication). Thedefault is repeat.only=FALSE, i.e. the complete experiment is conducted inreplications blocks, and each run occurs in each block.

randomize logical. If TRUE, the design is randomized. This is the default. In case of repli-cations, the nature of randomization depends on the setting of option repeat.only.

seed optional seed for the randomization processalias.info can be 2 or 3, gives the order of interaction effects for which alias information

is to be included in the aliased component of the design.info element of theoutput object.

... currently not used

Details

If generators are not explicitly specified, function FrF2Large creates a resolution V design accord-ing to the rules by Sanchez and Sanchez (2005) for the specified number of factors in the specifiednumber of runs. The Sanchez and Sanchez article offers designs withat least 1024 runs for 25 to 29 factors (1024 up to 33 factors with FrF2),at least 2048 runs for 30 to 38 factors (2048 up to 47 factors with FrF2),at least 4096 runs for 39 to 52 factors (4096 up to 65 factors with FrF2),at least 8192 runs for 53 to 69 factors (up to 65 factors in half the run size with FrF2),at least 16384 runs for 70 to 92 factors, (at least 32768 runs for 93 to 120 factors.For designs with up to 4096 runs, function FrF2 creates better automatic designs. Therefore, func-tion FrF2Large is restricted to usage for larger designs.

Users can explicitly specify a design through specifying generators via the generators option. Forup to 4096 runs, this is also possible with function FrF2, even with more flexibility. Therefore,manual design generation with function FrF2Large is also restricted to designs of at least 8192runs.

Manual generation of large designs with the option generators is limited by computer memoryonly. nruns must be at least large enough to accomodate the rightmost generator column; forexample, if generators contains an element ABEP, P is the 15th base factor (15th letter in Letters),i.e. nruns must be at least 2^15=32768; if the largest generator column number in Yates columnnotation is 4201, nruns must be at least 2^ceiling(log2(4201))=8192.

Value

Function nrunsV invisibly returns the number of runs requested and prints a message with thenumber of runs and the appropriate function.

Function FrF2Large returns a data frame of S3 class design and has attached attributes that can beaccessed by functions desnum, run.order and design.info.

The data frame itself contains the design with levels coded as requested. If no center points havebeen requested, the design columns are factors with contrasts -1 and +1 (cf. also contr.FrF2); incase of center points, the design columns are numeric.

Page 56: Package 'FrF2' - Cran

56 FrF2Large

The following attributes are attached to it:

desnum Design matrix in -1/1 coding

run.order three column data frame, first column contains the run number in standard order,second column the run number as randomized, third column the run numberwith replication number as postfix; useful for switching back and forth betweenactual and standard run number

design.info list with the entries

type character string “FrF2.large”nruns number of runs (replications are not counted)nfactors number of factorsfactor.names list named with (treatment) factor names and containing as en-

tries vectors of length two each with coded factor levelsgenerators for designs of type FrF2.generators only;

character vector of generators in the form D=ABC etc.aliased alias structure of main effects, 2fis and possibly 3fis, depending on

the choice of alias.info; For non-blocked and non-split-plot designs,aliased is itself a list of the two or three components main, fi2, and op-tionally fi3, given in terms of factor letters from Letters (up to 50~factors)or F1, F2, and so forth (more than 50~factors). For blocked and split-plotdesigns, aliased is a single list with an entry for each column of the Yatesmatrix that accomodates aliased low-order effects, and entries are in termsof factor names.)

replications option setting in call to FrF2

repeat.only option setting in call to FrF2

randomize option setting in call to FrF2

seed option setting in call to FrF2

creator call to function FrF2Large; (in future, may also contain stored menusettings from R commander plugin RcmdrPlugin.DoE, once the functionhas been implemented in that package)

FrF2.version version number of package FrF2, supporting correct usage ofFrF2-specific functionality in functions summary and generators methodsfor class design

ncube number of cube points per block, in case center points have been re-quested

ncenter number of center points per block, in case center points have beenrequested

Note

This package is still under development, but does already provide useful and well-tested results.

Author(s)

Ulrike Groemping

Page 57: Package 'FrF2' - Cran

IAPlot 57

References

Mee, R. (2009). A Comprehensive Guide to Factorial Two-Level Experimentation. New York:Springer.

Sanchez, S.M. and Sanchez, P.J. (2005). Very Large Fractional Factorial and Central CompositeDesigns. ACM Transactions on Modeling and Computer Simulation 15, 362-377.

See Also

See also FrF2 for smaller regular fractional factorials and oacat for two non-regular resolution Vfractional factorials (reported e.g. by Mee 2009) for up to 19 factors in 256 runs or up to 63 factorsin 2048 runs

Examples

## numbers of runs needed for resolution V designs in different numbers of factorsnrunsV(8)nrunsV(18)needed <- nrunsV(27)needednrunsV(65)nrunsV(71)

## Not run:plan <- FrF2Large(nrunsV(75),75)summary(plan)

## End(Not run)

IAPlot Main Effects and Interaction Plots

Description

Main effects plots and interaction plots are produced. The other documented functions are notintended for users.

Usage

MEPlot(obj, ...)## S3 method for class 'design'MEPlot(obj, ..., response = NULL)## Default S3 method:MEPlot(obj, main = paste("Main effects plot for", respnam),

pch = 15, cex.xax = par("cex.axis"), cex.yax = cex.xax, mgp.ylab = 4,cex.title = 1.5, cex.main = par("cex.main"),lwd = par("lwd"), abbrev = 3, select = NULL, ...)

IAPlot(obj, ...)

Page 58: Package 'FrF2' - Cran

58 IAPlot

## S3 method for class 'design'IAPlot(obj, ..., response = NULL)## Default S3 method:IAPlot(obj, main = paste("Interaction plot matrix for", respnam),

pch = c(15, 17), cex.lab = par("cex.lab"), cex = par("cex"),cex.xax = par("cex.axis"), cex.yax = cex.xax, cex.title = 1.5,lwd = par("lwd"), abbrev = 4, select = NULL, show.alias = FALSE, ...)

intfind(i, j, mat)

check(obj)

remodel(obj)

Arguments

obj an experimental design of class design with the type element of the design.infoattribute containing “FrF2” or “pb”ORa linear model object with 2-level factors or numerical 2-level variables;the structure must be such that effects are either fully aliased or orthogonal, likein a regular fractional factorial 2-level design;note that IAPlot currently requires the response in obj to be a pre-defined vari-able and not a calculated quantity

... further arguments to be passed to the default function;. . . in the default method are not used, they have been added because of formalrequirements only

response character string that specifies response variable to be used, must be an element ofresponse.names(obj); if NULL, the first response from response.names(obj)is used

main overall title for the plot assembly

pch Plot symbol number MEPlot, or vector of two plot symbol numbers for the lowerand higher level of the trace factor iap

cex.xax size of x-axis annotation, defaults to cex.axis-parameter

cex.yax size of y-axis annotation, defaults to cex.xax

mgp.ylab horizontal placement of label of vertical axis in MEPlot

cex.title multiplier for size of overall title (cex.main is multiplied with this factor)

cex.main size of individual plot titles in MEPlot

cex.lab Size of variable names in diagonal panels of interaction plots produced by IAPlot.

cex size of plot symbols in interaction plots

lwd line width for plot lines and axes

abbrev number of characters shown for factor levels

Page 59: Package 'FrF2' - Cran

IAPlot 59

select vector with position numbers of the main effects to be displayed;default: all main effects; the default implies the full interaction plot matrix forIAPlot.For IAPlot, the full interaction plot matrix for the selected factors is displayed.Of course, at least two factors must be selected. Furthermore, the linear modelobj must at least contain one interaction term among the selected variables.For interactions that do not occur in the linear model, not plot is shown. Aninteraction plot matrix of data means can be obtained by specifying the modelwith all possible 2-factor interactions (e.g. formula y~(.)^2 for a regular 2-levelfractional factorial, for which y is the only response and all other variables are2-level factors).

show.alias if TRUE, the interaction plot shows the number of the list entry from aliases(obj)\$aliases(cf. aliases) in order to support immediate diagnosis of which depicted inter-action may be due to other than the shown effect because of aliasing;CAUTION: if the select option is used, the model is reduced to the selectedfactors, i.e. aliases with unselected factors are not shown!

i integer, for internal use only

j integer, for internal use only

mat matrix, for internal use only

Details

For functions MEPlot or IAPlot, if obj is a design with at least one response variable rather thana linear model fit, the lm-method for class design is applied to it with the required degree (1 or2), and the default method for the respective function is afterwards applied to the resulting linearmodel.

MEPlot produces plots of all main effects in the model, or selected ones if select is specified

IAPlot produces plots of all interaction effects in the model, or selected ones if select is specified

intfind is an internal function not directly useful for users

check is an internal function for checking whether the model complies with assumptions (frac-tional factorial of 2-level factors with full or no aliasing, not partial aliasing; this implies thatPlackett-Burman designs with partial aliasing of 2-factor interactions give an OK (=TRUE) incheck for pure main effects models only.)

remodel is an internal function that redoes factor values into -1 and 1 coding, regardless of thecontrasts that have been used for the original factors; numerical data are transformed by sub-tracting the mean and dividing by half the range (max-min), which also transforms them to -1and 1 coding in the 2-level case (and leads to an error otherwise)

Value

MEPlot and IAPlot invisibly return the plotted effects (two-row matrix or four-row matrix, re-spectively). If show.alias=TRUE, the matrix returned by IAPlot has as the attribute aliasgroups,which contains all alias groups (list element number corresponds to number in the graphics tableau).

The internal function check is used within other functions for checking whether the model is afractional factorial with 2-level factors and no partial aliasing, as requested for the package to work.

Page 60: Package 'FrF2' - Cran

60 pb

It is applied to remodeled objects only and returns a logical. If the returned value is FALSE, thecalling function fails.

The internal function intfind returns an integer (length 1 or 0). It is not useful for users.

The internal function remodel is applied to a linear model object and returns a list of two compo-nents:

model is the redone model with x-variables recoded to numeric -1 and 1 notation andaov objects made into “pure” lm objects

labs is a list preserving the level information from original factors (levels are minusand plus for numerical variables)

Author(s)

Ulrike Groemping

References

Box G. E. P, Hunter, W. C. and Hunter, J. S. (2005) Statistics for Experimenters, 2nd edition. NewYork: Wiley.

See Also

FrF2-package for examples

pb Function to generate non-regular fractional factorial screening de-signs

Description

The function generates Plackett-Burman designs and in some cases other screening designs in runnumbers that are a multiple of 4. These designs are particularly suitable for screening a largenumber of factors, since interactions are not fully aliased with one main effect each but partiallyaliased. (The design in 8 runs is an exception from this rule.)

Usage

pb(nruns, nfactors = nruns - 1, factor.names = if (nfactors <= 50)Letters[1:nfactors] else paste("F", 1:nfactors, sep = ""),default.levels = c(-1, 1), ncenter=0, center.distribute=NULL,boxtyssedal = TRUE, n12.taguchi = FALSE,replications = 1, repeat.only = FALSE,randomize = TRUE, seed = NULL, oldver = FALSE, ...)

pb.list

Page 61: Package 'FrF2' - Cran

pb 61

Arguments

nruns number of runs, must be a multiple of 4nfactors number of factors, default is nruns - 1, and it is recommended to retain this de-

fault.It is possible to specify factor names for fewer factors, and the remaining columnswill be named e1, e2, ... They are useful for representing error in effects plots(so-called dummy factors).

factor.names a character vector of factor names (length up to nfactors) or a list with nfactorselements;if the list is named, list names represent factor names, otherwise default factornames are used;the elements of the list areEITHER vectors of length 2 with factor levels for the respective factorOR empty strings. For each factor with an empty string in factor.names, thelevels given in default.levels are used;Default factor names are the first elements of the character vector Letters, orthe factors position numbers preceded by capital F in case of more than 50 fac-tors.

default.levels default levels (vector of length 2) for all factors for which no specific levels aregiven

ncenter number of center points; ncenter > 0 is permitted, if all factors are quantitativecenter.distribute

the number of positions over which the center points are to be distributed ; ifNULL (default), center points are distributed over end, beginning, and middle(in that order, if there are fewer than three center points) for randomized de-signs, and appended to the end for non-randomized designs. for more detail, seefunction add.center, which does the work.

boxtyssedal logical, relevant only for nruns=16. If FALSE, the geometric (=standard) 16 runplan is used. If TRUE, the proposal by Box and Tyssedal is used instead, whichhas the advantage (for screening) of aliasing each interaction with several maineffects, like the other Plackett-Burman designs.

n12.taguchi logical, relevant only for nruns=12. If TRUE, the 12 run design is given inTaguchi order.

replications positive integer number. Default 1 (i.e. each row just once). If larger, each de-sign run is executed replication times. If repeat.only, repeated measurementsare carried out directly in sequence, i.e. no true replication takes place, and allthe repeat runs are conducted together. It is likely that the error variation gen-erated by such a procedure will be too small, so that average values should beanalyzed for an unreplicated design.Otherwise (default), the full experiment is first carried out once, then for thesecond replication and so forth. In case of randomization, each such blocks israndomized separately. In this case, replication variance is more likely suitablefor usage as error variance (unless e.g. the same parts are used for replicationruns although build variation is important).

repeat.only logical, relevant only if replications > 1. If TRUE, replications of each runare grouped together (repeated measurement rather than true replication). The

Page 62: Package 'FrF2' - Cran

62 pb

default is repeat.only=FALSE, i.e. the complete experiment is conducted inreplications blocks, and each run occurs in each block.

randomize logical. If TRUE, the design is randomized. This is the default.

seed optional seed for the randomization process

oldver logical. If TRUE, the column ordering from package versions 1.0-5 to 1.2.10 isused. This affects designs in 40, 52, 56, 64, 76, 92, 96 and 100 runs. Usually,option oldver should not be set to is useful for reproducing an old design, orfor making a design in 40, 56, 64, 88 or 96 runs with exactly half the number offactors resolution IV.

... currently not used

Details

pb stands for Plackett-Burman. Plackett-Burman designs (Plackett and Burman 1946) are generallyused for screening many variables in relatively few runs, when interest is in main effects only, atleast initially. Different from the regular fractional factorial designs created by function FrF2, theydo not perfectly confound interaction terms with main effects but distribute interaction effects overseveral main effects. The designs with number of runs a power of 2 are an exception to this rule:they are just the resolution III regular fractional factorial designs and are as such not very suitablefor screening because of a high risk of very biased estimates for the main effects of the factors.Where possible, these are therefore replaced by different designs (cf. below).

For most run numbers, function pb uses Plackett-Burman designs, and simply fills columns fromleft to right. The generating rows for these designs can be found in the list pb.list (a 0 entryindicates that the design is constructed by a different method, e.g. doubling).

For 12 runs, the isomorphic design by Taguchi can be requested. For 16 runs, the default is to usethe designs suggested by Box and Tyssedal (2001), which up to 14 factors do not suffer from perfectaliasing. For 32 runs, a cyclic design with generating row given in Samset and Tyssedal (1999) isused. For 64 runs, the 32 run design is doubled. For 92 runs, a design is constructed according tothe Williamson construction with matrices A, B, C and D from Hedayat and Stufken (1999), p. 160.

Designs up to 100~runs are covered.

Usage of the 8 run design for more than 4 factors is discouraged, as it completely aliases maineffects with individual two-factor interactions. It is recommended to use at least the 12 run designinstead for screening more than 4 factors.

Value

Value is a data frame of S3 class design and has attached attributes that can be accessed by functionsdesnum, run.order and design.info.

The data frame itself contains the design with levels coded as requested. If no center points havebeen requested, the design columns are factors with contrasts -1 and +1 (cf. also contr.FrF2); incase of center points, the design columns are numeric.

The following attributes are attached to it:

desnum Design matrix in -1/1 coding

Page 63: Package 'FrF2' - Cran

pb 63

run.order three column data frame, first column contains the run number in standard order,second column the run number as randomized, third column the run numberwith replication number as postfix; useful for switching back and forth betweenactual and standard run number

design.info list with entries

type character string “pb”, except for 8~runs with up to 4~factors, for which atype “FrF2” design is output

nruns number of runs (replications are not counted)nfactors number of factorsfactor.names list named with (treatment) factor names and containing as en-

tries vectors of length two each with coded factor levelsndummies number of dummy factors for errorreplication option setting in call to pb

repeat.only option setting in call to pb

randomize option setting in call to pb

seed option setting in call to pb

creator call to function pb (or stored menu settings, if the function has beencalled via the R commander plugin RcmdrPlugin.DoE)

Warning

With version 1.0-5 of package FrF2, design generation for the designs based on doubling haschanged (internal function double.des). This affected designs for 40,56,64,88,96 runs. With ver-sion 1.3 of package FrF2, this and further behaviors (52, 76) has changed again, in the interest ofimproving generalized resolution of desigs produced by function pb.

For the affected run sizes, package versions from 1.0-5 onwards cannot exactly reproduce pb de-signs that have been created with a version before 1.0-5. Package versions from 1.3 onwards repro-duce the behavior of versions 1.0-5 to 1.2-10 through option oldver.

Author(s)

Ulrike Groemping

References

Box, G.E.P. and Tyssedal, J. (2001) Sixteen Run Designs of High Projectivity for Factor Screening.Communications in Statistics - Simulation and Computation 30, 217-228.

Hedayat, A.S., Sloane, N.J.A. and Stufken, J. (1999) Orthogonal Arrays: Theory and Applications,Springer, New York.

Groemping, U. (2014). R Package FrF2 for Creating and Analyzing Fractional Factorial 2-LevelDesigns. Journal of Statistical Software, 56, Issue 1, 1-56. http://www.jstatsoft.org/v56/i01/.

Mee, R. (2009). A Comprehensive Guide to Factorial Two-Level Experimentation. New York:Springer.

Plackett, R.L.; Burman, J.P. (1946) The design of optimum multifactorial experiments. Biometrika33, 305-325.

Page 64: Package 'FrF2' - Cran

64 pb

Samset, O.; Tyssedal, J. (1999) Two-level designs with good projection properties. Technical Report12, Department of Mathematical Sciences, The Norwegian University of Science and Technology,Norway.

Williamson, J. (1946) Determinants whose elements are 0 and 1. American Mathematical Monthly53, 427-434.

See Also

See also FrF2 for regular fractional factorial designs, generalized.word.length for functionslength3 and length4 used in examples

Examples

pb(12,randomize=FALSE)pb(12,randomize=FALSE,n12.taguchi=TRUE)pb(20,seed=29869)pb(16,factor.names=list(A="",B="",C="",D=c("min","max"),

E="",F="",G="",H="",J=c("new","old")))pb(8,default.levels=c("current","new"))test <- pb(40) ## design created by doubling the 20 run designpb(12, ncenter=6) ## 6 center points with default placement

## Not run:## note: designs in 40, 56, 64, 88, and 96 runs are resolution IV,## if the number of factors is up to nruns/2 - 1, e.g.:plan1 <- pb(40, 19)length3(plan1) ## 0 generalized words of length 3length4(plan1) ## 228 generalized words of length 4## they can be made resolution IV by oldver=TRUE for## nfactors=nruns/2, e.g.:plan2 <- pb(40, 20)plan3 <- pb(40, 20, oldver=TRUE)length3(plan2) ## 9 generalized words of length 3length3(plan3) ## 0 generalized words of length 3length4(plan3) ## 285 generalized words of length 4

## note: designs in 52, 76, and 100 runs are almost resolution IV,## if the number of factors is up to nruns/2 - 1, e.g.:plan4 <- pb(52, 25)GR(plan4) ## generalized resolution 3.92

## note: versions >1.3 avoid complete and heavy aliasing of triples of factors## for up to nruns-2 factors for 40, 52, 56, 64, 76, 88, 92 and 96 runs## (the same for 100 runs, which were not implemented before version 1.3)plan5 <- pb(40, 38)plan6 <- pb(40, 38, oldver=TRUE)GR(plan5) ## generalized resolution 3.4GR(plan6) ## generalized resolution 3plan7 <- pb(52, 50)plan8 <- pb(52, 50, oldver=TRUE)GR(plan7) ## generalized resolution 3.62GR(plan8) ## generalized resolution 3.15

Page 65: Package 'FrF2' - Cran

splitplot 65

## End(Not run)

splitplot Statistical and algorithmic aspects of split-plot designs in FrF2

Description

This help page documents the statistical and algorithmic details of split-plot designs in FrF2

Details

A split-plot design is similar to a blocked design, with the difference that there are also factors ofinterest that can be only changed on block level (so-called whole plot factors). The blocks are called“plots” in the context of split-plot designs. The factors that can (and should!) be varied within aplot are called split-plot factors. Note that the experiment provides more information on split-plotfactors than on whole-plot factors.

Warning: In terms of analysis, split-plot designs would have to be treated by advanced randomeffects models, but often are not. At the very least, the user must be aware that all whole-ploteffects (i.e. effects on columns that only change between plots) are (likely to be) more variable thansplit-plot effects so that e.g. it does not necessarily mean anything if they stick out in a normal orhalf-normal effects plot.

Designs for hard-to-change factors are also treated by the split-plot approach in function FrF2,although they are not quite split-plot designs: The are non-randomized split-plot designs arrangedin an order such that the first whole-plot factors have as few as possible changes. This gives verypoor information on these first whole-plot factors (which in the extreme are only changed once ortwice), if there is variability involved with setting the factor levels.If hard-to-change factors can be implemented as true whole-plot factors with randomization, this isby far preferrable from a statistical point of view (but may nevertheless be rejected from a feasibilitypoint of view, as the necessary changes may seem unaffordable).

For design generation, there are two principal ways to handle split-plot designs, manual definition(i.e. the user specifies exactly which columns are to be used for which purpose) and automaticdefinition. Each situation has its specifics. These are detailed below. For users with not so muchmathematical/statistical background, it will often be best to use the automatic way, specifying thetreatement factors of interest via nfactors or factor.names and a single number for WPs. Userswith more mathematical background may want to use the manual definitions, perhaps in conjunctionwith published catalogues of good split-plot designs, or after inspecting possibilities with functionsplitpick.

Manual definition of split-plot designs The user can specify a design with the design or thegenerators option and specify manually with the WPfacs option, which factors are wholeplot factors (i.e. factors that do not change within a plot). The other factors become split-plotfactors (i.e. factors that do change within a plot). If the user chooses this route, WPfacs mustbe character vectors of factor names, factor letters, factor numbers preceded by capital F, ora vector or list of factor position numbers (NOT: Yates column numbers). Caution: It is the

Page 66: Package 'FrF2' - Cran

66 splitplot

users responsibility to ensure a good choice of split-plot design (e.g. by using a catalogueddesign from Huang, Chen and Voelkel 1998, Bingham and Sitter 2003, or Bingham Schoenand Sitter 2004). In case of a user-mistake such that the resulting design is not a split-plotdesign with the alleged number of whole plots, an error is thrown.

Automatic definition of split-plot designs As mentioned above, split-plot designs differ from blockdesigns by the fact that the block main effects are purely nuisance parameters which areassumed (based on prior knowledge) to be relevant but are not of interest, while the plotsare structured by nfac.WP whole plot factors, which are of interest. The user has to decideon a number of whole plots (WPs) as well as the number of whole plot factors nfac.WP. Iflog2(WPs) <= nfac.WP <= WPs-1, it is obviously in principle possible to accomodate the de-sired number of whole plot factors in the desired number of whole plots. If nfac.WP > WPs/2,the base design for the split-plot structure has to be of resolution III. Sometimes, subject mat-ter considerations limit whole plot sizes, and there are only few interesting whole plot factors,i.e. nfac.WP < log2(WPs). In this case, it is of course nevertheless necessary to have a totalof log2(WPs) whole plot construction factors; the missing log2(WPs) - nfac.WP factors areadded to the design (names starting with WP), and nfactors is increased accordingly.

In all cases, the first nfac.WPs user-specified factors are treated as whole plot factors, theremaining factors as split-plot factors.

From there, function FrF2 proceeds like in the blocked situation by starting with the bestdesign and working its way down to worse designs, if the best design cannot accomodate thedesired split-plot structure. For each design, function FrF2 calls function splitpick, whichpermutes base factors until the requested whole plot / split-plot structure is achieved, or untilimpossibility for this design with these base factors has been ascertained. In the latter case,function FrF2 proceeds to the next best design and so forth.

If several competing split-plot designs based on the same base design are found, the bestpossible resolution among the first check.WPs such designs is chosen. No further criteria areautomatically implemented, and no more than check.WPs designs are checked. If not satisfiedwith the structure of the whole plot portion of the experiment, increasing check.WPs vs. thedefault 10 may help. Expert users may want to inspect possibilities, using function splitpickdirectly.

Note that the algorithm does not necessarily find an existing split-plot design. It has beenchecked out which catalogued designs it can find: designs for all catalogued situations fromBingham and Sitter (2003) have been found, as well as for most catalogued situations fromHuang, Chen and Voelkel (1998). Occasionally, a better design than catalogued has beenfound, e.g. for 4 whole plot and 10 split plot factors in 32 runs with 16 whole plots, the designfound by the algorithm is resolution IV, while Huang, Chen and Voelkel propose a resolutionIII design. The algorithm has the largest difficulties with extreme designs in the sense that alarge number of whole plots with a small number of whole plot factors are to be accomodated;thus it does not find designs for the more extreme situations in Bingham, Schoen and Sitter(2004).

Please contact me with any suggestions for improvements.

Author(s)

Ulrike Groemping

Page 67: Package 'FrF2' - Cran

splitplot 67

References

Bingham, D.R., Schoen, E.D. and Sitter, R.R. (2004). Designing Fractional Factorial Split-PlotExperiments with Few Whole-Plot Factors. Applied Statistics 53, 325-339.

Bingham, D. and Sitter, R.R. (2003). Fractional Factorial Split-Plot Designs for Robust ParameterExperiments. Technometrics 45, 80-89.

Chen, J., Sun, D.X. and Wu, C.F.J. (1993) A catalogue of 2-level and 3-level orthogonal arrays.International Statistical Review 61, 131-145.

Cheng, C.-S. and Tsai, P.-W. (2009). Optimal two-level regular fractional factorial block and split-plot designs. Biometrika 96, 83-93.

Huang, P., Chen, D. and Voelkel, J.O. (1998). Minimum-Aberration Two-Level Split-Plot Designs.Technometrics 40, 314-326.

See Also

See Also FrF2 for regular fractional factorials, catlg for the Chen, Sun, Wu catalogue of designsand some accessor functions, and block for the statistical aspects of blocked designs.

Examples

########## hard to change factors ###################### example from Bingham and Sitter Technometrics 19999## MotorSpeed, FeedMode,FeedSizing,MaterialType are hard to changeBS.ex <- FrF2(16,7,hard=4,

factor.names=c("MotorSpeed", "FeedMode","FeedSizing","MaterialType","Gain","ScreenAngle","ScreenVibLevel"),

default.levels=c("-","+"))design.info(BS.ex)BS.ex## NOTE: the design has 8 whole plots.## The first hard-to-change factors have very few changes only## between whole plots.## A conscious and honest decision is required whether it is## acceptable for the situation at hand not to reset them!## A proper split-plot design with resetting all whole plot factors## for each whole plot would be strongly preferred from a## statistical point of view.

########## automatic generation for split plot ############ 3 control factors, 5 noise factors, control factors are whole plot factors## 8 plots desired in a total of 32 runs## Bingham Sitter 2003BS.ex2a <- FrF2(32, 8, WPs=8, nfac.WP=3,

factor.names=c(paste("C",1:3,sep=""), paste("N",1:5,sep="")),randomize=TRUE)

## manual generation of this same designBS.ex2m <- FrF2(32, 8, generators=c("ABD","ACD","BCDE"),WPs=8, WPfacs=c("C1","C2","C3"), nfac.WP=3,

factor.names=c(paste("C",1:3,sep=""),paste("N",1:5,sep="")),randomize=TRUE)

## design with few whole plot factors## 2 whole plot factors, 7 split plot factors

Page 68: Package 'FrF2' - Cran

68 StructurePickers

## 8 whole plots, i.e. one extra WP factor neededBSS.cheese.exa <- FrF2(32, 9, WPs=8, nfac.WP=2,

factor.names=c("A","B","p","q","r","s","t","u","v"))design.info(BSS.cheese.exa)## manual generation of the design used by Bingham, Schoen and Sitter## note that the generators include a generator for the 10th spplitting factor

## s= ABq, t = Apq, u = ABpr and v = Aqr, splitting factor rho=ApqrBSS.cheese.exm <- FrF2(32, gen=list(c(1,2,4),c(1,3,4),c(1,2,3,5),c(1,4,5),c(1,3,4,5)),

WPs=8, nfac.WP=3, WPfacs=c(1,2,10),factor.names=c("A","B","p","q","r","s","t","u","v","rho"))

design.info(BSS.cheese.exm)

StructurePickers Functions to find split-plot or left-adjusted designs

Description

Functions to restructure a fractional factorial by permuting the base factors such that the leftmostbase factors have a suitable alias structure for the problem at hand; meant for expert users

Usage

splitpick(k, gen, k.WP, nfac.WP, show=10)leftadjust(k, gen, early=NULL, show=10)

Arguments

k the number of base factors (designs have 2^k runs)

gen vector of generating columns from Yates matrix

k.WP integer number of base factors used for whole plot generation; there will be2^k.WP plots in the design

nfac.WP integer number of whole plot factors, must not be smaller than k.WP; the otherk + length(gen) factors are split-plot factors, i.e. they change within plots

show numeric integer indicating how many results are to be shown; for function splitpick,this number also determines how many designs are investigated; the other twofunctions investigate all designs and show the best results only

early number that indicates how many “leftmost” factors are needed in the design;used by FrF2 for accomodating hard-to-change factors

Details

These functions exploit the fact that a factorial design can be arranged such that the 2^k.WP-1leftmost columns have exactly 2^k.WP different patterns. They can thus accomodate whole ploteffects if 2^k.WP plots are available; also, with a specially rearranged version of the Yates matrix,the leftmost columns can have particularly few or particularly many level changes, cf. e.g. Cheng,Martin and Tang 1998.

Page 69: Package 'FrF2' - Cran

StructurePickers 69

By permuting the k base factors , the functions try to find 2^k.WP ones that accomodate the currentneeds, if taken as the first base factors. They are used by function FrF2, if a user requests anautomatically-generated split-plot design or a design with some factors declared hard-to-change.

There may be a possibility to better accomodate the experimenters needs within a given design bytrying different sets of base factors. This is not done in these functions. Also, custom user needsmay be better fulfilled, if an expert user directly uses one of these functions for inspecting thepossibilities, rather than relying on the automatic selection routine in function FrF2.

Value

Both functions output a list of entries with information on at most show suitable permutations.splitpick ends with an error, if no suitable solution can be found.

orig original generator column numbers

basics named vector with the following entries:for function splitpick, entries are the number of runs, the number of plots, thenumber of whole plot factors and the number of split-plot factorsfor function leftadjust, entries are the number of runs, the number of factors,and - if early is not NULL - the entry for early

perms matrix with rows containing permutations of base factors

res.WP for splitpick only;vector of resolutions for the respective rows of perms

maxpos for leftadjust only;vector of maximum positions for the early leftmost factors for the respectiverows of perms

k.early for leftadjust only;vector of numbers of base factors needed for spanning the early leftmost factorsfor the respective rows of perms

gen matrix the rows of which contain the generator columns for the respective rowsof perms

Author(s)

Ulrike Groemping

References

Cheng, C.-S., Martin, R.J., and Tang, B. (1998). Two-level factorial designs with extreme numbersof level changes. Annals of Statistics 26, 1522-1539.

See Also

See Also FrF2

Page 70: Package 'FrF2' - Cran

70 StructurePickers

Examples

## leftadjusting MA design from table 6.22 in BHH2, 9 factors, 32 runs## NOTE: nevertheless not as well left-adjusted as the isomorphic design 9-4.1 from catlgleftadjust(5,c(30,29,27,23))## with option early=4 (i.e. 4 columns as early as possible are requested)leftadjust(5,c(30,29,27,23),early=4)leftadjust(5,catlg$'9-4.1'$gen,early=4)

## look for a split plot design in 32 runs with 7 factors,## 3 of which are whole plot factors,## and 8 plotssplitpick(5,catlg$'7-2.1'$gen,nfac.WP=3,k.WP=3)

Page 71: Package 'FrF2' - Cran

Index

∗Topic arrayadd.center, 5block, 9blockpick, 12CatalogueAccessors, 17compromise, 26estimable.2fis, 32fold.design, 36FrF2, 38FrF2-package, 2FrF2Large, 53pb, 60splitplot, 65StructurePickers, 68

∗Topic designadd.center, 5aliases, 8block, 9blockpick, 12BsProb.design, 15CatalogueAccessors, 17CIG, 22compromise, 26cubePlot, 28DanielPlot, 29estimable.2fis, 32fold.design, 36FrF2, 38FrF2-package, 2FrF2Large, 53IAPlot, 57pb, 60splitplot, 65StructurePickers, 68

[.catlg (CatalogueAccessors), 17

add.center, 5, 40, 54, 61alias, 9aliases, 4, 8, 59aliasprint (aliases), 8

all.2fis.clear.catlg(CatalogueAccessors), 17

block, 9, 43–45, 49, 65, 67block.catlg (CatalogueAccessors), 17blockpick, 10, 11, 12, 47blockpick.big, 10, 11, 47BsMD, 4, 16BsProb, 16BsProb.design, 15

CatalogueAccessors, 17catlg, 12, 27, 32, 34, 40, 41, 45, 49, 67catlg (CatalogueAccessors), 17check (IAPlot), 57CIG, 22, 32CIGstatic (CIG), 22clear.2fis (CatalogueAccessors), 17clique.number, 23compromise, 26, 34contr.FrF2, 46, 55, 62cubecorners (cubePlot), 28cubedraw (cubePlot), 28cubelabel (cubePlot), 28cubePlot, 4, 28

DanielPlot, 4, 29degree, 23design, 4, 15, 30, 45, 55, 58, 62design.info, 45, 55, 62desnum, 45, 55, 62DoE.base, 3, 4DoE.wrapper, 4dominating (CatalogueAccessors), 17

estimable.2fis, 19, 26, 27, 32, 41, 42, 45, 49

fold.design, 36FrF2, 2, 4, 6, 7, 11–14, 21, 26, 27, 32, 34, 38,

38, 54, 55, 57, 62, 64, 66, 67, 69FrF2-package, 2

71

Page 72: Package 'FrF2' - Cran

72 INDEX

FrF2.catlg128, 32FrF2Large, 2, 4, 49, 53

gen2CIG (CIG), 22generalized.word.length, 64

halfnormal, 32

IAPlot, 4, 9, 57independence.number, 23intfind (IAPlot), 57iscube, 6

largest.cliques, 23layout, 23leftadjust, 13leftadjust (StructurePickers), 68length3, 64length4, 64LenthPlot, 32Letters, 40, 54, 55, 61

MEPlot, 4MEPlot (IAPlot), 57myscatterplot3d (cubePlot), 28

Names of catalogues from package, 41nclear.2fis (CatalogueAccessors), 17nfac (CatalogueAccessors), 17nruns (CatalogueAccessors), 17nrunsV (FrF2Large), 53

oa.design, 21oacat, 57

pb, 2, 4, 6, 7, 38, 49, 60plot.BsProb, 16plot.common, 23, 24plot.igraph, 23, 24print.aliases (aliases), 8print.BsProb, 16print.catlg (CatalogueAccessors), 17print.default, 8

qqnorm, 32

remodel (IAPlot), 57res (CatalogueAccessors), 17run.order, 45, 55, 62

splitpick, 13, 65, 66

splitpick (StructurePickers), 68splitplot, 12, 44, 45, 49, 65StructurePickers, 68summary.BsProb, 16

tkplot, 23, 24

WLP (CatalogueAccessors), 17