orthogonal array to be used; must be given as the name without quotes
(e.g. L12.2.2.6.1);
available names can be looked at using function show.oas
with option parents.only = TRUE (later it will also be possible
to directly access child designs); furthermore, L18, L36
and L54 for the respective Taguchi arrays can be used.
Users can also specify names of their own designs here (cf. details).
ID must be of class oa.
If omitted, ID is automatically determined based on nlevels
or factor.names.
nruns
minimum number of runs to be used,
can be omitted if obvious from ID or if
the smallest possible array is to be found
nfactors
number of factors;
only needed if nlevels is a single number and
factor.names is omitted;
can otherwise determined from length of factor.names,
nlevels or column
nlevels
number(s) of levels, vector with nfactors entries or single number;
can be omitted, if obvious from factor.names or if ID
and columns are given or if all columns of ID are to be used
with default factor names and levels;
can be a single number if nfactors is known directly or as length of
factor.names
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 factor names are used;
the elements of the list are
EITHER vectors of appropriate length (corresponding to nlevels)
with factor levels for the respective factor
OR empty strings;
Default factor names are the first elements of the character vector Letters,
or the factors position numbers preceded by capital F in case of more than 50 factors.
Default factor levels are the numbers from 1 to the number of levels for each factor.
columns
EITHER
a vector of column numbers referring to columns of design ID,
assigning a specific column of the array to each factor;
this can only be specified, if ID is also given;
OR
a string that defines the degree of optimization requested
in terms of column allocation (cf. section “Details”):
choices are "order", "min3", "min34",
"min3.rela", "min34.rela", "minRPFT"
or "minRelProjAberr".
For resource reasons, the default is "order", but smaller designs
can sometimes be substantially improved with other choices.
Cf. the “Details” section for the
meaning of the character string specifications for columns.
Column optimization can be computationally intensive. If it cannot
be accomplished with the given ressources, a warning is issued, and
an unoptimized design is returned.
Some of the optimization methods have just been proposed, and there is
little experience with them. It is strongly recommended to always check
the properties of the design w.r.t. suitability for the planned experiment
BEFORE starting expensive investments.
replications
the number of replications of the array,
the setting of repeat.only determines, whether these are real replications
or repeated measurements only. Note that replications are not considered for
accomodation of min.residual.df residual degrees of freedom,
unless a full factorial is used.
repeat.only
default FALSE implies real replications,
TRUE implies repeated measurements only
randomize
logical indicating whether the run order is to be randomized ?
seed
integer seed for the random number generator
min.residual.df
minimum number of residual degrees of freedom;
Note: function oa.design does not count replications specified with option
replications in determining residual degrees of freedom for min.resid.df.
levordold
logical indicating whether or not old (=pre version 0.27)
level ordering should be used;
defaults to FALSE, which implies that levels are ordered as indicated
in factor.names; in the old ordering, levels were automatically reordered
by the as.factor function, which is usually undesirable, but may be desired
for reproducing designs created with earlier versions
Details
Function oa.design assigns factors to the columns of orthogonal arrays that are
available within package DoE.base or are provided by the user.
The available arrays and their properties are listed in the
data frame oacat and can be systematically searched for using function show.oas.
The design names also indicate the number of runs and the numbers of factors
for each number of levels, e.g. L18.3.6.6.1 is an 18 run design with six factors in 3 levels
(3.6) and one factor in 6 levels (6.1).
oa is the S3 class used for orthogonal arrays. Objects of class oa should at least have
the attribute origin, an attribute comment should be used for additional information.
Users can define their own orthogonal arrays and hand them to oa.design with parameter ID.
Requirements for the arrays:
Factor levels must be coded as numbers from 1 to number of levels.
The array must be of classes oa and matrix
(If your array is a matrix named foo, you can simply assign it class oa by
the command class(foo) <- c("oa","matrix"), see also last example.)
The array should have an attribute origin.
The array can have an attribute comment;
this should be used for mentioning specific properties, e.g.
for the L18.2.1.3.7 that the interaction of the first two factors
can be estimated.
Users are encouraged to send additional arrays to the package maintainer.
The requirements for these are the same as listed above, with attribute origin
being a MUST in this case. (See the last example for how to assign an attribute.)
Currently, package DoE.base contains the orthogonal arrays from Warren Kuhfelds
collection of “parent” arrays only, plus very few additional designs,
and can automatically create the child arrays from Kuhfelds collection, using
the replacement instructions provided in the data frame oacat
through the variable lineage. The last example below indicates how
a child array can be created manually, and compares this to the automatically created array.
(A lot more than just the child arrays could be obtained from these arrays
by implementing a functionality similar to the market research macros available in SAS; presumably,
this topic will not be addressed soon, as it will involve a substantial amount of work.)
If no specific orthogonal array is specified and function oa.design does not
find an orthogonal array that meets the specified requirements,
oa.design returns a full factorial, replicated for enough residual degrees of freedom, if necessary.
If oa.design has not found an array smaller than the full factorial, it is
absolutely possibly that a smaller array does exist nevertheless. It may be worth
while checking with oacat whether an appropriate smaller array can be found by
combining some of the parent arrays listed there (looking for a design with a few
factors in 5 runs, you may e.g. call oacat[oacat$n5>0,]$name in order to see the
names of more promising candidate arrays for combination, or you may also want to look
up arrays with n25>0 subsequently.
With version 0.9-18 of the package,
the possibility for an automatic allocation of columns for improved design
performance was implemented. With version 0.23, this approach has been sped
up and extended to properly cover relative projection aberration according to
Groemping (2011) with and without step (b) (see below) (the previous choice
"maxGR.min34" was modified and renamed to "minRelProjAberr").
Because of performance reasons, and because of a lack of a clear best default,
optimum column allocation is not switched on per default.
However, with the default column order from left to right,
the package always issues a warning to remind users that an automatic unoptimized design
can be quite far from ideal.
If optimization is activated, the first step is selection of an array,
either explicitly by the user (option ID) or automatically (unoptimized)
according to the required combination of factors. Within that array, the following
choices for the column option are on offer:
"order"
the default choice; allocates factors from left to right, which
is what most software does (but what is not necessarily good, see also the example section)
"min3"
aliasing between main effects and 2-factor
interactions is kept to a minimal degree,
minimizing the number of generalized words of length 3 according to Xu and Wu (2001)
"min3.rela"
the same approach is taken, but with
relative number of generalized words according to Groemping (2011)
"min34"
may be useful, if only very few columns of an array are used;
beware the time demand; this requests
that the number of words of generalized length 4 is also minimized.
"min34.rela"
again takes the same approach, but with
relative number of generalized words according to Groemping (2011)
"minRPFT"
minimizes the relative projection frequency table, applying the
approach according to Groemping (2011) without step (b) (see next entry).
"minRelProjAberr"
applies minimum relative projection aberration
according to Groemping (2011)
((a): maximize generalized resolution,
(b): minimize total relative number of shortest words, (c) rank designs
according to relative projection frequency table (obtainable with P3.3 or P4.4, depending on resolution)
and (d) resolve ties by looking at absolute number of length 4 words in case of resolution III).
WARNING: Usually, it is recommended to investigate the properties of a design automatically
created by function oa.design before starting experimentation.
While all designs can estimate main effects in the absence of interactions,
the presence of interactions may render some designs useless or even dangerous.
Deliberate choice of columns different from the default may improve a design
(see example section)!
Mathematical comment on the expansion example:
There are 720 different ways to expand the unique L18.3.6.6.1
into an L18.2.1.3.7, depending on which row of the replacement design
nest.des is assigned to which level of the 6 level factor.
According to Eric Schoen (personal communication), all the resulting children
are isomorphic to each other and are also isomorphic to the Taguchi L18.
(This statement holds for qualitatitve factors only; there are
more different possibilities for arrays for quantitative
3 level factors, since arbitrary
relabelling of the levels is no longer isomorphic).
To see isomorphism of two designs is not easy; in the example, nest.des
has been prepared such that it is easy to see isomorphism of the resulting
child to the Taguchi L18: L18 is reproduced by
assigning the first row of nest.des to level 1 etc.,
except for a swap of columns G and H.
Value
oa.design returns a data frame of S3 class design
with attributes attached.
In the data frame itself, the experimental factors are all stored as R factors.
For factors with 2 levels, contr.FrF2 contrasts (-1 / +1) are used.
For factors with more than 2 numerical levels, polynomial contrasts are used
(i.e. analyses will per default use orthogonal polynomials).
For factors with more than 2 categorical levels, the default contrasts are used.
Future versions will most likely allow more user control about the type of
contrasts to be used.
The desnum and run.order attributes of class design are
as usual. In the design.info attribute, the following elements are specific for
this type of designs:
type
is oa (unless no special orthogonal array is found, in which case
a full factorial is created instead, cf. fac.design for its design.info attribute),
nlevels
vector containing the number of levels for each factor
generating.oa
contains information on the generating orthogonal array,
selected.columns
contains information, which column of the orthogonal array underlies which factor,
origin
contains the respective attribute of the orthogonal array,
comment
contains the respective attribute of the orthogonal array,
residual.df
contains the requested residual degrees of freedom for a main effects model.
Other information is generic, like documented for class design.
Function origin returns the origin attribute of the orthogonal array ID,
functions comment and "comment<-" from package base
return and set the comment attribute.
Note
This package is currently under intensive development. Substantial changes are to be expected in the near future.
Author(s)
Ulrike Groemping
References
Groemping, U. (2011). Relative projection frequency tables for orthogonal arrays.
Report 1/2011, Reports in Mathematics, Physics and Chemistryhttp://www1.beuth-hochschule.de/FB_II/reports/welcome.htm,
Department II, Beuth University of Applied Sciences, Berlin.
Hedayat, A.S., Sloane, N.J.A. and Stufken, J. (1999) Orthogonal Arrays: Theory and Applications, Springer, New York.
Schoen, E. (2009). All orthogonal arrays with 18 runs. Quality and Reliability Engineering International25, 467–480.
Xu, H.-Q. and Wu, C.F.J. (2001). Generalized minimum aberration for asymmetrical
fractional factorial designs. Annals of Statistics29, 1066–1077.
See Also
See Also FrF2, fac.design, pb
Examples
## smallest available array for 6 factors with 3 levels each
oa.design(nfactors=6, nlevels=3)
## level combination for which only a full factorial is (currently) found
oa.design(nlevels=c(4,3,3,2))
## array requested via factor.names
oa.design(factor.names=list(one=c("a","b","c"), two=c(125,275),
three=c("old","new"), four=c(-1,1), five=c("min","medium","max")))
## array requested via character factor.names and nlevels
## (with a little German lesson for one two three four five)
oa.design(factor.names=c("eins","zwei","drei","vier","fuenf"), nlevels=c(2,2,2,3,7))
## array requested via explicit name, Taguchi L18
oa.design(ID=L18)
## array requested via explicit name, with column selection
oa.design(ID=L18.3.6.6.1,columns=c(2,3,7))
## array requested with nruns, not very reasonable
oa.design(nruns=12, nfactors=3, nlevels=2)
## array requested with min.residual.df
oa.design(nfactors=3, nlevels=2, min.residual.df=12)
## examples showing alias structures and their improvment with option columns
plan <- oa.design(nfactors=6,nlevels=3)
plan
## generalized word length pattern
length3(plan)
## length3 (first element of GWP) can be slightly improved by columns="min3"
plan <- oa.design(nfactors=6,nlevels=3,columns="min3")
summary(plan) ## the first 3-level column of the array is not used
length3(plan)
plan <- oa.design(nlevels=c(2,2,2,6))
length3(plan)
plan.opt <- oa.design(nlevels=c(2,2,2,6),columns="min3") ## substantial improvement
length3(plan.opt)
length4(plan.opt)
## visualize practical relevance of improvement:
## for optimal plan, all 3-dimensional projections are full factorials
plot(plan, select=1:3)
plot(plan, select=c(1,2,4))
plot(plan, select=c(1,3,4))
plot(plan, select=2:4)
plot(plan.opt, select=1:3)
plot(plan.opt, select=c(1,2,4))
plot(plan.opt, select=c(1,3,4))
plot(plan.opt, select=2:4)
## The last example:
## generate an orthogonal array equivalent to Taguchi's L18
## by combining L18.3.6.6.1 with a full factorial in 2 and 3 levels
show.oas(nruns=18, parents.only=FALSE)
## lineage entry leads the way:
## start from L18.3.6.6.1
## insert L6.2.1.3.1 for the 6 level factor
## prepare the parent
parent.des <- L18.3.6.6.1
colnames(parent.des) <- c(Letters[3:8], "comb")
## column comb will create the first two columns of the target design
## 6-level design can be created by fac.design or expand.grid
nest.des <- as.matrix(expand.grid(1:3,1:2))[c(1:3,5,6,4),c(2,1)]
## want first column to change most slowly
## want resulting design to be easily transformable into Taguchi L18
## see mathematical comments in section Details
colnames(nest.des) <- c("A","B")
## do the expansion (see mathematical comments in section Details)
L18.2.1.3.7.manual <- cbind(nest.des[parent.des[,"comb"],], parent.des)[,-9]
L18.2.1.3.7.manual <- L18.2.1.3.7.manual[ord(L18.2.1.3.7.manual),] ## sort array
rownames(L18.2.1.3.7.manual) <- 1:18
## (ordering is not necessary, just **tidy**)
## prepare for using it with function oa.design
attr(L18.2.1.3.7.manual, "origin") <-
c(show.oas(name="L18.2.1.3.7", parents.only=FALSE,show=0)$lineage,
"unconventional order")
class(L18.2.1.3.7.manual) <- c("oa", "matrix")
comment(L18.2.1.3.7.manual) <- "Interaction of first two factors estimable"
## indicates that first two factors are full factorial from 6-level factor
origin(L18.2.1.3.7.manual)
comment(L18.2.1.3.7.manual)
L18 ## Taguchi array
L18.2.1.3.7.manual ## manually expanded array
oa.design(L18.2.1.3.7, randomize=FALSE)
## automatically expanded array
P3.3(L18.2.1.3.7.manual) ## length 3 pattern of 3 factor projections
## this also identifies the array as isomorphic to L18
## according to Schoen 2009
## the array can now be used in oa.design, like the built-in arrays
oa.design(ID=L18.2.1.3.7.manual,nfactors=7,nlevels=3)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DoE.base)
Loading required package: grid
Loading required package: conf.design
Attaching package: 'DoE.base'
The following objects are masked from 'package:stats':
aov, lm
The following object is masked from 'package:graphics':
plot.design
The following object is masked from 'package:base':
lengths
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DoE.base/oa.design.Rd_%03d_medium.png", width=480, height=480)
> ### Name: oa.design
> ### Title: Function for accessing orthogonal arrays
> ### Aliases: oa.design origin oa
> ### Keywords: array design
>
> ### ** Examples
>
> ## smallest available array for 6 factors with 3 levels each
> oa.design(nfactors=6, nlevels=3)
The columns of the array have been used in order of appearance.
For designs with relatively few columns,
the properties can sometimes be substantially improved
using option columns with min3 or even min34.
A B C D E F
1 2 1 1 3 2 3
2 3 2 2 1 3 1
3 2 2 2 2 2 2
4 1 1 1 1 1 1
5 1 2 3 1 2 3
6 3 1 2 3 1 2
7 3 3 1 1 2 2
8 3 2 1 2 1 3
9 2 3 2 1 1 3
10 2 1 3 1 3 2
11 1 1 2 2 3 3
12 3 1 3 2 2 1
13 2 2 3 3 1 1
14 1 3 2 3 2 1
15 1 2 1 3 3 2
16 3 3 3 3 3 3
17 1 3 3 2 1 2
18 2 3 1 2 3 1
class=design, type= oa
> ## level combination for which only a full factorial is (currently) found
> oa.design(nlevels=c(4,3,3,2))
creating full factorial with 72 runs ...
A B C D
1 4 2 2 2
2 3 2 3 1
3 4 3 2 1
4 1 1 2 2
5 4 3 1 1
6 4 1 3 1
7 3 2 1 1
8 1 3 2 2
9 3 3 2 2
10 1 3 3 1
11 1 2 2 2
12 2 1 1 1
13 1 2 1 2
14 2 2 1 2
15 2 1 2 2
16 3 1 1 2
17 3 3 1 2
18 3 1 3 2
19 4 2 3 2
20 4 1 1 2
21 4 2 1 2
22 4 3 3 1
23 2 3 3 2
24 3 3 3 2
25 1 1 3 1
26 4 2 2 1
27 3 1 2 2
28 1 3 3 2
29 1 3 2 1
30 1 2 3 2
31 3 1 2 1
32 2 2 3 2
33 1 2 2 1
34 2 1 2 1
35 3 1 3 1
36 2 1 3 1
37 4 1 2 1
38 4 1 1 1
39 3 3 3 1
40 2 1 1 2
41 2 3 2 2
42 3 2 1 2
43 2 3 3 1
44 4 2 1 1
45 3 2 2 2
46 1 1 3 2
47 3 2 3 2
48 2 3 1 1
49 1 2 3 1
50 3 3 1 1
51 2 1 3 2
52 1 1 2 1
53 2 2 3 1
54 4 3 3 2
55 2 3 2 1
56 2 2 2 1
57 3 2 2 1
58 1 3 1 2
59 1 1 1 2
60 3 3 2 1
61 2 3 1 2
62 4 2 3 1
63 2 2 1 1
64 1 1 1 1
65 4 3 1 2
66 1 2 1 1
67 4 1 2 2
68 1 3 1 1
69 4 3 2 2
70 3 1 1 1
71 2 2 2 2
72 4 1 3 2
class=design, type= full factorial
> ## array requested via factor.names
> oa.design(factor.names=list(one=c("a","b","c"), two=c(125,275),
+ three=c("old","new"), four=c(-1,1), five=c("min","medium","max")))
The columns of the array have been used in order of appearance.
For designs with relatively few columns,
the properties can sometimes be substantially improved
using option columns with min3 or even min34.
one two three four five
1 b 275 old -1 medium
2 c 125 new 1 medium
3 c 125 old -1 min
4 a 275 old 1 max
5 b 125 old -1 medium
6 a 275 old -1 min
7 b 275 old 1 max
8 c 125 old 1 medium
9 c 275 old 1 max
10 a 125 old -1 max
11 b 125 new 1 max
12 b 125 old 1 min
13 c 275 new -1 medium
14 b 125 old -1 medium
15 a 275 new 1 medium
16 b 125 new 1 min
17 c 125 old -1 max
18 a 275 new -1 medium
19 b 125 new -1 max
20 a 125 old -1 min
21 a 275 new -1 max
22 c 275 new 1 min
23 a 125 new -1 medium
24 c 275 old -1 min
25 a 125 new 1 min
26 a 125 new 1 max
27 b 275 new -1 max
28 b 275 old 1 medium
29 b 275 new -1 min
30 a 125 old 1 min
31 c 275 new -1 min
32 c 275 old 1 max
33 c 125 new -1 max
34 a 275 old 1 medium
35 b 275 new 1 min
36 c 125 new 1 medium
class=design, type= oa
> ## array requested via character factor.names and nlevels
> ## (with a little German lesson for one two three four five)
> oa.design(factor.names=c("eins","zwei","drei","vier","fuenf"), nlevels=c(2,2,2,3,7))
The columns of the array have been used in order of appearance.
For designs with relatively few columns,
the properties can sometimes be substantially improved
using option columns with min3 or even min34.
eins zwei drei vier fuenf
1 2 2 2 2 7
2 1 2 2 1 6
3 1 2 2 1 2
4 2 1 1 3 2
5 2 1 1 1 7
6 2 2 1 3 2
7 1 1 2 3 3
8 2 1 2 2 4
9 1 1 1 3 7
10 1 2 2 1 7
11 1 2 2 3 1
12 1 1 1 3 4
13 2 2 2 3 6
14 1 2 1 2 3
15 2 1 1 2 6
16 2 2 1 2 1
17 1 2 2 3 3
18 2 2 1 3 4
19 1 1 1 1 5
20 1 1 1 1 2
21 1 1 2 2 4
22 1 2 2 2 7
23 2 1 2 1 7
24 2 1 1 1 3
25 1 2 2 1 2
26 1 1 1 2 1
27 1 1 1 1 6
28 1 2 2 1 4
29 2 2 1 3 5
30 2 1 2 3 7
31 2 1 1 3 4
32 1 1 1 3 7
33 2 1 2 3 6
34 1 1 2 2 2
35 2 2 2 3 1
36 2 2 2 1 1
37 2 2 1 3 4
38 1 2 1 2 1
39 1 2 2 3 5
40 2 2 1 1 6
41 1 1 2 1 5
42 1 2 1 3 6
43 2 2 1 2 5
44 2 1 2 1 2
45 2 2 1 3 2
46 2 1 2 2 1
47 2 1 2 2 3
48 2 1 2 2 2
49 2 2 2 2 4
50 1 1 2 3 1
51 1 1 2 3 1
52 1 2 1 1 3
53 1 2 2 3 5
54 1 1 2 3 3
55 2 2 2 3 3
56 1 1 1 2 5
57 2 2 1 3 7
58 2 2 1 1 6
59 1 1 1 3 2
60 2 1 2 2 5
61 2 1 2 2 6
62 1 2 1 2 5
63 2 1 1 1 1
64 2 2 2 1 3
65 2 2 2 1 5
66 1 2 2 1 4
67 1 2 1 2 4
68 2 1 2 1 4
69 2 2 1 2 7
70 1 2 1 1 7
71 2 1 1 1 1
72 2 1 1 3 5
73 1 1 2 2 7
74 1 1 2 3 6
75 1 2 2 2 6
76 2 2 2 2 2
77 1 1 1 2 6
78 2 2 1 2 3
79 1 1 1 1 4
80 2 1 2 1 5
81 1 1 1 2 3
82 2 1 1 1 3
83 1 2 1 2 2
84 1 2 1 1 1
class=design, type= oa
> ## array requested via explicit name, Taguchi L18
> oa.design(ID=L18)
A B C D E F G H
1 1 3 2 3 2 1 3 1
2 2 1 3 2 2 1 1 3
3 2 2 2 3 1 2 1 3
4 1 1 2 2 2 2 2 2
5 2 3 1 3 2 3 1 2
6 2 3 3 2 1 2 3 1
7 2 2 1 2 3 1 3 2
8 1 3 3 1 3 2 1 2
9 2 1 1 3 3 2 2 1
10 1 2 3 3 1 1 2 2
11 1 1 1 1 1 1 1 1
12 1 2 2 2 3 3 1 1
13 1 3 1 2 1 3 2 3
14 1 1 3 3 3 3 3 3
15 2 1 2 1 1 3 3 2
16 1 2 1 1 2 2 3 3
17 2 3 2 1 3 1 2 3
18 2 2 3 1 2 3 2 1
class=design, type= oa
> ## array requested via explicit name, with column selection
> oa.design(ID=L18.3.6.6.1,columns=c(2,3,7))
A B C
1 2 2 1
2 3 1 4
3 1 3 3
4 1 3 5
5 1 1 1
6 1 1 6
7 3 2 3
8 3 3 6
9 3 1 2
10 2 1 3
11 3 3 1
12 3 2 5
13 2 2 6
14 2 1 5
15 2 3 2
16 2 3 4
17 1 2 2
18 1 2 4
class=design, type= oa
> ## array requested with nruns, not very reasonable
> oa.design(nruns=12, nfactors=3, nlevels=2)
creating full factorial with 8 runs ...
A B C
1 2 1 1
2 2 2 1
3 1 1 2
4 2 1 2
5 1 2 2
6 2 2 2
7 1 2 1
8 1 1 1
class=design, type= full factorial
Warning message:
In oa.design(nruns = 12, nfactors = 3, nlevels = 2) :
You are requesting more runs than needed for a full factorial!
> ## array requested with min.residual.df
> oa.design(nfactors=3, nlevels=2, min.residual.df=12)
creating full factorial with 8 runs ...
run.no run.no.std.rp A B C
1 1 2.1 2 1 1
2 2 4.1 2 2 1
3 3 1.1 1 1 1
4 4 3.1 1 2 1
5 5 8.1 2 2 2
6 6 5.1 1 1 2
7 7 7.1 1 2 2
8 8 6.1 2 1 2
9 9 8.2 2 2 2
10 10 5.2 1 1 2
11 11 3.2 1 2 1
12 12 6.2 2 1 2
13 13 7.2 1 2 2
14 14 1.2 1 1 1
15 15 2.2 2 1 1
16 16 4.2 2 2 1
class=design, type= full factorial
NOTE: columns run.no and run.no.std.rp are annotation, not part of the data frame
>
> ## examples showing alias structures and their improvment with option columns
> plan <- oa.design(nfactors=6,nlevels=3)
The columns of the array have been used in order of appearance.
For designs with relatively few columns,
the properties can sometimes be substantially improved
using option columns with min3 or even min34.
> plan
A B C D E F
1 1 1 1 1 1 1
2 2 3 1 2 3 1
3 3 3 1 1 2 2
4 3 2 2 1 3 1
5 1 3 2 3 2 1
6 2 1 3 1 3 2
7 1 1 2 2 3 3
8 3 1 2 3 1 2
9 1 2 1 3 3 2
10 2 2 2 2 2 2
11 3 3 3 3 3 3
12 1 2 3 1 2 3
13 3 1 3 2 2 1
14 2 2 3 3 1 1
15 2 3 2 1 1 3
16 1 3 3 2 1 2
17 2 1 1 3 2 3
18 3 2 1 2 1 3
class=design, type= oa
> ## generalized word length pattern
> length3(plan)
[1] 10
> ## length3 (first element of GWP) can be slightly improved by columns="min3"
> plan <- oa.design(nfactors=6,nlevels=3,columns="min3")
> summary(plan) ## the first 3-level column of the array is not used
Call:
oa.design(nfactors = 6, nlevels = 3, columns = "min3")
Experimental design of type oa
18 runs
Factor settings (scale ends):
A B C D E F
1 1 1 1 1 1 1
2 2 2 2 2 2 2
3 3 3 3 3 3 3
Generating Orthogonal Array:
[1] L18.2.1.3.7
Selected Columns:
[1] 2 3 4 5 6 7
Numbers of generalized words of lengths 3 and 4:
3 4
10.0 22.5
The design itself:
A B C D E F
1 1 3 2 3 2 1
2 2 1 1 3 2 3
3 2 1 3 1 3 2
4 3 1 3 2 2 1
5 2 3 2 1 1 3
6 1 2 3 1 2 3
7 3 2 1 2 1 3
8 3 3 1 1 2 2
9 3 3 3 3 3 3
10 3 1 2 3 1 2
11 1 1 1 1 1 1
12 1 3 3 2 1 2
13 1 1 2 2 3 3
14 2 2 3 3 1 1
15 2 3 1 2 3 1
16 1 2 1 3 3 2
17 3 2 2 1 3 1
18 2 2 2 2 2 2
class=design, type= oa
> length3(plan)
[1] 10
> plan <- oa.design(nlevels=c(2,2,2,6))
The columns of the array have been used in order of appearance.
For designs with relatively few columns,
the properties can sometimes be substantially improved
using option columns with min3 or even min34.
> length3(plan)
[1] 1.666667
> plan.opt <- oa.design(nlevels=c(2,2,2,6),columns="min3") ## substantial improvement
> length3(plan.opt)
[1] 0
> length4(plan.opt)
[1] 1
> ## visualize practical relevance of improvement:
> ## for optimal plan, all 3-dimensional projections are full factorials
> plot(plan, select=1:3)
> plot(plan, select=c(1,2,4))
> plot(plan, select=c(1,3,4))
> plot(plan, select=2:4)
> plot(plan.opt, select=1:3)
> plot(plan.opt, select=c(1,2,4))
> plot(plan.opt, select=c(1,3,4))
> plot(plan.opt, select=2:4)
>
>
> ## The last example:
> ## generate an orthogonal array equivalent to Taguchi's L18
> ## by combining L18.3.6.6.1 with a full factorial in 2 and 3 levels
> show.oas(nruns=18, parents.only=FALSE)
3 arrays found
name nruns lineage
20 L18.2.1.3.7 18 3~6;6~1;:(6~1!2~1;3~1;)
21 L18.2.1.9.1 18
22 L18.3.6.6.1 18
> ## lineage entry leads the way:
> ## start from L18.3.6.6.1
> ## insert L6.2.1.3.1 for the 6 level factor
> ## prepare the parent
> parent.des <- L18.3.6.6.1
> colnames(parent.des) <- c(Letters[3:8], "comb")
> ## column comb will create the first two columns of the target design
> ## 6-level design can be created by fac.design or expand.grid
> nest.des <- as.matrix(expand.grid(1:3,1:2))[c(1:3,5,6,4),c(2,1)]
> ## want first column to change most slowly
> ## want resulting design to be easily transformable into Taguchi L18
> ## see mathematical comments in section Details
> colnames(nest.des) <- c("A","B")
> ## do the expansion (see mathematical comments in section Details)
> L18.2.1.3.7.manual <- cbind(nest.des[parent.des[,"comb"],], parent.des)[,-9]
> L18.2.1.3.7.manual <- L18.2.1.3.7.manual[ord(L18.2.1.3.7.manual),] ## sort array
> rownames(L18.2.1.3.7.manual) <- 1:18
> ## (ordering is not necessary, just **tidy**)
> ## prepare for using it with function oa.design
> attr(L18.2.1.3.7.manual, "origin") <-
+ c(show.oas(name="L18.2.1.3.7", parents.only=FALSE,show=0)$lineage,
+ "unconventional order")
> class(L18.2.1.3.7.manual) <- c("oa", "matrix")
> comment(L18.2.1.3.7.manual) <- "Interaction of first two factors estimable"
> ## indicates that first two factors are full factorial from 6-level factor
> origin(L18.2.1.3.7.manual)
[1] "3~6;6~1;:(6~1!2~1;3~1;)" "unconventional order"
> comment(L18.2.1.3.7.manual)
[1] "Interaction of first two factors estimable"
> L18 ## Taguchi array
A B C D E F G H
1 1 1 1 1 1 1 1 1
2 1 1 2 2 2 2 2 2
3 1 1 3 3 3 3 3 3
4 1 2 1 1 2 2 3 3
5 1 2 2 2 3 3 1 1
6 1 2 3 3 1 1 2 2
7 1 3 1 2 1 3 2 3
8 1 3 2 3 2 1 3 1
9 1 3 3 1 3 2 1 2
10 2 1 1 3 3 2 2 1
11 2 1 2 1 1 3 3 2
12 2 1 3 2 2 1 1 3
13 2 2 1 2 3 1 3 2
14 2 2 2 3 1 2 1 3
15 2 2 3 1 2 3 2 1
16 2 3 1 3 2 3 1 2
17 2 3 2 1 3 1 2 3
18 2 3 3 2 1 2 3 1
attr(,"origin")
[1] "Taguchi"
attr(,"class")
[1] "oa" "matrix"
> L18.2.1.3.7.manual ## manually expanded array
A B C D E F G H
1 1 1 1 1 1 1 1 1
2 1 1 2 2 2 2 2 2
3 1 1 3 3 3 3 3 3
4 1 2 1 1 2 2 3 3
5 1 2 2 2 3 3 1 1
6 1 2 3 3 1 1 2 2
7 1 3 1 2 1 3 3 2
8 1 3 2 3 2 1 1 3
9 1 3 3 1 3 2 2 1
10 2 1 1 3 3 2 1 2
11 2 1 2 1 1 3 2 3
12 2 1 3 2 2 1 3 1
13 2 2 1 2 3 1 2 3
14 2 2 2 3 1 2 3 1
15 2 2 3 1 2 3 1 2
16 2 3 1 3 2 3 2 1
17 2 3 2 1 3 1 3 2
18 2 3 3 2 1 2 1 3
attr(,"origin")
[1] "3~6;6~1;:(6~1!2~1;3~1;)" "unconventional order"
attr(,"class")
[1] "oa" "matrix"
> oa.design(L18.2.1.3.7, randomize=FALSE)
A B C D E F G H
1 1 1 1 1 1 1 1 1
2 1 1 1 2 2 3 3 2
3 1 1 2 1 3 3 2 3
4 1 2 2 2 2 2 2 1
5 1 2 2 3 3 1 1 2
6 1 2 3 2 1 1 3 3
7 1 3 1 3 2 2 1 3
8 1 3 3 1 1 2 2 2
9 1 3 3 3 3 3 3 1
10 2 1 2 3 1 2 3 1
11 2 1 3 2 3 2 1 2
12 2 1 3 3 2 1 2 3
13 2 2 1 1 3 2 3 3
14 2 2 1 3 1 3 2 2
15 2 2 3 1 2 3 1 1
16 2 3 1 2 3 1 2 1
17 2 3 2 1 2 1 3 2
18 2 3 2 2 1 3 1 3
class=design, type= oa
> ## automatically expanded array
> P3.3(L18.2.1.3.7.manual) ## length 3 pattern of 3 factor projections
length3 frequency
0.0000 12
0.5000 28
0.6667 9
1.0000 6
2.0000 1
attr(,"A3")
[1] 28
> ## this also identifies the array as isomorphic to L18
> ## according to Schoen 2009
> ## the array can now be used in oa.design, like the built-in arrays
> oa.design(ID=L18.2.1.3.7.manual,nfactors=7,nlevels=3)
The columns of the array have been used in order of appearance.
For designs with relatively few columns,
the properties can sometimes be substantially improved
using option columns with min3 or even min34.
A B C D E F G
1 2 1 2 3 1 2 3
2 1 3 3 3 3 3 3
3 2 3 3 1 1 2 2
4 3 3 1 3 2 2 1
5 1 1 1 1 1 1 1
6 1 2 2 2 2 2 2
7 3 1 2 1 3 3 2
8 1 1 3 3 2 1 2
9 3 3 2 1 2 1 3
10 3 2 1 3 1 3 2
11 2 3 1 2 3 1 2
12 2 2 3 1 2 3 1
13 2 2 2 3 3 1 1
14 1 3 2 2 1 3 1
15 3 1 3 2 3 2 1
16 1 2 1 1 3 2 3
17 2 1 1 2 2 3 3
18 3 2 3 2 1 1 3
class=design, type= oa
>
>
>
>
>
> dev.off()
null device
1
>