Package {DiallelAnalysisR}


Type: Package
Title: Diallel Analysis, Heterosis and Related Mating Designs
Version: 1.0.0
Date: 2026-11-03
Description: Analysis of diallel crosses and related mating designs in plant breeding, from the plot data of randomized complete block experiments: Griffing's four methods and two models (Griffing, 1956 <doi:10.1071/BI9560463>), from plot data, from a published table of means or over several environments, with gca by environment and sca by environment interactions and a split of reciprocal effects into maternal and non-maternal parts (Cockerham and Weir, 1977); Hayman's analysis with the Wr-Vr graph and the components of variation (Hayman, 1954 <doi:10.1093/genetics/39.6.789>); mid-parent, better-parent and standard heterosis with t tests; Gardner and Eberhart's (1966) Analyses II and III; the partial diallel (Kempthorne and Curnow, 1961 <doi:10.2307/2527989>); line by tester analysis with proportional contributions; and the North Carolina designs I, II and III (Comstock and Robinson, 1948). Missing plots are handled by least-squares means. Results include analyses of variance, effects with standard errors, variance components and genetic ratios, plots of the effects and a biplot of the crosses, tables for papers in Word, LaTeX, HTML or Markdown, simulation of diallel data and the power of the tests for planning the number of replicates, and an interactive 'shiny' application.
License: GPL-2 | GPL-3
URL: https://myaseen208.com/DiallelAnalysisR/, https://github.com/myaseen208/DiallelAnalysisR
BugReports: https://github.com/myaseen208/DiallelAnalysisR/issues
Encoding: UTF-8
Language: en-US
LazyData: true
Depends: R (≥ 4.2)
Imports: data.table, ggplot2, scales, stats, utils
Suggests: bench, bslib, flextable, knitr, officer, pkgload, quarto, R.rsp, shiny, svglite, testthat (≥ 3.0.0), withr
VignetteBuilder: quarto, R.rsp
Config/Needs/website: pkgdown (>= 2.1.0)
Config/testthat/edition: 3
Config/skill/prefix: da
Config/roxygen2/version: 8.1.1
NeedsCompilation: no
Packaged: 2026-11-04 01:22:33 UTC; myaseen208
Author: Muhammad Yaseen ORCID iD [aut, cre, cph], Kent Eskridge [aut, ctb], Pedro Barbosa [aut, ctb], Yuhang Guo [aut, ctb]
Maintainer: Muhammad Yaseen <myaseen208@gmail.com>
Repository: CRAN
Date/Publication: 2026-11-06 14:30:16 UTC

DiallelAnalysisR: Diallel Analysis, Heterosis and Related Mating Designs

Description

DiallelAnalysisR analyses diallel crosses of plant-breeding experiments laid out in randomized complete blocks: Griffing's (1956) four methods and two models, Hayman's (1954) analysis with the W_r-V_r graph and the components of variation, the partial diallel between two groups of parents, heterosis, Gardner and Eberhart's models, line by tester and North Carolina designs, diallels over environments, simulation and planning, tables for papers and an interactive application.

Details

Functions.

Every analysis returns the named list documented on its help page, with a class and the methods print, summary, plot and as.data.table; see da-methods. Utilities: da_theme, da_save, da_notation, da_reference.

