Multivariate Random Regression of Treatment BLUPs Within Environments
randomRegress.RdUses the G-matrix from an ASReml-R V4 model to decompose variety BLUPs into
efficiency and responsiveness components within each environment,
supporting four conditioning schemes via the type argument.
For any treatment \(j\) with conditioning set \(A_j\), the multivariate conditional normal distribution gives:
$$ \boldsymbol{\beta}_j = \boldsymbol{G}_{A_j A_j}^{-1}\, \boldsymbol{G}_{A_j j} \qquad \tilde{u}_j = u_j - \boldsymbol{\beta}_j^\top \boldsymbol{u}_{A_j} $$
The four built-in conditioning schemes differ only in how \(A_j\) is chosen for each treatment:
"baseline"(default)Every non-first treatment is conditioned on
levs[1]alone. Responsiveness BLUPs are orthogonal to the baseline but may be correlated with each other. The transformed G-matrixTGmatis block-diagonal."sequential"Treatment \(j\) is conditioned on all preceding treatments
levs[1:(j-1)]. This is the Gram-Schmidt orthogonalisation of the BLUPs, equivalent to the \(LDL^\top\) Cholesky decomposition of the G-matrix. All components are mutually orthogonal andTGmatis diagonal, with the Schur complements on the diagonal. Treatment ordering matters."partial"Each treatment is conditioned on all other treatments simultaneously. The diagonal of
TGmatgives the partial genetic variances; off-diagonals are generally non-zero."custom"The conditioning set for each treatment is specified explicitly via the
condargument.
Usage
randomRegress(
model,
term = "us(TSite):Variety",
levs = NULL,
type = "baseline",
cond = NULL,
sep = "-",
pev = TRUE,
...
)Arguments
- model
An ASReml-R V4 model object containing a random Treatment \(\times\) Site \(\times\) Variety term.
- term
Character string giving the full random-effect interaction term exactly as it appears in the model formula, written as
"<struct>(<Group>):<Variety>". The function parses the structure keyword, group factor name, and variety factor name automatically, so the correct strings are used forpredict.asreml().Supported variance structures on the left-hand side:
us(TSite)Unstructured G-matrix — the most general form.
fa(TSite, k)Factor-analytic of order \(k\).
corgh(TSite)Heterogeneous correlation — one correlation parameter shared across groups with group-specific variances.
corh(TSite)Correlation and variance structure for two-group (two-treatment-level) models.
diag(TSite)Diagonal — independent genetic variances per group, zero between-group covariances.
Supported wrappers on the right-hand side (variety factor):
vm(Variety, giv1)Genomic or pedigree relationship matrix via
asreml::vm(). Only the bare factor name is used forpredict.asreml().ide(Variety)Identity-scaled term via
asreml::ide().Variety(no wrapper)Plain factor — the default.
Examples:
term = "us(TSite):Variety" term = "fa(TSite, 2):Variety" term = "corgh(TSite):Variety" term = "corh(TSite):Variety" term = "us(TSite):vm(Variety, giv1)" term = "us(TSite):ide(Variety)"- levs
Character vector of length \(\ge 2\) giving the treatment labels. For
type = "baseline"andtype = "sequential"the first element is the baseline (efficiency) treatment. Fortype = "partial"the ordering does not affect results. Fortype = "custom"the ordering determines which element ofcondapplies to which treatment.- type
Character string selecting the conditioning scheme. One of
"baseline"(default),"sequential","partial", or"custom". See Description for full details of each scheme.- cond
Named list required when
type = "custom". Each element name must be a treatment label fromlevs; each element value is eitherNULL(treatment is unconditional / efficiency) or a character vector of treatment labels fromlevsthat form the conditioning set. Treatments absent fromcondare treated as unconditional. Example for a three-treatment sequential-style custom scheme:- sep
Character separator used inside the composite Treatment-Site factor labels. Defaults to
"-".- pev
Logical. If
TRUE(default) the variance used for HSD computation is the prediction error variance (PEV) of each responsiveness BLUP. IfFALSEit is the posterior variance \(\sigma_{j|A_j}^2 - \text{PEV}\). Ignored for FA models (HSD is alwaysNA).- ...
Additional arguments forwarded to
asreml::predict.asreml()(non-FA terms only).
Value
A named list:
blupsData frame with columns:
Site,Variety, one raw BLUP column per treatment inlevs, oneresp.<lev>column per conditioned treatment, and oneHSD.<lev>column per conditioned treatment (Tukey's HSD on the responsiveness scale;NAfor FA models or absent treatment combinations).TGmatTransformed G-matrix \(\boldsymbol{T}\boldsymbol{G} \boldsymbol{T}^\top\). Unconditional treatments are labelled
eff.<lev>; conditioned treatments are labelledresp.<lev>. Diagonal fortype = "sequential".GmatOriginal G-matrix.
betaNamed list of length equal to the number of conditioned treatments. Each element
beta[["<lev>"]]is an \(n_s \times |A_j|\) matrix of site-specific regression coefficients, with column names equal to the conditioning treatment labels.NAwhere a treatment combination is absent in a site.sigmatNumeric matrix of dimensions \(n_s \times n_{\text{cond}}\) containing the scalar conditional genetic variances \(\sigma_{j|A_j}^2\) for each conditioned treatment at each site.
NAwhere absent.tmatFull transformation matrix \(\boldsymbol{T}\). Lower-triangular for
type = "sequential"; sparse (one non-trivial column per site) fortype = "baseline"; dense fortype = "partial".cond_listThe resolved conditioning structure as a named list, one element per treatment in
levs.typeThe
typeargument used.
Examples
if (FALSE) { # \dontrun{
## Baseline scheme — unstructured G-matrix
res_base <- randomRegress(model, term = "us(TSite):Variety",
levs = c("N0","N1","N2"))
## Sequential (Cholesky) — fully orthogonal components; TGmat is diagonal
res_seq <- randomRegress(model, term = "fa(TSite, 2):Variety",
levs = c("N0","N1","N2"), type = "sequential")
## Heterogeneous correlation structure
res_cor <- randomRegress(model, term = "corgh(TSite):Variety",
levs = c("N0","N1","N2"))
## Genomic relationship matrix (vm wrapper on Variety)
res_vm <- randomRegress(model, term = "us(TSite):vm(Variety, giv1)",
levs = c("N0","N1","N2"))
## Custom conditioning
res_cust <- randomRegress(model, term = "us(TSite):Variety",
levs = c("N0","N1","N2"),
type = "custom",
cond = list(N0 = NULL,
N1 = "N0",
N2 = c("N0","N1")))
} # }