This vignette shows how to generate a row-column
Design using both the FielDHub Shiny App and the scripting
function row_column() from the FielDHub
package.
It randomly generates a resolvable row-column design.The design is optimized in both rows and columns blocking factors. The randomization can be done across multiple locations.
row_column() optimizes both the row and the column
blocking factors, and the strategy is selected with the
method argument. By default
(method = "onestage") the rows and columns are optimized
jointly by FielDHub’s block engine, in a staged search: a first
search on the rows and columns, the repair of a singular joint model and
a joint row-by-column search. The alternative,
method = "twostage", builds the design in two stages. The
first step constructs the blocking factor Columns using
Incomplete Block Units from an incomplete block design that sets the
number of incomplete blocks as the number of Columns in the
design, each of which has a dimension equal to the number of
Rows. Once this design is generated, the Rows
are used as the Row blocking factor, which is optimized
while the Columns are kept fixed. To do so, FielDHub’s
block engine treats the rows of each replicate as incomplete blocks and
searches over swaps of two plots of the same Column in
different Rows, so every column keeps its treatments.
Starting from the column design, it accepts swaps that improve the row
blocks’ D-criterion until no single swap improves it, then tries a few
random escapes from that local optimum. For
method = "twostage" the iterations argument
sets the effort of this row search: the default, 1000, is the full
search, and a smaller value stops it earlier.
Earlier versions of FielDHub improved the rows with random greedy
swaps instead, so a seeded method = "twostage" layout
differs from the one those versions produced for the same seed (see the
changelog).
To generate a Row-Column Design using the FielDHub app:
First, go to Other Designs > Resolvable Row-Column Design (RRCD)
Then, follow the following steps where we will show how to generate a Row-Column Design with 45 treatments, 5 rows and 3 reps.
If the selection is No, that means the app is going
to generate synthetic data for entries and names of the treatment based
on the user inputs.
If the selection is Yes, the entries list must
fulfill a specific format and must be a .csv file. The file
must have the columns ENTRY and NAME. The
ENTRY column must have a unique entry integer number for
each treatment. The column NAME must have a unique name
that identifies each treatment. Both ENTRY and
NAME must be unique, duplicates are not allowed. In the
following table, we show an example of the entries list format. This
example has an entry list with 12 treatments.
| ENTRY | NAME |
|---|---|
| 1 | GenotypeA |
| 2 | GenotypeB |
| 3 | GenotypeC |
| 4 | GenotypeD |
| 5 | GenotypeE |
| 6 | GenotypeF |
| 7 | GenotypeG |
| 8 | GenotypeH |
| 9 | GenotypeI |
| 10 | GenotypeJ |
| 11 | GenotypeK |
| 12 | GenotypeL |
Input the number of treatments in the Input # of
Treatments box. We will enter 45 for our sample
experiment.
Set the number of plots in each incomplete block with the
Input # of Plots per IBlock box. In this examples, set
it to 5.
Select the number of replications of these treatments with the
Input # of Full Reps box. In this examples, set it to
3.
Enter the number of locations in Input # of
Locations. We will run this experiment over a single location,
so set it to 1.
Select serpentine or cartesian in the
Plot Order Layout. For this example we will use the
default serpentine layout.
Enter the starting plot number in the Starting Plot
Number box. If the experiment has multiple locations, you must
enter a comma separated list of numbers the length of the number of
locations for the input to be valid. Set it to
101.
Enter a name for the location of the experiment in the
Input Location box. If there are multiple locations,
each name must be in a comma separated list. For this example, set it to
"FARGO".
To ensure that randomizations are consistent across sessions, we
can set a random seed in the box labeled random seed.
In this example, we will set it to 1244.
Once we have entered the information for our experiment on the left side panel, click the Run! button to run the design.
After you run a row-column design in FielDHub, there are several ways to display the information contained in the field book.
When you first click the run button on a row-column design, FielDHub
displays the Field Layout tab, which shows the entries and their
arrangement in the field. In the box below the display, you can change
the layout of the field. You can also display a heatmap over the field
by changing Type of Plot to Heatmap. To
view a heatmap, you must first simulate an experiment over the described
field with the Simulate! button. A pop-up window will
appear where you can choose the trait to simulate and enter its mean and
plot-error (residual) standard deviation (SD). The simulated values
include the treatment and design effects of the layout.
The Field Book displays all the information on the experimental design in a table format. It contains the specific plot number and the row and column address of each entry, as well as the corresponding treatment on that plot. This table is searchable, and we can filter the data in relevant columns. If we have simulated data for a heatmap, an additional column for that variable appears in the field book.
FielDHub function:
row_column()You can run the same design with a function in the FielDHub package,
row_column().
First, you need to load the FielDHub package by
typing
Then, you can enter the information describing the above design like this:
rcd <- row_column(
t = 45,
nrows = 5,
reps = 3,
l = 1,
plotNumber = 101,
locationNames = "FARGO",
iterations = 20,
seed = 1244
)row_column()
aboveThe description for the inputs that we used to generate the design,
t = 45 is the number of treatments.nrows = 5 is the number of rows.reps =3 is the number of repsl = 1 is the number of locations.plotNumber = 101 is the starting plot number.locationNames = "FARGO" is an optional name for each
location.seed = 1244 is the random seed to replicate identical
randomizations.rcd objectTo print a summary of the information that is in the object
rcd, we can use the generic function
print().
Resolvable Row-Column Design (One-Step Optimization)
Efficiency of design:
Level Blocks D-Efficiency A-Efficiency A-Bound
1 Rep 3 1.0000000 1.0000000 1.0000000
2 Row 15 0.8945848 0.8781404 0.8786820
3 Column 27 0.7902310 0.7588682 0.7674419
4 Row-by-Column NA 0.7017133 0.6754216 NA
Information on the design parameters:
List of 9
$ rows : num 5
$ columns : num 9
$ reps : num 3
$ treatments : num 45
$ locations : num 1
$ location_names: chr "FARGO"
$ seed : num 1244
$ optimization : chr "onestage"
$ joint_searches:List of 2
..$ requested: int 1
..$ completed: int 1
10 First observations of the data frame with the row_column field book:
ID LOCATION PLOT REP ROW COLUMN ENTRY TREATMENT
1 1 FARGO 101 1 1 1 6 G-6
2 2 FARGO 102 1 1 2 33 G-33
3 3 FARGO 103 1 1 3 45 G-45
4 4 FARGO 104 1 1 4 34 G-34
5 5 FARGO 105 1 1 5 29 G-29
6 6 FARGO 106 1 1 6 12 G-12
7 7 FARGO 107 1 1 7 18 G-18
8 8 FARGO 108 1 1 8 2 G-2
9 9 FARGO 109 1 1 9 9 G-9
10 10 FARGO 110 1 2 1 42 G-42
rcd objectThe row_column() function returns a list consisting of
all the information displayed in the output tabs in the FielDHub app:
design information, plot layout, plot numbering, entries list, and field
book. These are accessible by the $ operator,
i.e. rcd$layoutRandom or rcd$fieldBook.
rcd$fieldBook is a list containing information about
every plot in the field, with information about the location of the plot
and the treatment in each plot. As seen in the output below, the field
book has columns for ID, LOCATION,
PLOT, REP, ROW,
COLUMN, ENTRY, and TREATMENT.
ID LOCATION PLOT REP ROW COLUMN ENTRY TREATMENT
1 1 FARGO 101 1 1 1 6 G-6
2 2 FARGO 102 1 1 2 33 G-33
3 3 FARGO 103 1 1 3 45 G-45
4 4 FARGO 104 1 1 4 34 G-34
5 5 FARGO 105 1 1 5 29 G-29
6 6 FARGO 106 1 1 6 12 G-12
7 7 FARGO 107 1 1 7 18 G-18
8 8 FARGO 108 1 1 8 2 G-2
9 9 FARGO 109 1 1 9 9 G-9
10 10 FARGO 110 1 2 1 42 G-42
By default, row_column() optimizes the rows and columns
jointly in a single step with FielDHub’s block engine
(method = "onestage"); the iterations argument
is then the effort of the joint stage: it sets the number of joint
searches requested, which is 10 at the default of 200 and scales with
iterations (infoDesign$joint_searches reports
the number requested and the number completed), and a small value
already captures most of the gain. The alternative
method = "twostage" constructs the columns first and then
improves the rows with FielDHub’s block engine while the columns are
kept fixed. There, iterations is the effort of the row
search, and the example below leaves it at its default of 1000, the full
search. Seeded two-stage layouts differ from those of earlier versions
of FielDHub, which improved the rows with random greedy swaps.
The per-factor (marginal) Row and Column
A-Efficiencies reported by both methods are usually already close to
optimal and change little between the methods. The advantage of
method = "onestage" shows up in the joint
row-by-column A-Efficiency of the standard resolvable row-column
analysis model, which the efficiency report now includes as the
Row-by-Column row of blocksModel. The default
one-stage design above reports:
rcd$blocksModel[[1]]
Level Blocks D-Efficiency A-Efficiency A-Bound
1 Rep 3 1.0000000 1.0000000 1.0000000
2 Row 15 0.8945848 0.8781404 0.8786820
3 Column 27 0.7902310 0.7588682 0.7674419
4 Row-by-Column NA 0.7017133 0.6754216 NAwhile the two-stage method typically reports a lower joint
Row-by-Column A-Efficiency:
rcd_twostage <- row_column(
t = 45,
nrows = 5,
reps = 3,
l = 1,
plotNumber = 101,
locationNames = "FARGO",
method = "twostage",
seed = 1244
)
rcd_twostage$blocksModel[[1]]
Level Blocks D-Efficiency A-Efficiency A-Bound
1 Rep 3 1.0000000 1.0000000 1.0000000
2 Row 15 0.8945707 0.8780855 0.8786820
3 Column 27 0.7912445 0.7624614 0.7674419
4 Row-by-Column NA 0.6863780 0.6410511 NASetting latinize = TRUE (only available with
method = "onestage") optimizes the rows and columns as
crossed factors that are shared across the replicates, so that a
treatment tends to occupy different rows and different columns in the
different replicates. This is useful when a field trend runs along the
rows or columns across the whole trial rather than within individual
replicates.
rcd_latinized <- row_column(
t = 45,
nrows = 5,
reps = 3,
l = 1,
plotNumber = 101,
locationNames = "FARGO",
iterations = 20,
method = "onestage",
latinize = TRUE,
seed = 1244
)
rcd_latinized$blocksModel[[1]]
Level Blocks D-Efficiency A-Efficiency A-Bound
1 Rep 3 1.0000000 1.0000000 1.0000000
2 Row 5 0.9835497 0.9821140 0.9821188
3 Column 9 0.9489121 0.9425429 0.9426167
4 Row-by-Column NA 0.9332468 0.9265080 NABecause a latinized design optimizes the rows and columns as crossed
factors shared across the replicates, its Row-by-Column
efficiency is computed on that crossed model and is therefore not
directly comparable with the nested-model efficiencies reported
above.