Data. GriffingData1 (complete diallel of eight parents), its subsets GriffingData2, GriffingData3, GriffingData4 for Methods 2 to 4, HaymanData, PartialDiallelData (ten by four parents), Griffing56 (Griffing's 1956 maize example), LineTesterData and NCData.

Vignettes. Start with vignette("DiallelAnalysisR_01_getting_started", package = "DiallelAnalysisR"); browseVignettes("DiallelAnalysisR") lists all of them, each as HTML and as PDF.

Notation

Scalars are upper-case letters in normal face, indices lower-case italic, vectors lower-case bold and matrices upper-case bold; elements of vectors and matrices keep their letter in normal face. The full table is da_notation().

P, B number of parents, number of replicates (blocks)
i, j female and male parent of a cross
\mathbf{Y}, Y_{ij} matrix of cell means, mean of cross i \times j
\mathbf{g}, g_i vector of gca effects, gca effect of parent i
\mathbf{S}, \mathbf{R} matrices of sca and reciprocal effects
\sigma^2_g, \sigma^2_s, \sigma^2_r variances of gca, sca and reciprocal effects (random model)
MS_E, \sigma^2_m error mean square, error variance of a cell mean
V_r, W_r variance of array r, its covariance with the parents
D, H_1, H_2, F Hayman's components of variation

Author(s)

Muhammad Yaseen (myaseen208@gmail.com), ORCID 0000-0002-5923-1714; Kent M. Eskridge; Pedro A. M. Barbosa; Yuhang Guo.

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

Hayman, B. I. (1954). The theory and analysis of diallel crosses. Genetics, 39(6), 789–809. doi:10.1093/genetics/39.6.789

Hayman, B. I. (1954). The analysis of variance of diallel tables. Biometrics, 10(2), 235–244. doi:10.2307/3001877

Kempthorne, O. and Curnow, R. N. (1961). The partial diallel cross. Biometrics, 17(2), 229–250. doi:10.2307/2527989

Singh, R. K. and Chaudhary, B. D. (2004). Biometrical Methods in Quantitative Genetic Analysis. Kalyani Publishers, New Delhi.

See Also

da-methods, da_notation


Interactive analysis in a web browser

Description

DiallelApp() starts a Shiny application for the analyses of the package: choose an example data set or upload a CSV file (one row per plot), pick the analysis and its columns, and get the printed results, the main tables, the plots, the tables for a paper (Word, LaTeX, HTML or Markdown, through da_export) and the R code that repeats the analysis.

Usage

DiallelApp(launch.browser = interactive(), ...)

Arguments

launch.browser

passed to shiny::runApp(): TRUE (default in an interactive session) opens the application in the web browser.

...

further arguments to shiny::runApp(), such as port.

Details

The application needs the packages shiny and bslib (and officer and flextable for Word tables). It covers Griffing, GriffingEnv, Heterosis, Hayman, GardnerEberhart, PartialDiallel, LineTester and NCDesign.

Value

Called for its side effect; returns the value of shiny::runApp() when the application is closed.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

See Also

da_export

Examples

if (interactive()) {
  DiallelApp(
      launch.browser = TRUE
    )
}

Power of the combining-ability tests for planning a diallel

Description

DiallelPower() estimates by simulation the power of Griffing's F tests of gca, sca and reciprocal effects for numbers of replicates, so that the size of a diallel experiment can be planned.

Usage

DiallelPower(
  Parents,
  Method,
  Rep,
  Model = 1,
  gca,
  sca,
  rec = 0,
  Error,
  nsim = 500,
  alpha = 0.05,
  seed = NULL
)

## S3 method for class 'da_power'
plot(x, ...)

Arguments

Parents

number of parents P \geq 3.

Method

Griffing's method, 1 to 4: which crosses are grown.

Rep

vector of numbers of replicates to compare.

Model

1 (fixed effects) or 2 (random effects): which tests.

gca, sca, rec

standard deviations of the gca, sca and reciprocal effects.

Error

standard deviation of the plot errors \sigma.

nsim

number of simulated data sets for each number of replicates (default 500).

alpha

level of the tests (default 0.05).

seed

seed of the random numbers, or NULL (default) to leave the generator as it is.

x

a da_power object.

...

unused.

Details

For every number of replicates in Rep, nsim data sets are drawn with DiallelSim and analysed with Griffing's closed forms; the power is the share of data sets whose test is significant at level alpha, with its Monte Carlo standard error \sqrt{\hat{p}(1 - \hat{p})/n_{sim}}. The tests are those of Model: in Model 1 every line against the error, in Model 2 gca against sca. The block effects do not change the tests and are left out.

Value

A data.table of class c("da_power", ...): columns Rep, Source (gca, sca, reciprocals), Power and SE; plot() draws the power curves.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

See Also

DiallelSim, Griffing

Other DiallelAnalysisR planning: DiallelSim()

Examples

pw <-
  DiallelPower(
      Parents = 6
    , Method  = 2
    , Rep     = 2:4
    , Model   = 1
    , gca     = 1
    , sca     = 1.5
    , rec     = 0
    , Error   = 4
    , nsim    = 100
    , alpha   = 0.05
    , seed    = 1
    )
pw
plot(pw)

Simulate diallel data

Description

DiallelSim() simulates plot data of a diallel in randomized complete blocks, in one or several environments, from Griffing's model with random effects. It serves teaching (data with known effects) and the planning of experiments (see DiallelPower).

Usage

DiallelSim(
  Parents,
  Method,
  Rep,
  Env = 1,
  Mean = 0,
  gca,
  sca,
  rec = 0,
  gcaEnv = 0,
  scaEnv = 0,
  EnvSD = 0,
  Block = 0,
  Error,
  seed = NULL
)

Arguments

Parents

number of parents P \geq 3.

Method

Griffing's method, 1 to 4: which crosses are grown.

Rep

number of replicates (blocks) per environment.

Env

number of environments (default 1; the column Env is added when it is larger).

Mean

overall mean \mu.

gca, sca, rec

standard deviations of the gca, sca and reciprocal effects.

gcaEnv, scaEnv

standard deviations of the gca \times environment and sca \times environment effects (default 0).

EnvSD

standard deviation of the environment effects (default 0).

Block

standard deviation of the block effects (default 0).

Error

standard deviation of the plot errors \sigma.

seed

seed of the random numbers, or NULL (default) to leave the generator as it is.

Details

The response of the plot of cross i \times j in block k of environment e is

y_{ijke} = \mu + g_i + g_j + s_{ij} + r_{ij} + \eta_e + (gE)_{ie} + (gE)_{je} + (sE)_{ije} + b_{ke} + \varepsilon_{ijke},

with independent normal effects of standard deviations gca, sca (s_{ij} = s_{ji}), rec (r_{ij} = -r_{ji}, Methods 1 and 3), gcaEnv, scaEnv, Block and Error; environment effects \eta_e have standard deviation EnvSD. The gca, environment and block effects are centred to sum to zero and the sca effects to zero row and column sums over the full P \times P table (Griffing's constraints of Methods 1 and 2). The true effects are returned as the attribute "truth".

Value

A data.frame with columns Cross1, Cross2, Rep, y (and Env), with the attribute "truth": a list with gca (vector), sca and rec (matrices) and Mean.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

See Also

DiallelPower, Griffing, GriffingEnv

Other DiallelAnalysisR planning: DiallelPower()

Examples

d <-
  DiallelSim(
      Parents = 6
    , Method  = 1
    , Rep     = 3
    , Env     = 1
    , Mean    = 100
    , gca     = 5
    , sca     = 3
    , rec     = 1
    , gcaEnv  = 0
    , scaEnv  = 0
    , EnvSD   = 0
    , Block   = 2
    , Error   = 4
    , seed    = 123
    )
head(d)
attr(x = d, which = "truth")$gca
fit <-
  Griffing(
      y          = y
    , Rep        = Rep
    , Cross1     = Cross1
    , Cross2     = Cross2
    , data       = d
    , Method     = 1
    , Model      = 1
    , Reciprocal = c("combined", "split")[1]
    )
cbind(true = attr(x = d, which = "truth")$gca, estimated = fit$GCA)

Gardner and Eberhart's Analyses II and III of a diallel with parents

Description

GardnerEberhart() analyses parents and one set of F_1 crosses (Griffing's Method 2 design) with the genetic models of Gardner and Eberhart (1966): Analysis II splits the entries into variety effects and heterosis (average, variety and specific heterosis); Analysis III into variety effects, average heterosis and the general and specific combining ability of the crosses.

Usage

GardnerEberhart(y, Rep, Cross1, Cross2, data, Analysis = 2, Model = 1)

Arguments

y

response: a column of data given by name (y = Yield or y = "Yield") or a numeric vector of length nrow(data).

Rep

replicate (block): a column of data or a vector, as for y.

Cross1

female parent of each plot: a column of data or a vector, as for y.

Cross2

male parent of each plot: a column of data or a vector, as for y.

data

a data frame (or data.table) with one row per plot.

Analysis

2 (Analysis II, default) or 3 (Analysis III).

Model

1 (fixed effects, default) or 2 (random effects; changes only the tests).

Details

Let \bar{y}_{jj} be the mean of parent (variety) j and \bar{y}_{jj'} that of the cross j \times j', j < j', with P parents.

Analysis II.

\bar{y}_{jj} = \mu_v + v_j, \qquad \bar{y}_{jj'} = \mu_v + \frac{v_j + v_{j'}}{2} + \bar{h} + h_j + h_{j'} + s_{jj'},

with \sum_j v_j = \sum_j h_j = 0 and \sum_{j' \neq j} s_{jj'} = 0. The entries' sum of squares (P(P + 1)/2 - 1 degrees of freedom) is split sequentially into varieties (P - 1) and heterosis, the latter into average heterosis (1), variety heterosis (P - 1) and specific heterosis (P(P - 3)/2).

Analysis III.

\bar{y}_{jj} = \mu_v + v_j, \qquad \bar{y}_{jj'} = \mu_v + \bar{h} + g_j + g_{j'} + s_{jj'},

with \sum_j g_j = 0: varieties (P - 1), varieties against crosses (average heterosis, 1), general combining ability of the crosses (P - 1) and specific combining ability (P(P - 3)/2); the last two are Griffing's Method 4 analysis of the crosses.

The sums of squares are on the scale of entry means; the error is MS_E/B on the error degrees of freedom of the block analysis (least-squares entry means and the harmonic mean of the plot numbers when plots are missing). With Model = 1 every line is tested against the error; with Model = 2 the variety and heterosis lines (Analysis II) or the gca line (Analysis III) are tested against the specific line. Standard errors of the effects come from the least-squares fit, \mathrm{Var}(\hat{\boldsymbol{\beta}}) = (\mathbf{X}^{\top}\mathbf{X})^{-1}MS_E/B.

Value

An object of class c("da_gardner", "da_result", "list"):

Means

matrix of entry means (parents on the diagonal, crosses above it).

ANOVA

analysis of variance of the entries (class anova).

Effects

data.table of the effects of each parent with standard errors: Analysis II v and h; Analysis III v and g.

Average

data frame: \hat{\mu}_v and \hat{\bar{h}} with standard errors.

Specific

symmetric matrix of the specific effects \hat{s}_{jj'}.

RCBD

analysis of variance of the plot data.

Methods: print(), summary(), plot() (which = c("effects", "specific", "residuals", "qq")), data.table::as.data.table(x, component =), da_export.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

References

Gardner, C. O. and Eberhart, S. A. (1966). Analysis and interpretation of the variety cross diallel and related populations. Biometrics, 22(3), 439–452. doi:10.2307/2528181

Murray, L. W., Ray, I. M., Dong, H. and Segovia-Lerma, A. (2003). Clarification and reevaluation of population-based diallel analyses: Gardner and Eberhart Analyses II and III revisited. Crop Science, 43(6), 1930–1937. doi:10.2135/cropsci2003.1930

See Also

Griffing, Heterosis

Other DiallelAnalysisR analyses: Griffing(), GriffingEnv(), GriffingMeans(), Hayman(), Heterosis(), LineTester(), NCDesign(), PartialDiallel()

Examples

#-------------------------------------------------------------
## Analysis II: varieties and heterosis
#-------------------------------------------------------------
ge2 <-
  GardnerEberhart(
      y        = Yield
    , Rep      = Rep
    , Cross1   = Cross1
    , Cross2   = Cross2
    , data     = GriffingData2
    , Analysis = 2
    , Model    = 1
    )
ge2
ge2$Effects
plot(x = ge2, which = c("effects", "specific", "residuals", "qq")[1])

#-------------------------------------------------------------
## Analysis III: varieties, average heterosis, gca and sca
#-------------------------------------------------------------
ge3 <-
  GardnerEberhart(
      y        = Yield
    , Rep      = Rep
    , Cross1   = Cross1
    , Cross2   = Cross2
    , data     = GriffingData2
    , Analysis = 3
    , Model    = 1
    )
ge3$ANOVA

Diallel analysis by Griffing's methods

Description

Griffing() performs the combining-ability analysis of a diallel cross by the four methods and two models of Griffing (1956): the analysis of variance of general combining ability (gca), specific combining ability (sca) and reciprocal effects, the estimates of the effects with their standard errors (fixed model) or the variance components (random model), from the plot data of a randomized complete block experiment.

Usage

Griffing(
  y,
  Rep,
  Cross1,
  Cross2,
  data,
  Method,
  Model,
  Reciprocal = c("combined", "split")
)

Arguments

y

response: a column of data given by name (y = Yield or y = "Yield") or a numeric vector of length nrow(data).

Rep

replicate (block): a column of data or a vector, as for y.

Cross1

female parent of each plot: a column of data or a vector, as for y.

Cross2

male parent of each plot: a column of data or a vector, as for y.

data

a data frame (or data.table) with one row per plot.

Method

1 (parents, F_1 and reciprocals), 2 (parents and one set of F_1), 3 (F_1 and reciprocals) or 4 (one set of F_1). No default.

Model

1 (fixed effects) or 2 (random effects). No default.

Reciprocal

"combined" (default; one line for the reciprocal effects, as in earlier versions) or "split": in Methods 1 and 3 the reciprocal line is split into maternal and non-maternal parts (Cockerham and Weir 1977); see Details. Ignored in Methods 2 and 4.

Details

Data and cell means. Each plot belongs to a cross i \times j of parents i (female, Cross1) and j (male, Cross2) and to a replicate (block). With P parents and B replicates, the cell means form the P \times P matrix \mathbf{Y} with elements Y_{ij}; Y_{i\cdot}, Y_{\cdot j} and Y_{\cdot\cdot} are its row, column and grand totals. The four methods differ in the cells present:

Method 1 parents, F_1 and reciprocal F_1: all P^2 cells
Method 2 parents and one set of F_1: P(P+1)/2 cells
Method 3 F_1 and reciprocals, no parents: P(P-1) cells
Method 4 one set of F_1 only: P(P-1)/2 cells

In Methods 2 and 4 a cross may be recorded either way round (Cross1 = 3, Cross2 = 5 or the reverse); it is stored with the lower-numbered parent first. Every cross of the method must be present; individual plots may be missing. With missing plots the cell means are the least-squares means of the block analysis (block effects summing to zero), which removes the bias a missing plot in a good or a poor block would cause, and B in the error variance of a cell mean is the harmonic mean of the numbers of plots per cross (exact when every cross has the same number of plots, an approximation otherwise).

Model. The mean of cross i \times j is

Y_{ij} = \mu + g_i + g_j + S_{ij} + R_{ij} + \bar{e}_{ij},

with gca effects \mathbf{g} = (g_1, \ldots, g_P)^\top, symmetric sca effects S_{ij} = S_{ji} and reciprocal effects R_{ij} = -R_{ji} (Methods 1 and 3 only), and an error of variance \sigma^2/B. In the fixed model (Model = 1) the effects are constants with \sum_i g_i = 0 and the sca and reciprocal effects summing to zero over each array; in the random model (Model = 2) they are independent random variables with variances \sigma^2_g, \sigma^2_s and \sigma^2_r.

Error mean square. The plot data are analysed as a randomized complete block design with the crosses as treatments; MS_E is its residual mean square on f_E degrees of freedom. The error line of the combining-ability table is on the scale of a cell mean: sum of squares SS_E/B, mean square \sigma^2_m = MS_E/B.

Sums of squares (Griffing 1956; Singh and Chaudhary 2004), on the scale of cell means. Method 1:

SS_g = \frac{1}{2P}\sum_i (Y_{i\cdot} + Y_{\cdot i})^2 - \frac{2}{P^2}Y_{\cdot\cdot}^2, \quad SS_s = \frac{1}{2}\sum_i\sum_j Y_{ij}(Y_{ij} + Y_{ji}) - \frac{1}{2P}\sum_i (Y_{i\cdot} + Y_{\cdot i})^2 + \frac{1}{P^2}Y_{\cdot\cdot}^2, \quad SS_r = \frac{1}{2}\sum_{i<j} (Y_{ij} - Y_{ji})^2,

on P-1, P(P-1)/2 and P(P-1)/2 degrees of freedom. Method 2 (totals over the symmetric table, each cross counted once in each of its two arrays):

SS_g = \frac{1}{P+2}\left[\sum_i (Y_{i\cdot} + Y_{ii})^2 - \frac{4}{P}Y_{\cdot\cdot}^2\right], \quad SS_s = \sum_{i \le j} Y_{ij}^2 - \frac{1}{P+2}\sum_i (Y_{i\cdot} + Y_{ii})^2 + \frac{2}{(P+1)(P+2)}Y_{\cdot\cdot}^2,

on P-1 and P(P-1)/2 degrees of freedom. Method 3: SS_g = \sum_i (Y_{i\cdot} + Y_{\cdot i})^2/(2(P-2)) - 2Y_{\cdot\cdot}^2/(P(P-2)), SS_s = \frac{1}{2}\sum_{i<j}(Y_{ij}+Y_{ji})^2 - \sum_i (Y_{i\cdot} + Y_{\cdot i})^2/(2(P-2)) + Y_{\cdot\cdot}^2/((P-1)(P-2)) on P(P-3)/2 degrees of freedom, SS_r as in Method 1. Method 4: SS_g = \sum_i Y_{i\cdot}^2/(P-2) - 4Y_{\cdot\cdot}^2/(P(P-2)), SS_s = \sum_{i<j} Y_{ij}^2 - \sum_i Y_{i\cdot}^2/(P-2) + 2Y_{\cdot\cdot}^2/((P-1)(P-2)). These are the sums of squares of the orthogonal least-squares decomposition of the cell means into the gca, sca and reciprocal subspaces, which is how they are computed (one computation for the four methods; the closed forms above are the result).

Tests. Fixed model: every line against \sigma^2_m. Random model: gca against sca, sca and reciprocals against \sigma^2_m.

Effects (fixed model). Method 1: \hat{g}_i = (Y_{i\cdot} + Y_{\cdot i})/(2P) - Y_{\cdot\cdot}/P^2, \hat{S}_{ij} = (Y_{ij} + Y_{ji})/2 - (Y_{i\cdot} + Y_{\cdot i} + Y_{j\cdot} + Y_{\cdot j})/(2P) + Y_{\cdot\cdot}/P^2, \hat{R}_{ij} = (Y_{ij} - Y_{ji})/2; Methods 2 to 4 analogously (Griffing 1956). The standard errors of the effects and of their differences are \sqrt{\mathrm{Var}} of these linear functions of the cell means with \sigma^2 replaced by MS_E; for Method 1 for example \mathrm{Var}(\hat{g}_i) = (P-1)\sigma^2_m/(2P^2), \mathrm{Var}(\hat{S}_{ii}) = (P-1)^2\sigma^2_m/P^2, \mathrm{Var}(\hat{S}_{ij}) = (P^2 - 2P + 2)\sigma^2_m/(2P^2), \mathrm{Var}(\hat{R}_{ij}) = \sigma^2_m/2, \mathrm{Var}(\hat{g}_i - \hat{g}_j) = \sigma^2_m/P.

Components. Fixed model, as in Griffing (1956): Method 1 gca (MS_g - \sigma^2_m)/(2P), sca MS_s - \sigma^2_m, reciprocal (MS_r - \sigma^2_m)/2; Method 2 gca (MS_g - \sigma^2_m)/(P+2), sca MS_s - \sigma^2_m; Method 3 gca (MS_g - \sigma^2_m)/(2(P-2)), sca (MS_s - \sigma^2_m)/2, reciprocal as Method 1; Method 4 gca (MS_g - \sigma^2_m)/(P-2), sca MS_s - \sigma^2_m. Random model: the variance components solve the expected mean squares, for Method 1

\mathrm{E}(MS_g) = \sigma^2_m + \frac{2(P-1)}{P}\sigma^2_s + 2P\sigma^2_g, \quad \mathrm{E}(MS_s) = \sigma^2_m + \frac{2(P^2-P+1)}{P^2}\sigma^2_s, \quad \mathrm{E}(MS_r) = \sigma^2_m + 2\sigma^2_r,

for Method 2 \mathrm{E}(MS_g) = \sigma^2_m + \sigma^2_s + (P+2)\sigma^2_g, \mathrm{E}(MS_s) = \sigma^2_m + \sigma^2_s; Method 3 \mathrm{E}(MS_g) = \sigma^2_m + 2\sigma^2_s + 2(P-2)\sigma^2_g, \mathrm{E}(MS_s) = \sigma^2_m + 2\sigma^2_s; Method 4 \mathrm{E}(MS_g) = \sigma^2_m + \sigma^2_s + (P-2)\sigma^2_g, \mathrm{E}(MS_s) = \sigma^2_m + \sigma^2_s. The coefficients are computed exactly from the design, so they hold for any number of parents. Additive and dominance variances follow as \sigma^2_A = 2\sigma^2_g and \sigma^2_D = \sigma^2_s (non-inbred parents, no epistasis).

Maternal and non-maternal reciprocal effects. With Reciprocal = "split" the reciprocal effect is written r_{ij} = m_i - m_j + n_{ij} (Cockerham and Weir 1977), where m_i is the maternal effect of parent i (\sum_i m_i = 0) and n_{ij} = -n_{ji} the non-maternal (specific) reciprocal effect. With D_{ij} = (\bar{y}_{ij} - \bar{y}_{ji})/2 the least-squares estimates are

\hat{m}_i = \frac{1}{P}\sum_{j \neq i} D_{ij}, \qquad \hat{n}_{ij} = D_{ij} - \hat{m}_i + \hat{m}_j,

and the reciprocal sum of squares \sum_{i \neq j} D_{ij}^2 splits into maternal, 2P\sum_i \hat{m}_i^2 on P - 1 degrees of freedom, and non-maternal, the rest on (P - 1)(P - 2)/2. Their expected mean squares are \sigma^2/B + 2\sigma^2_n + 2P\sigma^2_m and \sigma^2/B + 2\sigma^2_n, so in Model 2 the maternal line is tested against the non-maternal line and \hat{\sigma}^2_m = (MS_{mat} - MS_{nm})/(2P). The standard errors are \sqrt{(P - 1)\sigma^2/(2P^2B)} for \hat{m}_i, \sqrt{\sigma^2/(PB)} for \hat{m}_i - \hat{m}_j and \sqrt{(P - 2)\sigma^2/(2PB)} for \hat{n}_{ij}.

Changes from version 0.6.0. The standard errors of Model 1 now use the error mean square; version 0.6.0 used the replicate mean square. In Method 2 the standard errors of \hat{S}_{ii} and \hat{S}_{ij} were swapped in version 0.6.0. In Model 2 of Methods 1 and 3 the reciprocal line is tested on the error degrees of freedom (version 0.6.0 used those of sca for its p-value). The third standard error of Method 4 (a Method 1 formula that has no meaning in Method 4) is NA. The table of means keeps the parents' labels and has every parent in its rows and columns. The sums of squares, tests, effects and components are unchanged.

Value

An object of class c("da_griffing", "da_result", "list"), with the components of earlier versions followed by new ones:

Means

P \times P matrix of cell means, female parents in rows, male parents in columns (NA for cells that are not part of the method).

ANOVA

combining-ability analysis of variance (class anova): lines gca, sca, reciprocals (Methods 1 and 3) and Error; columns Df, Sum Sq, Mean Sq, F value, Pr(>F).

Genetic.Components

data frame with one column Components: Model 1 rows gca, sca, Reciprocal (Methods 1, 3), gca/sca; Model 2 rows gca, sca, Reciprocal (Methods 1, 3), Error, Additive, Dominant (Dominance in Method 2), gca/sca.

Effects

(Model 1) P \times P matrix: gca effects on the diagonal, sca effects above it, reciprocal effects below it (Methods 1, 3; NA in Methods 2, 4).

StdErr

(Model 1) named vector of standard errors of effects and of their differences: Method 1 gi, sii, sij, rij, gi_gj, sii_sjj, sii_sij, sii_sjk, sij_sik, sij_skl, rij_rkl; Method 2 gi, sii, sij, gi_gj, sii_sjj, sij_sik, sij_skl; Method 3 gi, sij, rij, gi_gj, sij_sik, sij_skl; Method 4 gi, sij, not_defined, gi_gj, sij_sik, sij_skl.

GCA

(new; Model 1) named vector of gca effects \hat{\mathbf{g}}.

SCA

(new; Model 1) symmetric matrix of sca effects, selfs included in Methods 1 and 2.

Reciprocal

(new; Model 1, Methods 1 and 3) matrix of reciprocal effects, \hat{R}_{ij} = -\hat{R}_{ji}.

Maternal, NonMaternal

(new; Model 1, Methods 1 and 3, Reciprocal = "split") vector of maternal effects \hat{\mathbf{m}} and matrix of non-maternal effects \hat{n}_{ij}; the StdErr vector then also has mi, mi_mj and nij, the ANOVA lines maternal and non-maternal in place of reciprocals, and Genetic.Components the rows Maternal and NonMaternal in place of Reciprocal.

RCBD

(new) analysis of variance of the plot data as a randomized complete block design (lines Rep, Crosses, Residuals).

Methods: print(), summary(), plot() (gca effects with standard-error bars and the sca effects as a heat map, residuals of the block analysis against fitted values, normal quantile plot of the residuals, and a biplot of the cross means; which = c("gca", "sca", "biplot", "residuals", "qq")), anova(), coef(), vcov(), confint(), fitted(), residuals(), predict(), data.table::as.data.table(x, component =); see diallel-methods and da-methods.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com), Kent M. Eskridge (keskridge1@unl.edu)

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

Cockerham, C. C. and Weir, B. S. (1977). Quadratic analyses of reciprocal crosses. Biometrics, 33(1), 187–203. doi:10.2307/2529312

Singh, R. K. and Chaudhary, B. D. (2004). Biometrical Methods in Quantitative Genetic Analysis. Kalyani Publishers, New Delhi.

See Also

Hayman, PartialDiallel, GriffingData1 to GriffingData4, da-methods

Other DiallelAnalysisR analyses: GardnerEberhart(), GriffingEnv(), GriffingMeans(), Hayman(), Heterosis(), LineTester(), NCDesign(), PartialDiallel()

Examples

#-------------------------------------------------------------
## Method 1 (parents, F1 and reciprocals), Model 1 (fixed effects)
#-------------------------------------------------------------
Griffing1Data1 <-
  Griffing(
      y      = Yield
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = GriffingData1
    , Method = 1
    , Model  = 1
    )
Griffing1Data1
summary(Griffing1Data1)
Griffing1Data1$ANOVA
Griffing1Data1$StdErr
data.table::as.data.table(Griffing1Data1, component = "ANOVA")
plot(Griffing1Data1)

#-------------------------------------------------------------
## Method 1, Model 2 (random effects)
#-------------------------------------------------------------
Griffing2Data1 <-
  Griffing(
      y      = Yield
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = GriffingData1
    , Method = 1
    , Model  = 2
    )
Griffing2Data1$Genetic.Components

#-------------------------------------------------------------
## Method 2 (parents and one set of F1), Model 1
#-------------------------------------------------------------
Griffing1Data2 <-
  Griffing(
      y      = Yield
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = GriffingData2
    , Method = 2
    , Model  = 1
    )
Griffing1Data2$ANOVA
Griffing1Data2$GCA

#-------------------------------------------------------------
## Method 3 (F1 and reciprocals), Model 1
#-------------------------------------------------------------
Griffing1Data3 <-
  Griffing(
      y      = Yield
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = GriffingData3
    , Method = 3
    , Model  = 1
    )
Griffing1Data3$ANOVA

#-------------------------------------------------------------
## Method 4 (one set of F1), Model 2
#-------------------------------------------------------------
Griffing2Data4 <-
  Griffing(
      y      = Yield
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = GriffingData4
    , Method = 4
    , Model  = 2
    )
Griffing2Data4$Genetic.Components

Griffing's (1956) maize diallel: cross means of nine inbred lines

Description

The F_1 means of the 36 crosses among nine inbred lines of maize (Griffing's Method 4) used in the numerical example of Griffing (1956), from data of Griffing and Lindstrom (1954): six randomized blocks with 13 plants per plot. The error mean squares of the experiment (Griffing 1956, Table 7) are, per plant: within plots 1642.48 (total yield), 46.61 (cob weight), 1247.39 (shelled corn) on 2558 degrees of freedom; varieties by blocks 11803.61, 235.82, 9056.45 on 175 degrees of freedom. Divided by the 78 plants of a cross mean they give the error of GriffingMeans for Model 1 and Model 2.

Usage

data(Griffing56)

Format

A data.frame with 36 rows and 5 columns:

Cross1, Cross2

the two parents of the cross (factors, levels 1 to 9; Cross1 < Cross2).

TotalYield

X_1, total yield (the sum of the next two).

CobWeight

X_2, cob weight.

ShelledCorn

X_3, shelled corn weight.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

Source

Griffing (1956), Table 6, page 482.

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

Griffing, B. and Lindstrom, E. W. (1954). A study of the combining abilities of corn inbreds having varying proportions of corn belt and non-corn belt germ plasm. Agronomy Journal, 46, 545–552.

See Also

GriffingMeans

Other DiallelAnalysisR data: GriffingData1, GriffingData2, GriffingData3, GriffingData4, HaymanData, LineTesterData, NCData, PartialDiallelData

Examples

data(Griffing56)
head(Griffing56)

Complete diallel of eight parents (Griffing's Method 1)

Description

Yield of an eight-parent diallel with parents, F_1 and reciprocal F_1 (all 64 crosses) in a randomized complete block experiment with four replicates. The data for Griffing's Methods 2, 3 and 4 (GriffingData2, GriffingData3, GriffingData4) are subsets of these plots, and HaymanData is the same data set.

Usage

data(GriffingData1)

Format

A data.frame with 256 rows (64 crosses by 4 replicates) and 4 columns:

Cross1

female parent (factor, levels 1 to 8).

Cross2

male parent (factor, levels 1 to 8); Cross1 == Cross2 for the parents.

Rep

replicate (factor, levels 1 to 4).

Yield

yield (numeric).

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

Source

Example data of the package since its first version.

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

Singh, R. K. and Chaudhary, B. D. (2004). Biometrical Methods in Quantitative Genetic Analysis. Kalyani Publishers, New Delhi.

See Also

Griffing, Hayman

Other DiallelAnalysisR data: Griffing56, GriffingData2, GriffingData3, GriffingData4, HaymanData, LineTesterData, NCData, PartialDiallelData

Examples

data(GriffingData1)
str(GriffingData1)
with(data = GriffingData1, expr = tapply(X = Yield, INDEX = list(Cross1, Cross2), FUN = mean))

Parents and one set of crosses of eight parents (Griffing's Method 2)

Description

The plots of GriffingData1 with the parents and the crosses i \times j, i < j (36 cells).

Usage

data(GriffingData2)

Format

A data.frame with 144 rows (36 cells by 4 replicates) and the columns of GriffingData1: Cross1, Cross2, Rep, Yield.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

Source

A subset of GriffingData1.

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

See Also

Griffing

Other DiallelAnalysisR data: Griffing56, GriffingData1, GriffingData3, GriffingData4, HaymanData, LineTesterData, NCData, PartialDiallelData

Examples

data(GriffingData2)
str(GriffingData2)

Crosses and reciprocals of eight parents without the parents (Griffing's Method 3)

Description

The plots of GriffingData1 without the parents (56 cells).

Usage

data(GriffingData3)

Format

A data.frame with 224 rows (56 cells by 4 replicates) and the columns of GriffingData1: Cross1, Cross2, Rep, Yield.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

Source

A subset of GriffingData1.

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

See Also

Griffing

Other DiallelAnalysisR data: Griffing56, GriffingData1, GriffingData2, GriffingData4, HaymanData, LineTesterData, NCData, PartialDiallelData

Examples

data(GriffingData3)
str(GriffingData3)

One set of crosses of eight parents (Griffing's Method 4)

Description

The plots of GriffingData1 with the crosses i \times j, i < j only (28 cells).

Usage

data(GriffingData4)

Format

A data.frame with 112 rows (28 cells by 4 replicates) and the columns of GriffingData1: Cross1 (levels 1 to 7), Cross2 (levels 2 to 8), Rep, Yield.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

Source

A subset of GriffingData1.

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

See Also

Griffing

Other DiallelAnalysisR data: Griffing56, GriffingData1, GriffingData2, GriffingData3, HaymanData, LineTesterData, NCData, PartialDiallelData

Examples

data(GriffingData4)
str(GriffingData4)

Griffing's diallel analysis over several environments

Description

GriffingEnv() combines Griffing's analysis of the same diallel grown in several environments (locations, years or seasons), each a randomized complete block experiment: the pooled analysis of variance with the interactions gca \times environment, sca \times environment and, in Methods 1 and 3, reciprocal \times environment, the effects from the means over environments, the gca effects in every environment and, in the random model, the variance components.

Usage

GriffingEnv(y, Rep, Cross1, Cross2, Env, data, Method, Model)

Arguments

y

response: a column of data given by name (y = Yield or y = "Yield") or a numeric vector of length nrow(data).

Rep

replicate (block): a column of data or a vector, as for y.

Cross1

female parent of each plot: a column of data or a vector, as for y.

Cross2

male parent of each plot: a column of data or a vector, as for y.

Env

environment of each plot: a column of data or a vector, as for y. Replicate labels are taken within environments.

data

a data frame (or data.table) with one row per plot.

Method

1 (parents, F_1 and reciprocals), 2 (parents and one set of F_1), 3 (F_1 and reciprocals) or 4 (one set of F_1). No default.

Model

1 (fixed effects) or 2 (random effects). No default.

Details

Let \mathbf{Y}_e be the table of cross means in environment e = 1, \ldots, E, \bar{\mathbf{Y}} their mean and SS_k(\cdot) the sum of squares of line k (gca, sca, reciprocals) of Griffing's analysis of a table. Because each line is a projection of the table,

\sum_{e} SS_k(\mathbf{Y}_e) = E \cdot SS_k(\bar{\mathbf{Y}}) + \sum_e SS_k(\mathbf{Y}_e - \bar{\mathbf{Y}}),

the first term being line k and the second its interaction with environments, on f_k and (E - 1)f_k degrees of freedom. The environments line is c\sum_e (\bar{y}_e - \bar{y})^2 with c cells per table. Everything is on the scale of cross means; the error is the pooled error of the block analyses divided by B (harmonic mean of the replicates over environments), on the pooled degrees of freedom, and Rep(Env) is the pooled replicate line on the same scale.

With Model = 1 every line is tested against the error. With Model = 2 (random genotypes and environments) environments are tested against replicates within environments, gca, sca and reciprocals against their interaction with environments, and the interactions against the error; with c_{\cdot\cdot} the coefficients of the expected mean squares of the single-environment analysis,

\hat{\sigma}^2_{sE} = \frac{MS_{sE} - MS_E}{c_{ss}}, \quad \hat{\sigma}^2_s = \frac{MS_s - MS_{sE}}{E c_{ss}}, \quad \hat{\sigma}^2_{gE} = \frac{MS_{gE} - MS_E - c_{gs}\hat{\sigma}^2_{sE}}{c_{gg}}, \quad \hat{\sigma}^2_g = \frac{MS_g - MS_{gE} - E c_{gs}\hat{\sigma}^2_s}{E c_{gg}}.

The standard errors of the effects over environments are those of Griffing with the error variance MS_E/E.

Value

An object of class c("da_griffingenv", "da_result", "list"):

Means

table of cross means over environments.

ANOVA

pooled analysis of variance (class anova).

GCA

gca effects over environments; GCA.Env: matrix of gca effects, parents by environments.

SCA

sca effects over environments; Reciprocal (Methods 1 and 3) reciprocal effects.

StdErr

standard errors of the effects over environments, as in Griffing.

Genetic.Components

(Model 2) variance components.

ByEnv

list of the single-environment Griffing analyses.

Methods: print(), summary(), plot() (which = c("gca", "gcaenv", "sca", "residuals", "qq"); "gcaenv" draws the gca effect of every parent in every environment), data.table::as.data.table(x, component =), da_export.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

Singh, R. K. and Chaudhary, B. D. (2004). Biometrical Methods in Quantitative Genetic Analysis. Kalyani Publishers, New Delhi.

Zhang, Y. and Kang, M. S. (1997). DIALLEL-SAS: a SAS program for Griffing's diallel analyses. Agronomy Journal, 89(2), 176–182. doi:10.2134/agronj1997.00021962008900020005x

See Also

Griffing, DiallelSim

Other DiallelAnalysisR analyses: GardnerEberhart(), Griffing(), GriffingMeans(), Hayman(), Heterosis(), LineTester(), NCDesign(), PartialDiallel()

Examples

#-------------------------------------------------------------
## A Method 2 diallel of six parents in three environments
#-------------------------------------------------------------
d <-
  DiallelSim(
      Parents = 6
    , Method  = 2
    , Rep     = 3
    , Env     = 3
    , Mean    = 50
    , gca     = 4
    , sca     = 2
    , rec     = 0
    , gcaEnv  = 1.5
    , scaEnv  = 1
    , EnvSD   = 0
    , Block   = 0
    , Error   = 3
    , seed    = 1
    )
fe <-
  GriffingEnv(
      y      = y
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , Env    = Env
    , data   = d
    , Method = 2
    , Model  = 2
    )
fe
fe$GCA.Env
plot(x = fe, which = c("gca", "gcaenv", "sca", "residuals", "qq")[2])

Griffing's analysis from a table of cross means

Description

GriffingMeans() performs Griffing's (1956) combining-ability analysis when only the cross means and the error mean square are available, as in published examples: the cross means come from data (one row per cross) and the error from the experiment's analysis of variance. The analysis is that of Griffing.

Usage

GriffingMeans(y, Cross1, Cross2, data, Method, Model, ErrorMS, ErrorDf)

Arguments

y

column of data with the cross means (bare name, string or vector).

Cross1, Cross2

columns of data with the two parents of each cross.

data

a data frame with one row per cross (and per parent in Methods 1 and 2).

Method, Model

as in Griffing.

ErrorMS

error mean square on the basis of a cross mean (see Details).

ErrorDf

degrees of freedom of ErrorMS.

Details

Error. ErrorMS is the error mean square on the basis of a cross mean, Griffing's M'_e = M_e/(bc) for b blocks and c plants per plot: for Model 1 the within-plot (or plot) error divided by the number of observations per mean, for Model 2 the variety by block mean square divided by the same number (Griffing 1956, Tables 8 and 12). ErrorDf is its degrees of freedom. All other quantities, formulas and components are as documented in Griffing.

Value

An object of class c("da_griffing", "da_result", "list") with the components of Griffing except RCBD (there are no plot data).

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

See Also

Griffing, Griffing56

Other DiallelAnalysisR analyses: GardnerEberhart(), Griffing(), GriffingEnv(), Hayman(), Heterosis(), LineTester(), NCDesign(), PartialDiallel()

Examples

#-------------------------------------------------------------
## Griffing's (1956) example: Method 4, Model 1, total yield
#-------------------------------------------------------------
g56 <-
  GriffingMeans(
      y       = TotalYield
    , Cross1  = Cross1
    , Cross2  = Cross2
    , data    = Griffing56
    , Method  = 4
    , Model   = 1
    , ErrorMS = 1642.48 / 78
    , ErrorDf = 2558
    )
g56$ANOVA
round(x = g56$GCA, digits = 2)

#-------------------------------------------------------------
## The same data with Model 2 (variety x block error)
#-------------------------------------------------------------
g56r <-
  GriffingMeans(
      y       = TotalYield
    , Cross1  = Cross1
    , Cross2  = Cross2
    , data    = Griffing56
    , Method  = 4
    , Model   = 2
    , ErrorMS = 11803.61 / 78
    , ErrorDf = 175
    )
g56r$Genetic.Components

Diallel analysis by Hayman's approach

Description

Hayman() performs Hayman's analysis of a complete diallel (parents, F_1 and reciprocals: Griffing's Method 1) from the plot data of a randomized complete block experiment: Hayman's analysis of variance (additive, non-additive with its parts b_1, b_2, b_3, maternal and reciprocal effects), the array variances and covariances V_r and W_r with the W_r-V_r regression, the components of variation D, H_1, H_2, F, h^2 and E with their standard errors, the derived genetic ratios and the tests of the adequacy of the additive-dominance model.

Usage

Hayman(y, Rep, Cross1, Cross2, data)

Arguments

y

response: a column of data given by name (y = Yield or y = "Yield") or a numeric vector of length nrow(data).

Rep

replicate (block): a column of data or a vector, as for y.

Cross1

female parent of each plot: a column of data or a vector, as for y.

Cross2

male parent of each plot: a column of data or a vector, as for y.

data

a data frame (or data.table) with one row per plot.

Details

Data. P parents, all P^2 crosses, B replicates. \mathbf{Y} is the P \times P matrix of cell means and \mathbf{T} the matrix of cell totals over replicates.

Analysis of variance (Hayman 1954b), with T_{i\cdot}, T_{\cdot i}, T_{\cdot\cdot} the totals of \mathbf{T} and all sums of squares divided by B to the plot scale:

a = \frac{1}{B}\left[\frac{1}{2P}\sum_i (T_{i\cdot} + T_{\cdot i})^2 - \frac{2}{P^2}T_{\cdot\cdot}^2\right], \quad b = \frac{1}{B}\left[\frac{1}{4}\sum_{i,j}(T_{ij} + T_{ji})^2 - \frac{1}{2P}\sum_i (T_{i\cdot} + T_{\cdot i})^2 + \frac{1}{P^2}T_{\cdot\cdot}^2\right],

b_1 = \frac{(T_{\cdot\cdot} - P\sum_i T_{ii})^2}{P^2(P-1)B}, \quad b_2 = \frac{1}{B}\left[\frac{\sum_i (T_{i\cdot} + T_{\cdot i} - PT_{ii})^2}{P(P-2)} - \frac{(2T_{\cdot\cdot} - P\sum_i T_{ii})^2}{P^2(P-2)}\right], \quad b_3 = b - b_1 - b_2,

c = \frac{1}{2PB}\sum_i (T_{\cdot i} - T_{i\cdot})^2, \quad d = \frac{1}{B}\left[\frac{1}{4}\sum_{i,j} (T_{ij} - T_{ji})^2 - \frac{1}{2P}\sum_i (T_{\cdot i} - T_{i\cdot})^2\right].

b_1 (1 df) tests the mean deviation of the F_1 from the parents (directional dominance), b_2 (P-1 df) whether that deviation differs among parents, b_3 (P(P-3)/2 df) the remaining dominance (sca), c (P-1 df) maternal effects and d ((P-1)(P-2)/2 df) the remaining reciprocal differences; every line is tested against the error of the block analysis.

Arrays. The reciprocal crosses are averaged: \bar{\mathbf{Y}} = (\mathbf{Y} + \mathbf{Y}^\top)/2. Array r is column r of \bar{\mathbf{Y}}; V_r is its variance and W_r its covariance with the parents (the diagonal of \bar{\mathbf{Y}}). V_{0L0} is the variance of the parents, V_{1L1} the mean of the V_r, V_{0L1} the variance of the array means and W_{0L01} the mean of the W_r. The regression W_r = a + bV_r is fitted by least squares; under the additive-dominance model b = 1. The uniformity test (Hayman 1954a)

t^2 = \frac{P-2}{4}\,\frac{\left[\mathrm{Var}(V_r) - \mathrm{Var}(W_r)\right]^2}{\mathrm{Var}(V_r) \mathrm{Var}(W_r) - \mathrm{Cov}^2(V_r, W_r)}

is compared with the F distribution on 1 and P-2 degrees of freedom.

Components of variation (Hayman 1954a; Mather and Jinks 1982), with E the error variance of a cell mean (block and error sums of squares pooled, divided by B):

D = V_{0L0} - E, \quad F = 2V_{0L0} - 4W_{0L01} - \frac{2(P-2)}{P}E, \quad H_1 = V_{0L0} - 4W_{0L01} + 4V_{1L1} - \frac{3P-2}{P}E,

H_2 = 4V_{1L1} - 4V_{0L1} - 2E, \quad h^2 = 4(\bar{Y}_{L1} - \bar{Y}_{L0})^2 - \frac{4(P-1)}{P^2}E,

where \bar{Y}_{L1} is the mean of all cells and \bar{Y}_{L0} the mean of the parents. Their standard errors use s^2 = \mathrm{Var}(W_r - V_r)/2: \mathrm{Var}(D) = (P^5 + P^4)s^2/P^5, \mathrm{Var}(H_1) = (P^5 + 41P^4 - 12P^3 + 4P^2)s^2/P^5, \mathrm{Var}(H_2) = 36P^4s^2/P^5, \mathrm{Var}(F) = (4P^5 + 20P^4 - 16P^3 + 16P^2)s^2/P^5, \mathrm{Var}(h^2) = (16P^4 + 16P^3 - 32P + 16)s^2/P^5, \mathrm{Var}(E) = P^4s^2/P^5. Derived ratios: mean degree of dominance \sqrt{H_1/D}, proportion of genes with positive and negative effects H_2/(4H_1), ratio of dominant to recessive genes (\sqrt{4DH_1} + F)/(\sqrt{4DH_1} - F), the correlation of W_r + V_r with the parental values Y_{rr}, the number of gene groups showing dominance h^2/H_2 and the narrow-sense heritability (D + H_1 - H_2 - F)/(D + H_1 - H_2/2 - F + 2E). F_r = 2(V_{0L0} - W_{0L01} + V_{1L1} - W_r - V_r) - 2(P-2)E/P for each array.

Changes from version 0.6.0. The column arguments are used (version 0.6.0 read the columns Cross1 and Cross2 by name); H_2 subtracts 4V_{0L1} (version 0.6.0 added it); W_r and V_r both come from the reciprocal-averaged table (version 0.6.0 took V_r from the upper triangle and W_r from the unaveraged rows); the derived ratios are named; the lines b, b_3 and d of the analysis of variance divide by 4 where version 0.6.0 divided by the number of replicates (the two agree only with 4 replicates, as in HaymanData); the tests of the model are returned (Tests).

Value

An object of class c("da_hayman", "da_result", "list") with the components of earlier versions followed by a new one:

Means

P \times P matrix of cell means (female parents in rows).

ANOVA

Hayman's analysis of variance (class anova): Total, Rep, Treatment, additive (a), non-additive (b) with b1, b2, b3, maternal (c), reciprocal (d), Error.

VOLO

V_{0L0}, the variance of the parents.

In.Value

\sqrt{V_{1L1}V_{0L0}}, used to draw the limiting parabola.

a, b

intercept and slope of the regression of W_r on V_r.

Wr.Vr.Table

one row per array: Wr, Vr, Wr.Minus.Vr, Wr.Plus.Vr, Yr (parental value), Wri (limiting parabola \sqrt{V_rV_{0L0}}), Wrei (fitted regression), Wreip (line of unit slope through the means).

Components.of.Variation

Estimate, StdErr, t.value of E, D, F, H_1, H_2, h^2.

Other.Parameters

the derived ratios (named rows).

Fr

F_r of each array.

Tests

(new) uniformity test t^2, and t tests of b = 0 and b = 1: statistic, degrees of freedom, p-value.

Methods: print(), summary(), plot() (the W_r-V_r graph: limiting parabola, regression line, line of unit slope, parents labelled; which = c("WrVr", "residuals", "qq")), anova(), coef(), fitted(), residuals(), data.table::as.data.table(x, component =); see diallel-methods.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com), Kent M. Eskridge (keskridge1@unl.edu)

References

Hayman, B. I. (1954a). The theory and analysis of diallel crosses. Genetics, 39(6), 789–809. doi:10.1093/genetics/39.6.789

Hayman, B. I. (1954b). The analysis of variance of diallel tables. Biometrics, 10(2), 235–244. doi:10.2307/3001877

Hayman, B. I. (1957). Interaction, heterosis and diallel crosses. Genetics, 42(3), 336–355. doi:10.1093/genetics/42.3.336

Jinks, J. L. and Hayman, B. I. (1953). The analysis of diallel crosses. Maize Genetics Cooperation Newsletter, 27, 48–54.

Mather, K. and Jinks, J. L. (1982). Biometrical Genetics, 3rd edition. Chapman and Hall, London.

Singh, R. K. and Chaudhary, B. D. (2004). Biometrical Methods in Quantitative Genetic Analysis. Kalyani Publishers, New Delhi.

See Also

Griffing, HaymanData, da-methods

Other DiallelAnalysisR analyses: GardnerEberhart(), Griffing(), GriffingEnv(), GriffingMeans(), Heterosis(), LineTester(), NCDesign(), PartialDiallel()

Examples

#-------------------------------------------------------------
## Hayman's analysis of a complete diallel
#-------------------------------------------------------------
Hayman1Data <-
  Hayman(
      y      = Yield
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = HaymanData
    )
Hayman1Data
Hayman1Data$ANOVA
Hayman1Data$Components.of.Variation
Hayman1Data$Other.Parameters
Hayman1Data$Tests

#-------------------------------------------------------------
## The Wr-Vr graph
#-------------------------------------------------------------
plot(Hayman1Data)

Complete diallel of eight parents for Hayman's analysis

Description

The data of GriffingData1 (parents, F_1 and reciprocals of eight parents, four replicates), used in the examples of Hayman.

Usage

data(HaymanData)

Format

A data.frame with 256 rows and 4 columns: Cross1 (female parent), Cross2 (male parent), Rep (replicate), Yield.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

Source

Identical to GriffingData1.

References

Hayman, B. I. (1954). The theory and analysis of diallel crosses. Genetics, 39(6), 789–809. doi:10.1093/genetics/39.6.789

See Also

Hayman

Other DiallelAnalysisR data: Griffing56, GriffingData1, GriffingData2, GriffingData3, GriffingData4, LineTesterData, NCData, PartialDiallelData

Examples

data(HaymanData)
str(HaymanData)

Heterosis over the mid-parent, the better parent and a standard variety

Description

Heterosis() estimates, for every cross of a diallel or a set of crosses grown with their parents in a randomized complete block experiment, the heterosis over the mid-parent, over the better parent and over a standard (check) variety, in percent, with t tests of the underlying differences.

Usage

Heterosis(
  y,
  Rep,
  Cross1,
  Cross2,
  data,
  Check = NULL,
  Better = c("higher", "lower")
)

Arguments

y

response: a column of data given by name (y = Yield or y = "Yield") or a numeric vector of length nrow(data).

Rep

replicate (block): a column of data or a vector, as for y.

Cross1

female parent of each plot: a column of data or a vector, as for y.

Cross2

male parent of each plot: a column of data or a vector, as for y.

data

a data frame (or data.table) with one row per plot.

Check

label of the standard (check) variety: a parent of the diallel or another entry of data grown as a self (Cross1 == Cross2); NULL (default) for no standard heterosis.

Better

"higher" (default) or "lower": which parent is the better one.

Details

Means. F_{ij} is the mean of cross i \times j (crosses recorded both ways round are kept apart, so reciprocal crosses have their own heterosis), P_i the mean of parent i and C the mean of the check; the means are least-squares means of the block analysis when plots are missing. With B replicates and error mean square MS_E on f_E degrees of freedom (Singh and Chaudhary 2004):

MP = \frac{P_i + P_j}{2}, \quad H_{MP} = 100\,\frac{F_{ij} - MP}{MP}, \quad t = \frac{F_{ij} - MP}{ \sqrt{3MS_E/(2B)}},

BP = \max(P_i, P_j), \quad H_{BP} = 100\,\frac{F_{ij} - BP}{BP}, \quad t = \frac{F_{ij} - BP}{ \sqrt{2MS_E/B}},

and the standard heterosis H_{C} = 100(F_{ij} - C)/C with t = (F_{ij} - C)/\sqrt{2MS_E/B}. For a trait where lower values are better (days to flowering, disease score) set Better = "lower": the better parent is then the lower one. The p-values are two-sided on f_E degrees of freedom.

Value

An object of class c("da_heterosis", "da_result", "list"):

Means

matrix of cross means (parents on the diagonal).

Heterosis

data.table, one row per cross: Cross1, Cross2, F1, MidParent, BetterParent, MP (percent), t_MP, p_MP, BP, t_BP, p_BP and, with a check, Check, SH, t_SH, p_SH.

StdErr

standard errors of the differences F_{ij} - MP and F_{ij} - BP (also used for the check).

RCBD

analysis of variance of the plot data.

Methods: print(), summary(), plot() (heterosis of every cross, significant ones marked; which = c("MP", "BP", "SH", "residuals", "qq")), data.table::as.data.table(x, component =), da_export.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

References

Fonseca, S. and Patterson, F. L. (1968). Hybrid vigor in a seven-parent diallel cross in common winter wheat (Triticum aestivum L.). Crop Science, 8(1), 85–88. doi:10.2135/cropsci1968.0011183X000800010025x

Singh, R. K. and Chaudhary, B. D. (2004). Biometrical Methods in Quantitative Genetic Analysis. Kalyani Publishers, New Delhi.

See Also

Griffing, GardnerEberhart

Other DiallelAnalysisR analyses: GardnerEberhart(), Griffing(), GriffingEnv(), GriffingMeans(), Hayman(), LineTester(), NCDesign(), PartialDiallel()

Examples

#-------------------------------------------------------------
## Parents and one set of crosses; parent 3 as the check
#-------------------------------------------------------------
het <-
  Heterosis(
      y      = Yield
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = GriffingData2
    , Check  = 3
    , Better = c("higher", "lower")[1]
    )
het
head(het$Heterosis)
plot(x = het, which = c("MP", "BP", "SH", "residuals", "qq")[1])

Line by tester analysis

Description

LineTester() carries out Kempthorne's (1957) line \times tester analysis of the crosses of L lines with T testers in a randomized complete block experiment: the analysis of variance with the split of the crosses into lines, testers and lines \times testers, the proportional contributions of the three to the crosses' sum of squares, the general and specific combining ability effects with standard errors, and the genetic variances.

Usage

LineTester(y, Rep, Line, Tester, data, Inbreeding = 0)

Arguments

y

response: a column of data given by name (y = Yield or y = "Yield") or a numeric vector of length nrow(data).

Rep

replicate (block): a column of data or a vector, as for y.

Line

line (female) of each plot: a column of data or a vector, as for y.

Tester

tester (male) of each plot: a column of data or a vector, as for y.

data

a data frame (or data.table) with one row per plot.

Inbreeding

inbreeding coefficient F of the lines and testers, in [0, 1] (default 0; 1 for inbred lines).

Details

With B replicates, cross means \bar{y}_{ij}, line means \bar{y}_{i\cdot}, tester means \bar{y}_{\cdot j} and grand mean \bar{y}_{\cdot\cdot}:

\hat{g}_i = \bar{y}_{i\cdot} - \bar{y}_{\cdot\cdot}, \quad \hat{g}_j = \bar{y}_{\cdot j} - \bar{y}_{\cdot\cdot}, \quad \hat{s}_{ij} = \bar{y}_{ij} - \bar{y}_{i\cdot} - \bar{y}_{\cdot j} + \bar{y}_{\cdot\cdot},

with standard errors \sqrt{MS_E/(BT)} (lines), \sqrt{MS_E/(BL)} (testers) and \sqrt{MS_E/B} (crosses); a difference of two effects has \sqrt{2} times these. The sums of squares are on the plot scale; the proportional contribution of lines is 100 SS_L/SS_C, and likewise for testers and lines \times testers.

Genetic variances. From the expected mean squares E(MS_L) = \sigma^2 + B\sigma^2_s + BT\sigma^2_{gL}, E(MS_T) = \sigma^2 + B\sigma^2_s + BL\sigma^2_{gT} and E(MS_{LT}) = \sigma^2 + B\sigma^2_s:

\hat{\sigma}^2_{gca} = \frac{L + T - 2}{B(2LT - L - T)}\left[\frac{(L - 1)MS_L + (T - 1)MS_T}{L + T - 2} - MS_{LT}\right], \qquad \hat{\sigma}^2_{sca} = \frac{MS_{LT} - MS_E}{B},

and with inbreeding coefficient F of the parents \sigma^2_A = 4\sigma^2_{gca}/(1 + F) and \sigma^2_D = 4\sigma^2_{sca}/(1 + F)^2 (Singh and Chaudhary 2004). The degree of dominance is \sqrt{2\sigma^2_D/\sigma^2_A}.

Missing plots are handled as in Griffing: least-squares cross means adjusted for blocks and the harmonic mean of the plot numbers as B; every cross must have at least one plot.

Value

An object of class c("da_linetester", "da_result", "list"):

Means

L \times T matrix of cross means.

ANOVA

analysis of variance (class anova): Rep, Crosses, Lines, Testers, Lines:Testers, Error.

Contribution

proportional contributions (percent) of lines, testers and lines \times testers.

GCA.Lines, GCA.Testers

gca effects (named vectors).

SCA

L \times T matrix of sca effects.

StdErr

standard errors: gca_line, gca_tester, sca, gi_gj_line, gi_gj_tester, sij_skl.

Genetic.Components

data frame: \sigma^2_{gca} of lines, of testers and pooled, \sigma^2_{sca}, \sigma^2_A, \sigma^2_D, their ratio and the degree of dominance.

Methods: print(), summary(), plot() (which = c("gca", "sca", "contribution", "biplot", "residuals", "qq")), data.table::as.data.table(x, component =), da_export.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

References

Kempthorne, O. (1957). An Introduction to Genetic Statistics. John Wiley and Sons, New York.

Singh, R. K. and Chaudhary, B. D. (2004). Biometrical Methods in Quantitative Genetic Analysis. Kalyani Publishers, New Delhi.

See Also

NCDesign, PartialDiallel, LineTesterData

Other DiallelAnalysisR analyses: GardnerEberhart(), Griffing(), GriffingEnv(), GriffingMeans(), Hayman(), Heterosis(), NCDesign(), PartialDiallel()

Examples

lt <-
  LineTester(
      y          = Yield
    , Rep        = Rep
    , Line       = Line
    , Tester     = Tester
    , data       = LineTesterData
    , Inbreeding = 1
    )
lt
lt$Contribution
plot(x = lt, which = c("gca", "sca", "contribution", "biplot", "residuals", "qq")[1])

Line by tester example: eight lines crossed with three testers

Description

Simulated yields of the 24 crosses of eight lines with three testers in a randomized complete block experiment with three replicates, drawn from a model with line, tester and line by tester effects. The data illustrate LineTester.

Usage

data(LineTesterData)

Format

A data.frame with 72 rows and 4 columns:

Line

line (factor, L1 to L8).

Tester

tester (factor, T1 to T3).

Rep

replicate (factor, 1 to 3).

Yield

yield (numeric).

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

Source

Simulated; the script is data-raw/LineTesterNC.R of the package sources.

References

Kempthorne, O. (1957). An Introduction to Genetic Statistics. John Wiley and Sons, New York.

See Also

LineTester

Other DiallelAnalysisR data: Griffing56, GriffingData1, GriffingData2, GriffingData3, GriffingData4, HaymanData, NCData, PartialDiallelData

Examples

data(LineTesterData)
with(data = LineTesterData, expr = tapply(X = Yield, INDEX = list(Line, Tester), FUN = mean))

North Carolina designs I, II and III: example data

Description

Simulated yields for the three North Carolina designs, each in a randomized complete block experiment with three replicates: Design I with six males each mated to four different females, Design II with five males crossed with four females, and Design III with twelve F_2 males backcrossed to the two inbred parents P1 and P2. The data illustrate NCDesign.

Usage

data(NCData)

Format

A data.frame with 204 rows and 5 columns:

Design

design, 1, 2 or 3 (integer).

Male

male parent (character).

Female

female parent (character; Design III: P1 or P2).

Rep

replicate (factor, 1 to 3).

Yield

yield (numeric).

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

Source

Simulated; the script is data-raw/LineTesterNC.R of the package sources.

References

Comstock, R. E. and Robinson, H. F. (1948). The components of genetic variance in populations of biparental progenies and their use in estimating the average degree of dominance. Biometrics, 4(4), 254–266. doi:10.2307/3001412

See Also

NCDesign

Other DiallelAnalysisR data: Griffing56, GriffingData1, GriffingData2, GriffingData3, GriffingData4, HaymanData, LineTesterData, PartialDiallelData

Examples

data(NCData)
table(NCData$Design)

North Carolina designs I, II and III

Description

NCDesign() analyses the three mating designs of Comstock and Robinson (1948, 1952) grown in randomized complete blocks: Design I (females nested within males), Design II (every male crossed with every female) and Design III (males backcrossed to the two inbred parents of their population). It gives the analysis of variance, the variance components and the additive and dominance variances with the average degree of dominance.

Usage

NCDesign(y, Rep, Male, Female, data, Design, Inbreeding = 0)

Arguments

y

response: a column of data given by name (y = Yield or y = "Yield") or a numeric vector of length nrow(data).

Rep

replicate (block): a column of data or a vector, as for y.

Male

male parent of each plot: a column of data or a vector, as for y.

Female

female parent of each plot (Design I: labels may repeat across males, as females are nested; Design III: the two inbred parents): a column of data or a vector, as for y.

data

a data frame (or data.table) with one row per plot.

Design

1, 2 or 3. No default.

Inbreeding

inbreeding coefficient F of the parents, in [0, 1] (default 0).

Details

B is the number of replicates, M the number of males and F_m the number of females per male; F (Inbreeding) is the inbreeding coefficient of the parents, so that the covariance of half sibs is (1 + F)\sigma^2_A/4 and that of full sibs adds (1 + F)^2\sigma^2_D/4.

Design I. Lines males, females within males and error, with E(MS_m) = \sigma^2 + B\sigma^2_{f(m)} + BF_m\sigma^2_m and E(MS_{f(m)}) = \sigma^2 + B\sigma^2_{f(m)}: males are tested against females within males, and \sigma^2_A = 4\sigma^2_m/(1 + F), \sigma^2_D = 4(\sigma^2_{f(m)} - \sigma^2_m)/(1 + F)^2.

Design II. Lines males, females, males \times females and error; males and females are tested against the interaction, the interaction against the error. \sigma^2_A = 2(\sigma^2_m + \sigma^2_f)/(1 + F) (four times their mean) and \sigma^2_D = 4\sigma^2_{mf}/(1 + F)^2.

Design III. Female has exactly two levels, the two inbred parents; the males are F_2 plants. Lines males, testers (parents), males \times testers and error, all tested against the error, with E(MS_m) = \sigma^2 + 2B\sigma^2_m and E(MS_{mt}) = \sigma^2 + B\sigma^2_{mt}; with gene frequencies of one half \sigma^2_A = 4\sigma^2_m and \sigma^2_D = 2\sigma^2_{mt} (Inbreeding is not used).

In every design the average degree of dominance is \sqrt{2\sigma^2_D/\sigma^2_A}. Every male-female combination must have at least one plot; missing plots are handled with least-squares means as in LineTester.

Value

An object of class c("da_ncdesign", "da_result", "list"):

Means

matrix of the cross means (males in rows).

ANOVA

analysis of variance (class anova).

Genetic.Components

data frame: the variance components of the design, \sigma^2_A, \sigma^2_D and the average degree of dominance.

Methods: print(), summary(), plot() (which = c("components", "residuals", "qq")), data.table::as.data.table(x, component =), da_export.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

References

Comstock, R. E. and Robinson, H. F. (1948). The components of genetic variance in populations of biparental progenies and their use in estimating the average degree of dominance. Biometrics, 4(4), 254–266. doi:10.2307/3001412

Comstock, R. E. and Robinson, H. F. (1952). Estimation of average dominance of genes. In J. W. Gowen (ed.), Heterosis, 494–516. Iowa State College Press, Ames.

Hallauer, A. R., Carena, M. J. and Miranda Filho, J. B. (2010). Quantitative Genetics in Maize Breeding. Springer, New York. doi:10.1007/978-1-4419-0766-0

See Also

LineTester, NCData

Other DiallelAnalysisR analyses: GardnerEberhart(), Griffing(), GriffingEnv(), GriffingMeans(), Hayman(), Heterosis(), LineTester(), PartialDiallel()

Examples

#-------------------------------------------------------------
## Design II: every male crossed with every female
#-------------------------------------------------------------
nc2 <-
  NCDesign(
      y          = Yield
    , Rep        = Rep
    , Male       = Male
    , Female     = Female
    , data       = NCData[NCData$Design == 2, ]
    , Design     = 2
    , Inbreeding = 0
    )
nc2

#-------------------------------------------------------------
## Designs I and III
#-------------------------------------------------------------
nc1 <-
  NCDesign(
      y          = Yield
    , Rep        = Rep
    , Male       = Male
    , Female     = Female
    , data       = NCData[NCData$Design == 1, ]
    , Design     = 1
    , Inbreeding = 0
    )
nc1$Genetic.Components
nc3 <-
  NCDesign(
      y          = Yield
    , Rep        = Rep
    , Male       = Male
    , Female     = Female
    , data       = NCData[NCData$Design == 3, ]
    , Design     = 3
    , Inbreeding = 0
    )
plot(x = nc3, which = c("components", "residuals", "qq")[1])

Partial diallel analysis (crosses between two groups of parents)

Description

PartialDiallel() analyses a partial diallel in which each of L parents of a first group is crossed with each of M parents of a second group (a factorial mating design, also known as line by tester or North Carolina design II), from the plot data of a randomized complete block experiment: the analysis of variance of the general combining ability of each group and of the specific combining ability, the variance components, and the gca and sca effects.

Usage

PartialDiallel(y, Rep, Cross1, Cross2, data)

Arguments

y

response: a column of data given by name (y = Yield or y = "Yield") or a numeric vector of length nrow(data).

Rep

replicate (block): a column of data or a vector, as for y.

Cross1

parent of group I (rows) of each plot: a column of data or a vector, as for y.

Cross2

parent of group II (columns) of each plot: a column of data or a vector, as for y.

data

a data frame (or data.table) with one row per plot.

Details

Data and model. \mathbf{Y} is the L \times M matrix of cross means (group I in rows, group II in columns) over B replicates, with row means \bar{Y}_{i\cdot}, column means \bar{Y}_{\cdot j} and grand mean \bar{Y}_{\cdot\cdot}. The mean of cross i \times j is Y_{ij} = \mu + g^{I}_i + g^{II}_j + S_{ij} + \bar{e}_{ij}.

Analysis of variance (plot scale):

SS_{g^I} = BM\sum_i (\bar{Y}_{i\cdot} - \bar{Y}_{\cdot\cdot})^2, \quad SS_{g^{II}} = BL\sum_j (\bar{Y}_{\cdot j} - \bar{Y}_{\cdot\cdot})^2, \quad SS_s = B\sum_{i,j}(Y_{ij} - \bar{Y}_{i\cdot} - \bar{Y}_{\cdot j} + \bar{Y}_{\cdot\cdot})^2,

on L-1, M-1 and (L-1)(M-1) degrees of freedom; their sum is the treatment sum of squares on LM-1 degrees of freedom; the error is the residual of the block analysis of the plot data. Every line is tested against the error.

Effects. \hat{g}^I_i = \bar{Y}_{i\cdot} - \bar{Y}_{\cdot\cdot}, \hat{g}^{II}_j = \bar{Y}_{\cdot j} - \bar{Y}_{\cdot\cdot}, \hat{S}_{ij} = Y_{ij} - \bar{Y}_{i\cdot} - \bar{Y}_{\cdot j} + \bar{Y}_{\cdot\cdot}.

Variance components (random model; Kempthorne 1957, Comstock and Robinson 1952): \sigma^2_{g^I} = (MS_{g^I} - MS_s)/(BM), \sigma^2_{g^{II}} = (MS_{g^{II}} - MS_s)/(BL), \sigma^2_s = (MS_s - MS_E)/B. The column Percent gives the proportional contribution of each source to the treatment sum of squares.

Changes from version 0.6.0. The column arguments are used (version 0.6.0 read the columns y, Rep, Cross1 and Cross2 by name); the error line is on the plot scale like the other lines (version 0.6.0 divided it by the number of replicates, so its F values were too large by that factor squared); the components are the variance components above (version 0.6.0 gave differences of mean squares and their shares); the tables keep the parents' labels.

Value

An object of class c("da_partial", "da_result", "list"):

Means

L \times M matrix of cross means.

ANOVA

analysis of variance (class anova): Treat, GCA I, GCA II, SCA, Error.

Genetic.Components

Components (variance components of GCA I, GCA II, SCA) and Percent (share of the treatment sum of squares, as a proportion).

General

gca effects, group I followed by group II, named by parent.

Specific

L \times M matrix of sca effects.

RCBD

(new) analysis of variance of the plot data as a randomized complete block design.

Methods: print(), summary(), plot() (gca effects of both groups and the sca effects as a heat map, residual plots; which = c("gca", "sca", "residuals", "qq")), anova(), coef(), vcov(), confint(), fitted(), residuals(), data.table::as.data.table(x, component =); see diallel-methods.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com), Pedro A. M. Barbosa (pedro.barbosa@usp.br)

References

Comstock, R. E. and Robinson, H. F. (1952). Estimation of average dominance of genes. In J. W. Gowen (ed.), Heterosis, 494–516. Iowa State College Press, Ames.

Kempthorne, O. (1957). An Introduction to Genetic Statistics. John Wiley and Sons, New York.

Kempthorne, O. and Curnow, R. N. (1961). The partial diallel cross. Biometrics, 17(2), 229–250. doi:10.2307/2527989

Singh, R. K. and Chaudhary, B. D. (2004). Biometrical Methods in Quantitative Genetic Analysis. Kalyani Publishers, New Delhi.

See Also

Griffing, PartialDiallelData, da-methods

Other DiallelAnalysisR analyses: GardnerEberhart(), Griffing(), GriffingEnv(), GriffingMeans(), Hayman(), Heterosis(), LineTester(), NCDesign()

Examples

#-------------------------------------------------------------
## Ten parents of group I crossed with four parents of group II
#-------------------------------------------------------------
Partial1 <-
  PartialDiallel(
      y      = y
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = PartialDiallelData
    )
Partial1
Partial1$ANOVA
Partial1$Genetic.Components
plot(Partial1)

Partial diallel: ten by four parents

Description

A partial diallel in which each of ten parents of a first group (1 to 10) is crossed with each of four parents of a second group (11 to 14), in a randomized complete block experiment with four replicates.

Usage

data(PartialDiallelData)

Format

A data.frame with 160 rows (40 crosses by 4 replicates) and 4 columns:

Cross1

parent of group I (integer 1 to 10).

Cross2

parent of group II (integer 11 to 14).

Rep

replicate (integer 1 to 4).

y

response (numeric).

Author(s)

Muhammad Yaseen (myaseen208@gmail.com), Pedro A. M. Barbosa (pedro.barbosa@usp.br)

Source

Example data of the package, contributed by Pedro A. M. Barbosa.

References

Kempthorne, O. and Curnow, R. N. (1961). The partial diallel cross. Biometrics, 17(2), 229–250. doi:10.2307/2527989

See Also

PartialDiallel

Other DiallelAnalysisR data: Griffing56, GriffingData1, GriffingData2, GriffingData3, GriffingData4, HaymanData, LineTesterData, NCData

Examples

data(PartialDiallelData)
str(PartialDiallelData)

Methods for DiallelAnalysisR results

Description

The analysis functions of DiallelAnalysisR return the named list they have always returned, now with the class c("da_<analysis>", "da_result", "list"). Components are read as before (x$ANOVA, x[["Means"]]); the methods below print, summarise and plot the result and turn any component into a data.table.

Usage

## S3 method for class 'da_result'
print(x, digits = 4L, ...)

## S3 method for class 'da_result'
summary(object, ...)

## S3 method for class 'summary.da_result'
print(x, ...)

## S3 method for class 'da_result'
format(x, ...)

## S3 method for class 'da_result'
as.data.table(x, keep.rownames = FALSE, ..., component = 1L)

## S3 method for class 'da_result'
as.data.frame(x, row.names = NULL, optional = FALSE, ..., component = 1L)

## S3 method for class 'da_result'
plot(x, ...)

Arguments

x, object

a DiallelAnalysisR result.

digits

significant digits of printed numbers (default 4).

...

passed on (to print() of the components, or to the plotting function for plot()).

keep.rownames, row.names, optional

as in data.table::as.data.table() and as.data.frame(); row names of a matrix or data frame component are always kept, in a first column term.

component

name or number of the component to convert (default: the first one).

Value

print() returns x invisibly; summary() an object of class summary.da_result; format() a character string; as.data.table() and as.data.frame() the chosen component as a table; plot() a ggplot object.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)


Export the tables of an analysis for a report or a paper

Description

da_export() writes the main tables of a result of this package (the analysis of variance, the components, the effects with their standard errors and tests, and so on) to a Word document, a LaTeX file of booktabs tables, an HTML page, a Markdown file or CSV files, with numbers rounded for print.

Usage

da_export(
  x,
  file,
  format = c("docx", "latex", "html", "markdown", "csv"),
  tables = NULL,
  digits = 3,
  title = NULL
)

da_tables(x, digits = 3)

Arguments

x

a result of Griffing, GriffingMeans, Hayman, PartialDiallel or another analysis of the package.

file

path of the file to write (its extension does not choose the format; format does).

format

"docx" (Word), "latex", "html", "markdown" or "csv".

tables

names of the tables to write (default all; see names(da_tables(x))).

digits

decimals of the printed numbers (default 3).

title

title written above the tables (default: the label of the analysis).

Details

da_tables() returns the tables that da_export() writes, as a named list of data frames, so that they can be edited first. Numbers are rounded to digits decimals; p-values are printed with three decimals and as <0.001 below 0.001. Word documents need the packages officer and flextable; the other formats need nothing beyond base R. For LaTeX, the file holds one table environment per table and needs \usepackage{booktabs} in the preamble. For CSV, each table goes to its own file, named after file with the table name appended.

Value

da_export(): the path(s) of the file(s) written, invisibly. da_tables(): a named list of data frames.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

See Also

Other DiallelAnalysisR utilities: da_notation(), da_reference(), da_save(), da_theme()

Examples

fit <-
  Griffing(
      y          = Yield
    , Rep        = Rep
    , Cross1     = Cross1
    , Cross2     = Cross2
    , data       = GriffingData1
    , Method     = 1
    , Model      = 1
    , Reciprocal = c("combined", "split")[1]
    )
names(da_tables(x = fit, digits = 3))
f <- tempfile(fileext = ".tex")
da_export(
    x      = fit
  , file   = f
  , format = c("docx", "latex", "html", "markdown", "csv")[2]
  , tables = NULL
  , digits = 3
  , title  = NULL
  )
cat(readLines(f)[1:12], sep = "\n")

Notation of DiallelAnalysisR

Description

The symbols used in the help pages and vignettes of DiallelAnalysisR, with their meaning and the argument or result component that holds them. The notation follows one rule throughout: scalars are upper-case letters in normal face (P, R), indices lower-case italic (i, j), vectors lower-case bold (\mathbf{y}, \boldsymbol{\beta}) and matrices upper-case bold (\mathbf{X}, \boldsymbol{\Sigma}).

Usage

da_notation(format = c("table", "path", "tex"))

Arguments

format

"table" (default: a data.table with columns symbol (LaTeX), text (plain text), kind (scalar, index, vector, matrix, set, function, operator), meaning and argument), "path" (the path of notation.csv) or "tex" (the path of Notations.tex, the notation appendix used in the articles).

Value

See format.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

See Also

Other DiallelAnalysisR utilities: da_export(), da_reference(), da_save(), da_theme()

Examples

da_notation(
    format = c("table", "path", "tex")[1]
  )

Published values used by the tests and vignettes

Description

Reads inst/extdata/reference.csv: one row per published number, with its source, the R call that recomputes it with this package (call), the expression that extracts the number from the result (extract, in terms of x), the printed value and the digits to compare. The same file drives the test of published values and the vignette that reproduces the published examples. Each distinct call is evaluated once.

Usage

da_reference(source = NULL, evaluate = FALSE, level = 1)

Arguments

source

optional regular expression; keep rows whose source matches.

evaluate

logical; evaluate the rows and add columns computed and agrees (default FALSE).

level

largest level evaluated (1 = fast rows, 2 = slow rows; default 1); rows above it get NA.

Value

A data.table with columns id, source, quantity, call, extract, value, digits, level, note (and computed, agrees).

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

See Also

Other DiallelAnalysisR utilities: da_export(), da_notation(), da_save(), da_theme()

Examples

ref <-
  da_reference(
      source   = NULL
    , evaluate = FALSE
    , level    = 1
    )
ref

da_reference(
    source   = "."
  , evaluate = TRUE
  , level    = 1
  )


Save a figure (vector PDF by default)

Description

A wrapper of ggsave with the defaults of the package: a vector PDF through cairo_pdf (embedded fonts, correct glyphs), A4 landscape (11.69 x 8.27 inches) and 600 dpi for raster formats. The device follows the file extension for other formats (.png, .svg, .tiff, ...).

Usage

da_save(
  plot = ggplot2::last_plot(),
  filename,
  path = NULL,
  width = 11.69,
  height = 8.27,
  units = c("in", "cm", "mm"),
  dpi = 600,
  scale = 1,
  device = NULL,
  limitsize = TRUE,
  ...
)

Arguments

plot

a ggplot object, for example the result of plot() on a DiallelAnalysisR result (default: the last plot).

filename

file name; its extension chooses the format.

path

directory to save in (default NULL: the working directory or the path in filename).

width, height

size (default 11.69 x 8.27, A4 landscape, in units).

units

"in" (default), "cm" or "mm".

dpi

resolution for raster formats (default 600).

scale

multiplicative scaling factor (default 1).

device

NULL (default: cairo_pdf for .pdf, otherwise chosen from the extension) or a device function or name, passed to ggsave().

limitsize

logical; refuse images larger than 50 x 50 inches (default TRUE).

...

passed to ggsave.

Value

The file name, invisibly.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

See Also

Other DiallelAnalysisR utilities: da_export(), da_notation(), da_reference(), da_theme()

Examples

library(ggplot2)
p <-
  ggplot(data = data.frame(x = 1:10, y = (1:10)^2), mapping = aes(x = x, y = y)) +
  geom_line() +
  da_theme(
      base_size       = 11
    , base_family     = "serif"
    , ticks_inward    = TRUE
    , legend_position = "bottom"
    )
f <- tempfile(fileext = ".pdf")
da_save(
    plot      = p
  , filename  = f
  , path      = NULL
  , width     = 11.69
  , height    = 8.27
  , units     = c("in", "cm", "mm")[1]
  , dpi       = 600
  , scale     = 1
  , device    = NULL
  , limitsize = TRUE
  )
da_save(
    plot      = p
  , filename  = basename(f)
  , path      = tempdir()
  , width     = 11.69
  , height    = 8.27
  , units     = c("in", "cm", "mm")[1]
  , dpi       = 600
  , scale     = 1
  , device    = grDevices::cairo_pdf
  , limitsize = TRUE
  )
da_save(
    plot      = p
  , filename  = tempfile(fileext = ".png")
  , path      = NULL
  , width     = 6
  , height    = 4
  , units     = c("in", "cm", "mm")[1]
  , dpi       = 300
  , scale     = 1
  , device    = NULL
  , limitsize = TRUE
  )

ggplot2 theme of DiallelAnalysisR

Description

The theme used by every plot() method of DiallelAnalysisR (identical in all packages of the author): theme_classic with a serif font, black axis lines, ticks pointing inwards and no grid, close to the look of TikZ/pgfplots figures in LaTeX documents. The plot() methods also use scales::pretty_breaks(n = 10) on every continuous axis. Save figures with da_save.

Usage

da_theme(
  base_size = 11,
  base_family = "serif",
  ticks_inward = TRUE,
  legend_position = "bottom"
)

Arguments

base_size

base font size in points (default 11).

base_family

font family (default "serif"; for example "Latin Modern Roman" when installed, to match LaTeX documents).

ticks_inward

logical; ticks point into the panel, as in pgfplots (default TRUE).

legend_position

position of the legend (default "bottom").

Value

A ggplot2 theme.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

See Also

Other DiallelAnalysisR utilities: da_export(), da_notation(), da_reference(), da_save()

Examples

library(ggplot2)
p <-
  ggplot(data = data.frame(x = 1:20, y = cumsum(sin(1:20))), mapping = aes(x = x, y = y)) +
  geom_line()
p +
  da_theme(
      base_size       = 11
    , base_family     = "serif"
    , ticks_inward    = TRUE
    , legend_position = "bottom"
    )
p +
  da_theme(
      base_size       = 12
    , base_family     = "serif"
    , ticks_inward    = FALSE
    , legend_position = "right"
    ) +
  scale_x_continuous(breaks = scales::pretty_breaks(n = 10))

Methods for the diallel analyses

Description

The results of Griffing, Hayman and PartialDiallel are lists with a class, so the usual model functions of R work on them: print() shows the main tables, summary() adds the tests of every effect, anova() returns the analysis of variance, coef() the estimates, vcov() and confint() their covariance matrix and confidence intervals, fitted() and residuals() the plot-level fitted values and residuals of the block analysis, predict() the predicted means of crosses (Griffing's fixed model), and plot() or autoplot() the figures.

Usage

## S3 method for class 'summary.da_griffing'
print(x, digits = 4L, ...)

## S3 method for class 'summary.da_hayman'
print(x, digits = 4L, ...)

## S3 method for class 'summary.da_partial'
print(x, digits = 4L, ...)

## S3 method for class 'da_result'
anova(object, ...)

## S3 method for class 'da_griffing'
coef(object, ...)

## S3 method for class 'da_hayman'
coef(object, ...)

## S3 method for class 'da_partial'
coef(object, ...)

## S3 method for class 'da_griffing'
vcov(object, ...)

## S3 method for class 'da_partial'
vcov(object, ...)

## S3 method for class 'da_griffing'
confint(object, parm = NULL, level = 0.95, ...)

## S3 method for class 'da_partial'
confint(object, parm = NULL, level = 0.95, ...)

## S3 method for class 'da_result'
fitted(object, ...)

## S3 method for class 'da_result'
residuals(object, ...)

## S3 method for class 'da_result'
nobs(object, ...)

## S3 method for class 'da_result'
df.residual(object, ...)

## S3 method for class 'da_griffing'
predict(object, newdata = NULL, type = c("gca", "full"), ...)

## S3 method for class 'da_result'
autoplot(object, ...)

Arguments

x, object

a result of Griffing(), Hayman() or PartialDiallel().

digits

significant digits of printed numbers (default 4).

...

passed on (to plot() for autoplot(); otherwise not used).

parm

effects to include (names; default all).

level

confidence level (default 0.95).

newdata

data frame with columns Cross1 and Cross2 (parent labels); default every pair of parents.

type

"gca" (default) or "full"; see Details.

Details

Standard errors and tests use the error variance of a cell mean \sigma^2_m = MS_E/B on the error degrees of freedom f_E: t = \hat{\theta}/\mathrm{SE}(\hat{\theta}), two-sided p-values from the t distribution on f_E degrees of freedom, and confidence intervals \hat{\theta} \pm t_{1-\alpha/2, f_E}\,\mathrm{SE}(\hat{\theta}). In Griffing's fixed model the gca effects have \mathrm{Var}(\hat{g}_i) = v_1\sigma^2_m and \mathrm{Cov}(\hat{g}_i, \hat{g}_j) = (v_1 - v_{12}/2) \sigma^2_m, where v_1 and v_{12} are the variance coefficients of \hat{g}_i and of \hat{g}_i - \hat{g}_j (see Griffing). In the partial diallel \mathrm{Var}(\hat{g}^I_i) = (1 - 1/L)\sigma^2/(BM), \mathrm{Var}(\hat{g}^{II}_j) = (1 - 1/M)\sigma^2/(BL) and \mathrm{Var}(\hat{S}_{ij}) = (L-1)(M-1)\sigma^2/(BLM). Hayman's components are tested on P-2 degrees of freedom.

Summary. summary(object, top = 5) lists the top crosses with the largest sca effects (Griffing's Model 1 and the partial diallel); top is passed through ....

Prediction (Griffing, Model 1): the mean of cross i \times j is predicted by \hat{\mu} + \hat{g}_i + \hat{g}_j from general combining ability alone (type = "gca", the prediction for crosses not grown or not yet tested) or by \hat{\mu} + \hat{g}_i + \hat{g}_j + \hat{S}_{ij} + \hat{R}_{ij} (type = "full", which reproduces the observed means).

Value

print() returns x invisibly. summary(): an object of class summary.da_griffing, summary.da_hayman or summary.da_partial (a list of tables, each a data.table or data.frame) with a print method. anova(): the analysis of variance (class anova). coef(): a named numeric vector (Griffing Model 1: gca effects g_<parent>, sca effects s_<i>:<j>, reciprocal effects r_<i>:<j>; Griffing Model 2: variance components; Hayman: the components of variation; partial diallel: gca effects gI_<parent>, gII_<parent>). vcov(): covariance matrix of the gca effects. confint(): a matrix with columns for the lower and upper limits. fitted(), residuals(): numeric vectors, one value per plot. nobs(): number of plots; df.residual(): error degrees of freedom. predict(): a data.table with Cross1, Cross2 and predicted. autoplot(): a ggplot object.

Author(s)

Muhammad Yaseen (myaseen208@gmail.com)

References

Griffing, B. (1956). Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Sciences, 9(4), 463–493. doi:10.1071/BI9560463

Hayman, B. I. (1954). The theory and analysis of diallel crosses. Genetics, 39(6), 789–809. doi:10.1093/genetics/39.6.789

See Also

Griffing, Hayman, PartialDiallel, da-methods

Examples

#-------------------------------------------------------------
## The model functions on Griffing's fixed model
#-------------------------------------------------------------
fit <-
  Griffing(
      y          = Yield
    , Rep        = Rep
    , Cross1     = Cross1
    , Cross2     = Cross2
    , data       = GriffingData1
    , Method     = 1
    , Model      = 1
    , Reciprocal = c("combined", "split")[1]
    )
fit
summary(object = fit, top = 5)
anova(fit)
coef(fit)[1:8]
vcov(fit)
confint(object = fit, parm = NULL, level = 0.95)
head(fitted(fit))
head(residuals(fit))
nobs(fit)
df.residual(fit)
predict(
    object  = fit
  , newdata = data.frame(Cross1 = c(3, 7), Cross2 = c(7, 8))
  , type    = c("gca", "full")[1]
  )
plot(x = fit, which = c("gca", "sca", "biplot", "residuals", "qq")[4])

#-------------------------------------------------------------
## Hayman and the partial diallel
#-------------------------------------------------------------
h <-
  Hayman(
      y      = Yield
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = HaymanData
    )
summary(object = h, top = 5)
coef(h)
p <-
  PartialDiallel(
      y      = y
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = PartialDiallelData
    )
summary(object = p, top = 5)
confint(object = p, parm = NULL, level = 0.95)