Version: | 1.0.1 |
Date: | 2023-04-14 |
Title: | Linear Fixed/Mixed Effects Models for Diallel Crosses |
Maintainer: | Andrea Onofri <andrea.onofri@unipg.it> |
Depends: | R (≥ 3.5.0) |
Imports: | multcomp, plyr, sommer, tidyr |
Description: | Several service functions to be used to analyse datasets obtained from diallel experiments within the frame of linear models in R, as described in Onofri et al (2020) <doi:10.1007/s00122-020-03716-8>. |
URL: | https://www.statforbiology.com/lmDiallel/ |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
NeedsCompilation: | no |
Packaged: | 2023-04-19 15:46:45 UTC; andrea |
Author: | Andrea Onofri [aut, cre], Niccolo Terzaroli [aut] |
Repository: | CRAN |
Date/Publication: | 2023-04-19 16:10:02 UTC |
Dominant Deviation effect
Description
DD effect to fit Hayman2 model with lm
function
Usage
DD(P1, P2, type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of n-1 parentals
Value
A design matrix for the DD effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli , Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
contrasts(hayman54$Block) <- "contr.sum"
dMod <- lm(Ftime ~ Block + GCA(Par1, Par2) + MDD(Par1, Par2) +
DD(Par1, Par2) + SCA(Par1, Par2) +
RGCA(Par1, Par2) + RSCA(Par1, Par2), data = hayman54)
summary(dMod)
General Combining Ability effect
Description
GCA effect to fit Hayman1 & 2 and Griffing 1 & 2 models with lm
function
Usage
GCA(P1,P2,type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of n-1 parentals
Value
A design matrix for the GCA effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli , Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
contrasts(hayman54$Block) <- "contr.sum"
dMod<-lm(Ftime ~ Block + GCA(Par1,Par2)
+ tSCA(Par1, Par2) + RGCA(Par1, Par2)
+ RSCA(Par1,Par2), data = hayman54)
anova(dMod)
General Combining Ability without considering the selfed parents
Description
Design matrix for GCAC, useful to fit Gardner & Eberhart model 3 (GE3) with lm
function
Usage
GCAC(P1,P2,type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of n-1 parentals
Value
A design matrix for the GCAC effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
GCAC(Par1,Par2, data=hayman54)
Average heterosis effect
Description
H.BAR effect to fit GE2 and GE3 models with lm
function
Usage
H.BAR(P1, P2, type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Value
A design matrix for the H.BAR effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli , Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("zhang05")
dMod <- lm(Yield ~ Env/Block + H.BAR(Par1, Par2) + VEi(Par1, Par2) +
Hi(Par1, Par2) + SCA(Par1, Par2) +
H.BAR(Par1, Par2):Env + VEi(Par1, Par2):Env +
Hi(Par1, Par2):Env + SCA(Par1, Par2):Env, data = zhang05)
anova(dMod)
Average heterosis effect
Description
H.i effect to fit GE2 Model with lm
function
Usage
Hi(P1, P2, type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of n-1 parentals
Value
A design matrix for the Hi effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli , Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("zhang05")
dMod <- lm(Yield ~ Env/Block + H.BAR(Par1, Par2) + VEi(Par1, Par2) +
Hi(Par1, Par2) + SCA(Par1, Par2) +
H.BAR(Par1, Par2):Env + VEi(Par1, Par2):Env +
Hi(Par1, Par2):Env + SCA(Par1, Par2):Env, data = zhang05)
anova(dMod)
Mean Dominance Deviation effect
Description
It relates to the difference between the average yield of selfed parents and the average yield of crosses. DD effect to fit Hayman2 model with lm
function
Usage
MDD(P1, P2, type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Value
A design matrix for the MDD effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
MDD(Par1, Par2, data = hayman54)
Reciprocal Effect not parted into RGCA and RSCA
Description
Build incidence matrix to fit reciprocal effects in Griffing's model 1, 2, 4 (REC) and 3 (REC.G3) with lm
function
Usage
REC(P1, P2, type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of n-1 parentals
Value
A design matrix for the reciprocal (REC) effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
dMod<-lm(Ftime~ Block + GCA(Par1,Par2)
+tSCA(Par1, Par2)+REC(Par1, Par2)
, data = hayman54)
anova(dMod)
Reciprocal General Combining Ability
Description
RGCA effect to fit Hayman1 & 2 models with lm
function
Usage
RGCA(P1,P2,type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of n-1 parentals
Value
A design matrix for the RGCA effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
dMod<-lm(Ftime~ Block + GCA(Par1,Par2)
+ tSCA(Par1, Par2) + RGCA(Par1, Par2)
+ RSCA(Par1,Par2), data = hayman54)
anova(dMod)
Reciprocal Specific Combining Ability
Description
RSCA effect to fit Hayman 1 & 2 models with lm
function
Usage
RSCA(P1,P2,type = "fix",data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of all possible combinations between parentals with no selfs and no reciprocals
Value
A design matrix for the RSCA effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
dMod<-lm(Ftime~ Block + GCA(Par1,Par2)
+ tSCA(Par1, Par2) + RGCA(Par1, Par2)
+ RSCA(Par1,Par2), data = hayman54)
anova(dMod)
Specific Combining Ability
Description
SCA effect to fit Hayman2, Griffing3 (SCA.G3), GE2 and GE3 (SCA.GE) models with lm
function
Usage
SCA(P1, P2, type = "fix", data)
SCA.G3(P1, P2, type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of all possible combinations between parentals with no selfs and no reciprocals
Value
A design matrix for the SCA effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("zhang05")
dMod <- lm(Yield ~ Env/Block + H.BAR(Par1, Par2) + VEi(Par1, Par2) +
Hi(Par1, Par2) + SCA(Par1, Par2) +
H.BAR(Par1, Par2):Env + VEi(Par1, Par2):Env +
Hi(Par1, Par2):Env + SCA(Par1, Par2):Env, data = zhang05)
anova(dMod)
Selfed Parents effect
Description
SP effect to fit GE3 model with lm
function
Usage
SP(P1, P2, type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of n-1 parentals
Value
A design matrix for the SP effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
SP(Par1,Par2, data=hayman54)
Variety Effect
Description
VE.i effect to fit GE2 model with lm
function
Usage
VEi(P1, P2, type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of n-1 parentals
Value
A design matrix for the VEi effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("zhang05")
dMod <- lm(Yield ~ Env/Block + H.BAR(Par1, Par2) + VEi(Par1, Par2) +
Hi(Par1, Par2) + SCA(Par1, Par2) +
H.BAR(Par1, Par2):Env + VEi(Par1, Par2):Env +
Hi(Par1, Par2):Env + SCA(Par1, Par2):Env, data = zhang05)
anova(dMod)
Creates block diagonal matrix. It is used internally.
Description
This function takes a list of matrices and creates a block diagonal matrix. It is used to fit multi-environment diallel models
Usage
blockMatrixDiagonal(matList)
Arguments
matList |
It is a list of matrices to be combined |
Value
Returns a matrix object
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theoretical Applied Genetics (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
a <- matrix(1:16, 8, 2)
b <- matrix(1:9, 3, 3)
c <- list(a, b)
blockMatrixDiagonal(c)
Factitious dataset for Diallel analysis
Description
Multi-environment half-diallel dataset with six parentals, in five blocks and ten environments; the dataset is factitious and was obtained by Monte Carlo simulation.
Usage
data("diallelMET")
Format
A data.frame with 1050 observations on the following 5 variables.
Env
environment, a factor with 10 levels
Block
block, a factor with 5 levels
Par1
male parent, a factor with 6 levels
Par2
female parent, a factor with 6 levels
Yield
yield, a numeric vector
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
Source
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("diallelMET")
Functions to retreive full list of genetical effects
Description
Diallel model parameters are estimated under a set of restrictions and, therefore, the methods 'coef' and 'summary' do not return the full list of genetical parameters. Therefore, the 'glht.diallelMod' method can be used, which works by way of a series of helper functions, providing the necessary contrast matrices.
Usage
## S3 method for class 'diallelMod'
glht(model, linfct, ...)
Arguments
model |
a model object (OPTIONAL) |
linfct |
a diellel.eff() function |
... |
Other optional arguments |
Details
...
Value
summary
Returns the full list of genetical parameters
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
library(lmDiallel)
library(multcomp)
# Data with replicates
data("hayman54")
fit <- lm.diallel(Ftime ~ Par1 + Par2, data = hayman54,
fct = "HAYMAN1")
summary(fit)
anova(fit)
gh <- glht(linfct = diallel.eff(fit))
Create a Data Frame from All Combinations of Parentals
Description
This is a modification of the 'expand.grid()' function working specifically with diallel experiments. It creates a data frame from all combinations of the supplied vector of parents, depending on the mating scheme.
Usage
expand.diallel(pars, mating = 1)
Arguments
pars |
|
mating |
The type of mating scheme. 1: full diallel experiment; 2: no reciprocals; 3: no selfs; 4: no reciprocals and no selfs |
Value
returns a data.frame object
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
pars <- LETTERS[1:4]
expand.diallel(pars, mating = 3)
Griffing's dataset for diallel analysis
Description
Data for a diallel in maize, with no selfs and no selfed parents. Data are the means of several replicates.
Usage
data("griffing56")
Format
A data.frame with 36 observations on the following 5 variables
Par1
male parent, a factor with 8 levels
Par2
female parent, a factor with 8 levels
Yield
Maize Yield
Cob
Cob weight
Shelled
Shelled corn weight
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
Source
Griffing, B., 1956. Concept of general and specific combining ability in relation to diallel crossing systems. Australian Journal of Biological Science 9, 463–493.
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("griffing56")
dMod2 <- lm.diallel(Yield ~ Par1 + Par2,
data = griffing56, fct = "GRIFFING4")
anova(dMod2, MSE = 21.05, dfr = 2558)
summary(dMod2, MSE = 21.05, dfr = 2558)
Hayman dataset for diallel analysis
Description
Data for a diallel in tobacco with 2 reps
Usage
data(hayman54)
Format
A data.frame with 128 observations on the following 4 variables
Block
block, a factor with 2 levels
Par1
male parent, a factor with 8 levels
Par2
female parent, a factor with 8 levels
Ftime
mean flowering time (days), a numeric vector
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
Source
B. I. Hayman (1954a). The Analysis of Variance of Diallel Tables. Biometrics, 10, 235-244. Table 5, page 241. http://doi.org/10.2307/3001877
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
contrasts(hayman54$Block) <- c("contr.sum")
dMod <- lm(Ftime ~ Block + GCA(Par1, Par2)
+ tSCA(Par1, Par2) + RGCA(Par1, Par2)
+ RSCA(Par1, Par2), data = hayman54)
anova(dMod)
#or
dMod2 <- lm.diallel(Ftime ~ Par1 + Par2, Block = Block,
data = hayman54,
fct = "HAYMAN1")
anova(dMod2)
Utilities for fitting diallel models.
Description
These functions are used internally by the package, but they can also called from the outside, to fit specific needs
Usage
int.matrix(Xa, Xb)
checkScheme(P1, P2)
emm.diallel(obj)
Arguments
Xa |
Incidence matrix of genetic effects |
Xb |
Incidence matrix for an external factor |
P1 |
A vector with parentals |
P2 |
A vector with parentals |
obj |
A glht object |
Details
The function 'int.matrix()' produces the incidence matrix for the interaction between two main effects; 'Xa' and 'Xb' are two incidence matrices for two main effects. The function 'checkScheme()' takes two vectors containing the codings for parentals (P1 and P2), retrieves the mating scheme and detects whether there are missing crosses. The function 'emm.diallel()' is used with multi-environment diallel experiments to obtain the expected marginal means for genetic effects across environments.
Value
The function 'int.matrix()' returns an incidence matrix. The function 'checkScheme()' returns a list, containing the main traits of the mating scheme. The function 'emm.diallel()' retrns a data.frame with the marginal means, standard errors and t-test statistics.
Note
No further notes
Author(s)
Andrea Onofri
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data(griffing56)
head(griffing56)
checkScheme(griffing56$Par1, griffing56$Par2)
Fitting diallel linear models
Description
Wrapper function for lm.fit and diallel models. It can be used to carry out several powerful methods for linear models, such as 'summary()', anova() or 'glht()' in the 'multcomp' package.
Usage
lm.diallel(formula, Block, Env, fct = "GRIFFING2", data)
Arguments
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.'formula' uses the regular R syntax to specify the response variable and the two variables for parentals |
Block |
used to specify an optional variable coding for blocks |
Env |
used to specify an optional variable coding for environments |
fct |
a string variable coding for the selected model. 8 main diallel models: Hayman's model 1 (="HAYMAN1"), Hayman's model 2 (="HAYMAN2"), Griffing's model 1 (="GRIFFING1"), Griffing's model 2 (="GRIFFING2"), Griffing's model 3 (="GRIFFING3"), Griffing's model 4 (="GRIFFING4"), Gardner-Eberhart model 2 (="GE2") and Gardner-Eberhart model 3 (="GE3"). The strings "GE2r" and "GE3r" can be used to specify the 'enhanced' GE2 and GE3 models, including the effect of reciprocals (REC). |
data |
a 'data.frame' where to look for explanatory variables |
Details
Notations for the 8 models
Model name in 'lm.diallel()' | Model notation in 'lm()' |
HAYMAN1 | Y ~ GCA(Par1, Par2) + tSCA(Par1, Par2) + RGCA(Par1, Par2) + RSCA(Par1, Par2) |
GRIFFING1 | Y ~ GCA(Par1, Par2) + tSCA(Par1, Par2) + REC(Par1, Par2) |
GRIFFING2 | Y ~ GCA(Par1, Par2) + tSCA(Par1, Par2) |
HAYMAN2 | Y ~ GCA(Par1, Par2) + MDD(Par1, Par2) + DD(Par1, Par2) + SCA(Par1, Par2) + RGCA(Par1, Par2) + RSCA(Par1, Par2) |
GE2 | Y ~ H.BAR(Par1, Par2) + VE.i(Par1, Par2) + H.i(Par1, Par2) + SCA(Par1, Par2) |
GE3 | Y ~ H.BAR(Par1, Par2) + SP(Par1, Par2) + GCAC(Par1, Par2) + SCA(Par1, Par2) |
GE2r | Y ~ H.BAR(Par1, Par2) + VE.i(Par1, Par2) + H.i(Par1, Par2) + SCA(Par1, Par2) + RGCA(Par1, Par2) + RSCA(Par1, Par2) |
GE3r | Y ~ H.BAR(Par1, Par2) + SP(Par1, Par2) + GCAC(Par1, Par2) + SCA(Par1, Par2) + RGCA(Par1, Par2) + RSCA(Par1, Par2) |
Value
lm.diallel returns an object of class c("diallel", "lm"), that is a list containing at least the following components:
coefficients
a named vector of coefficients
residuals
the residuals, that is response minus fitted values
fitted.values
the fitted mean values
rank
the numeric rank of the fitted linear models
weights
(only for weighted fits) the specified weights
df.residual
the residual degrees of freedom
call
the matched call
terms
the terms object used
contrasts
(only where relevant) the contrasts used
xlevels
(only where relevant) a record of the levels of the factors used in fitting
call
the matched call
offset
the offset used (missing if none were used)
y
if requested, the response used
x
if requested, the model matrix used
model
if requested (the default), the model frame used
na.action
(where relevant) information returned by model.frame on the special handling of NAs
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
dMod <- lm.diallel(Ftime ~ Par1 + Par2, Block = Block,
data = hayman54,
fct = "HAYMAN1")
anova(dMod)
#or
data("zhang05")
contrasts(zhang05$Block) <- c("contr.sum")
dMod2 <- lm.diallel(Yield ~ Par1 + Par2, Env = Env, Block = Block,
data = zhang05, fct = "GE2")
#or
data("lonnquist61")
dMod3 <- lm.diallel(Yield ~ Par1 + Par2,
data = lonnquist61,
fct = "GE2")
summary(dMod3, MSE = 7.10, dfr = 60)
anova(dMod3, MSE = 7.10, dfr = 60)
Methods for diallel model fitting
Description
The object returned by the 'lm.diallel()' function is of classes 'lm' and 'diallel'. Specific methods were devised to explore the 'diallel' object.
Usage
## S3 method for class 'diallel'
summary(object, MSE, dfr, ...)
## S3 method for class 'diallel'
vcov(object, MSE, ...)
## S3 method for class 'diallel'
anova(object, MSE, dfr, type = 1, ...)
## S3 method for class 'diallel'
model.matrix(object, ...)
Arguments
object |
an object of class diallel. |
MSE |
Mean Square Error, when it cannot be derived from model fit |
dfr |
Residual degrees of freedom, when they cannot be derived from model fit |
type |
It is used to select between Type I (sequential) or Type III (marginal) F tests in ANOVA |
... |
Other optional arguments |
Details
To be defined
Value
vcov.diallel
: a variance-covariance matrix
summary.diallel
: a data.frame of estimated parameters with standard errors
anova.diallel
: an ANOVA table
predict.diallel
: a vector of predictions from a diallel model
model.matrix.diallel
: a design matrix for the fitted diallel model
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
library(lmDiallel)
library(multcomp)
# Data with replicates
data("hayman54")
fit <- lm.diallel(Ftime ~ Par1 + Par2, data = hayman54,
fct = "HAYMAN1")
summary(fit)
anova(fit)
gh <- glht(linfct = diallel.eff(fit), adjust = "none")
Half diallel of maize dataset
Description
Diallel experiment with six maize varieties and no reciprocals. The data here are means adjusted for block effects.
Usage
data("lonnquist61")
Format
A data.frame with 21 observations on the following 3 variables.
Par1
male parent, a factor with 6 levels
Par2
female parent, a factor with 6 levels
Yield
mean across blocks, a numeric vector
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
Source
J. H. Lonnquist, C. O. Gardner. (1961) Heterosis in Intervarietal Crosses in Maize and Its Implication in Breeding Procedures. Crop Science, 1, 179-183. Table 1.
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Mohring, Melchinger, Piepho. (2011). REML-Based Diallel Analysis. Crop Science, 51, 470-478. http://doi.org/10.2135/cropsci2010.05.0272
C. O. Gardner and S. A. Eberhart. 1966. Analysis and Interpretation of the Variety Cross Diallel and Related Populations. Biometrics, 22, 439-452. http://doi.org/10.2307/2528181
Examples
data("lonnquist61")
dMod <- lm(Yield ~ H.BAR(Par1, Par2) + VEi(Par1, Par2) +
Hi(Par1, Par2) + SCA(Par1, Par2),
data = lonnquist61)
summary.diallel(dMod, MSE = 7.10, dfr = 60)
anova.diallel(dMod, MSE = 7.10, dfr = 60)
Design matrix for blocks
Description
It creates a disign matrix for block effects (with sum-to-zero constraint). It is used internally
Usage
matBlock(formula)
Arguments
formula |
|
Value
A design matrix for the block effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
matBlock(~hayman54$Block)
Fitting random diallel linear models
Description
Wrapper function for the function 'mmer()' in the 'sommer' package. It can be used to fit random diallel models and retreive variance components for main effects.
Usage
mmer.diallel(formula, Block, Env, fct, data, type = "all")
Arguments
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.'formula' uses the regular R syntax to specify the response variable and the two variables for parentals |
Block |
used to specify an optional variable coding for blocks |
Env |
used to specify an optional variable coding for environments |
data |
a 'data.frame' where to look for explanatory variables |
fct |
a string variable coding for the selected model. 8 main diallel models: Hayman's model 1 (="HAYMAN1"), Hayman's model 2 (="HAYMAN2"), Griffing's model 1 (="GRIFFING1"), Griffing's model 2 (="GRIFFING2"), Griffing's model 3 (="GRIFFING3"), Griffing's model 4 (="GRIFFING4"), Gardner-Eberhart model 2 (="GE2") and Gardner-Eberhart model 3 (="GE3"). The strings "GE2r" and "GE3r" can be used to specify the 'enhanced' GE2 and GE3 models, including the effect of reciprocals (REC). |
type |
a string variable coding for the selected model. It is only used for multi-environment experiments and it is equal to "all" when both the environment and genetical effects are random or "environment" when the environment is random and genetical effects are fixed. |
Value
Returns a data frame of variance components with standard errors
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Covarrubias-Pazaran, G., 2016. Genome-Assisted Prediction of Quantitative Traits Using the R Package sommer. PLOS ONE 11, e0156744. https://doi.org/10.1371/journal.pone.0156744
Examples
data("hayman54")
rMod <- mmer.diallel(Ftime ~ Par1 + Par2, Block = Block,
data = hayman54,
fct = "HAYMAN1")
rMod
Incidence matrices for Diallel model parametrisation
Description
model.matrixDiallel
is useful to build design matrices, according to the user-defined (or default) parameterisation for lm
function. It shares the same syntax of the lm.diallel
function.
Arguments
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.'formula' uses the regular R syntax to specify the response variable and the two variables for parentals |
Block |
used to specify an optional variable coding for blocks |
Env |
used to specify an optional variable coding for environments |
data |
a 'data.frame' where to look for explanatory variables |
fct |
a string variable coding for the selected model. 6 main diallel models: Hayman's model 1 (="HAYMAN1"), Hayman's model 2 (="HAYMAN2"), Griffing's model 1 (="GRIFFING1"), Griffing's model 2 (="GRIFFING2"), Gardner-Eberhart model 2 (="GE2") and Gardner-Eberhart model 3 (="GE3"). The strings "GE2r" and "GE3r" can be used to specify the 'enhanced' GE2 and GE3 models, including the effect of reciprocals (REC). |
Details
model.matrixDiallel creates a design matrix for a diallel model, as specified in the 'fct' argument.
Value
The design matrix for a diallel model as specified in the 'fct' argument.
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("diallelMET")
ModMat <- model.matrixDiallel(Yield ~ Par1 + Par2,
Env, Block, fct= "GE3",
data = diallelMET)
Total Specific Combining Ability
Description
Total SCA to fit Hayman1, Griffing1 and Griffing2 models with lm
function
Usage
tSCA(P1,P2,type = "fix", data)
Arguments
P1 |
|
P2 |
|
type |
|
data |
|
Details
a design matrix of all possible combinations between parentals with selfs but no reciprocals
Value
A design matrix for the tSCA effect
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("hayman54")
dMod<-lm(Ftime~ Block + GCA(Par1,Par2)
+ tSCA(Par1, Par2) + RGCA(Par1, Par2)
+ RSCA(Par1,Par2), data = hayman54)
anova(dMod)
Data for diallel analysis from Zhang (2005)
Description
Data collected in XXX with 5 parents, 2 reps and 2 environments
Usage
data("zhang05")
Format
A data.frame with 60 observations on the following 6 variables.
Par1
male parent, a factor with 5 levels
Par2
female parent, a factor with 5 levels
Block
block, a factor with 2 levels
Combination
combination between environment and block, an integer vector
Env
environment, a factor with 2 levels
Yield
yield, a numeric vector
Author(s)
Andrea Onofri, Niccolo' Terzaroli, Luigi Russi
Source
Zhang, Y., Kang, M.S. and Lamkey, K.R. (2005), DIALLEL-SAS05: A Comprehensive Program for Griffing's and Gardner&Eberhart Analyses. Agron. J., 97: 1097-1106. https://doi.org/10.2134/agronj2004.0260
References
Onofri, A., Terzaroli, N. & Russi, L. Linear models for diallel crosses: a review with R functions. Theor Appl Genet (2020). https://doi.org/10.1007/s00122-020-03716-8
Examples
data("zhang05")
contrasts(zhang05$Block) <- c("contr.sum")
contrasts(zhang05$Env) <- c("contr.sum")
dMod <- lm(Yield ~ Env/Block + H.BAR(Par1, Par2) + VEi(Par1, Par2) +
Hi(Par1, Par2) + SCA(Par1, Par2) +
H.BAR(Par1, Par2):Env + GCA(Par1, Par2):Env +
Hi(Par1, Par2):Env + SCA(Par1, Par2):Env, data = zhang05)
anova(dMod)
#or
dMod2 <- lm(Yield ~ Env/Block + H.BAR(Par1, Par2) + VEi(Par1, Par2) +
Hi(Par1, Par2) + SCA(Par1, Par2), data = zhang05)
summary(dMod2)$coefficients