<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Linear mixed models | Ag Prophet</title>
    <link>https://agprophet.netlify.app/tag/linear-mixed-models/</link>
      <atom:link href="https://agprophet.netlify.app/tag/linear-mixed-models/index.xml" rel="self" type="application/rss+xml" />
    <description>Linear mixed models</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Fri, 29 May 2026 09:00:00 -0500</lastBuildDate>
    <image>
      <url>https://agprophet.netlify.app/media/icon_hu4af01c9d488c7bef25f821204732910a_1117_512x512_fill_lanczos_center_3.png</url>
      <title>Linear mixed models</title>
      <link>https://agprophet.netlify.app/tag/linear-mixed-models/</link>
    </image>
    
    <item>
      <title>Network meta-analysis of multi-environment trials with linear mixed models in ASReml-R</title>
      <link>https://agprophet.netlify.app/project/network-meta-asreml/</link>
      <pubDate>Fri, 29 May 2026 09:00:00 -0500</pubDate>
      <guid>https://agprophet.netlify.app/project/network-meta-asreml/</guid>
      <description>


&lt;p&gt;Meta-analysis combines treatment effects across studies to produce a single, more precise summary. The classical version extracts one effect size per study (a difference in means, a log odds ratio, a standardized response) and pools those values. That logic works cleanly for two treatments, but agricultural and biomedical programs rarely test the same two treatments everywhere. They test overlapping subsets: trial A compares treatments 1 and 2, trial B compares 2 and 3, and no single trial contains all treatments at once.&lt;/p&gt;
&lt;p&gt;Network meta-analysis (NMA), also called multiple-treatments meta-analysis, is built for exactly this situation. It estimates and ranks several treatments simultaneously, including pairs that were never compared head to head. It does so by combining direct evidence (comparisons made within a trial) with indirect evidence (comparisons inferred through a shared treatment). If trial A gives 1 versus 2 and trial B gives 2 versus 3, the network supplies an estimate of 1 versus 3 through the common treatment 2.&lt;/p&gt;
&lt;p&gt;This structure is the norm in multi-environment trials, where each site evaluates only a subset of treatments and the resulting study-by-treatment table is sparse and unbalanced. Pairwise meta-analysis handles such data poorly: it discards indirect evidence, analyzes each contrast in isolation, and ignores correlations among treatments within a study. A linear mixed model fitted to the whole network avoids all three problems. It recovers indirect evidence, models the correlation structure explicitly, and shrinks unstable study-level estimates toward the network mean, which stabilizes inference when data are thin.&lt;/p&gt;
&lt;p&gt;This post focuses on summary-level NMA, where each treatment in each trial is represented by a mean and an associated sampling variance. This is the information typically reported in published field trials, particularly in plant pathology. A future post will treat individual plot-level data, which additionally supports spatial models, trial-specific error structures, and plot-level covariates.&lt;/p&gt;
&lt;p&gt;The models below are fitted with ASReml-R, a commercial mixed-model package that excels at flexible variance-covariance structures. That flexibility is what makes the progression from simple to structured covariance models possible within a single, consistent framework.&lt;/p&gt;
&lt;div id=&#34;linear-mixed-models-in-one-paragraph&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Linear mixed models in one paragraph&lt;/h2&gt;
&lt;p&gt;A linear mixed model splits the systematic part of the data into &lt;strong&gt;fixed effects&lt;/strong&gt;, whose individual values we want to estimate (here, treatment means and contrasts), and &lt;strong&gt;random effects&lt;/strong&gt;, which we treat as draws from a distribution and summarize through &lt;strong&gt;variance components&lt;/strong&gt; (here, the study-to-study variability of treatment performance). Fixed-effect estimates are &lt;strong&gt;BLUEs&lt;/strong&gt; (best linear unbiased estimators); random-effect quantities are &lt;strong&gt;BLUPs&lt;/strong&gt; (best linear unbiased predictors). BLUPs are shrunken toward zero by an amount that depends on how much information each study contributes, which is precisely the borrowing of strength that makes NMA work on sparse networks. Variance components are estimated by &lt;strong&gt;restricted maximum likelihood (REML)&lt;/strong&gt;, which corrects the downward bias that ordinary maximum likelihood (ML) introduces when fixed effects are estimated alongside the variances. Everything that follows is a specific choice of which effects are fixed, which are random, and what covariance structure the random effects carry.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;notation-and-the-second-stage-model&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Notation and the second-stage model&lt;/h2&gt;
&lt;p&gt;We follow the notation of &lt;a href=&#34;https://apsjournals.apsnet.org/doi/epdf/10.1094/PHYTO-12-15-0342-RVW&#34;&gt;Madden, Piepho, and Paul (2016)&lt;/a&gt;, referred to below as the original manuscript, and we adopt their model labels (F1, F2, R1 through R5). Let &lt;span class=&#34;math inline&#34;&gt;\(y_{ij}\)&lt;/span&gt; denote the summary result (here, the mean yield) for study &lt;span class=&#34;math inline&#34;&gt;\(i = 1, \dots, K\)&lt;/span&gt; and treatment &lt;span class=&#34;math inline&#34;&gt;\(j = 1, \dots, m\)&lt;/span&gt;. Each summary comes from a completed first-stage analysis and carries an estimated sampling variance &lt;span class=&#34;math inline&#34;&gt;\(s_{ij}^2\)&lt;/span&gt;. The general model is&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
y_{ij} = \eta_{ij} + e_{ij}, \qquad e_{ij} \sim N\!\left(0,\ s_{ij}^2\right),
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;where &lt;span class=&#34;math inline&#34;&gt;\(\eta_{ij}\)&lt;/span&gt; is the linear predictor for study &lt;span class=&#34;math inline&#34;&gt;\(i\)&lt;/span&gt; and treatment &lt;span class=&#34;math inline&#34;&gt;\(j\)&lt;/span&gt;, and &lt;span class=&#34;math inline&#34;&gt;\(e_{ij}\)&lt;/span&gt; is the residual, that is, the estimation error inherited from the first stage. Collecting the treatments of study &lt;span class=&#34;math inline&#34;&gt;\(i\)&lt;/span&gt; into vectors &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{y}_i\)&lt;/span&gt;, &lt;span class=&#34;math inline&#34;&gt;\(\boldsymbol{\eta}_i\)&lt;/span&gt;, and &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{e}_i\)&lt;/span&gt;, the model in matrix form is&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
\mathbf{y}_i = \boldsymbol{\eta}_i + \mathbf{e}_i, \qquad \mathbf{e}_i \sim N\!\left(\mathbf{0},\ \mathbf{R}_i\right),
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;with &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{R}_i = \operatorname{diag}(s_{i1}^2, \dots, s_{im}^2)\)&lt;/span&gt;. The defining feature of a second-stage analysis is that &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{R}_i\)&lt;/span&gt; is &lt;strong&gt;known&lt;/strong&gt;, not estimated: the within-study uncertainty was already quantified in the first stage (there are alternatives to this that are not discussed here). We assume the treatment means within a study are conditionally independent given the study, which is justified for randomized complete block designs when &lt;span class=&#34;math inline&#34;&gt;\(s_{ij}^2\)&lt;/span&gt; is taken as one half of the squared standard error of a difference (see the original manuscript and references therein).&lt;/p&gt;
&lt;p&gt;The models differ only in how the linear predictor &lt;span class=&#34;math inline&#34;&gt;\(\eta_{ij}\)&lt;/span&gt; is structured and in which variance-covariance matrix governs the between-study random effects. Two matrices recur:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&#34;math inline&#34;&gt;\(\boldsymbol{\Omega} = \operatorname{var}(\mathbf{u}_i)\)&lt;/span&gt;, the between-study covariance of the random treatment-by-study deviations &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{u}_i\)&lt;/span&gt;, used when the &lt;strong&gt;study main effect is fixed&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G} = \operatorname{var}(\mathbf{h}_i)\)&lt;/span&gt;, where &lt;span class=&#34;math inline&#34;&gt;\(h_{ij} = \beta_i + u_{ij}\)&lt;/span&gt; combines the random study main effect &lt;span class=&#34;math inline&#34;&gt;\(\beta_i\)&lt;/span&gt; and the interaction &lt;span class=&#34;math inline&#34;&gt;\(u_{ij}\)&lt;/span&gt; into a single random vector &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{h}_i\)&lt;/span&gt;, used when the &lt;strong&gt;study main effect is random&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&#34;loading-packages&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Loading packages&lt;/h4&gt;
&lt;p&gt;We load the working packages and import the wheat fungicide data from the original manuscript, which in turn derive from &lt;a href=&#34;https://apsjournals.apsnet.org/doi/epdf/10.1094/PHYTO-100-2-0160&#34;&gt;Paul et al. (2010)&lt;/a&gt;. That study analyzed wheat yield across 136 field trials conducted over 12 years in 14 U.S. states. Each trial used a randomized complete block design and included at least a no-fungicide control and tebuconazole (Folicur). Other fungicides appeared in varying combinations, with four treatments per trial on average. The authors provide treatment mean yields and their sampling variances, the standard inputs for a second-stage analysis. The first-stage ANOVA has already been performed, so these summaries are the data for the network meta-analysis below.&lt;/p&gt;
&lt;p&gt;The dataset contains:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;trial&lt;/code&gt;: study identifier&lt;/li&gt;
&lt;li&gt;&lt;code&gt;trt&lt;/code&gt;: treatment code (10 = control, 2 to 6 = fungicides)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;yield&lt;/code&gt;: mean yield per treatment in each study (the summary effect size, &lt;span class=&#34;math inline&#34;&gt;\(y_{ij}\)&lt;/span&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;varyld&lt;/code&gt;: within-study sampling variance of the mean (&lt;span class=&#34;math inline&#34;&gt;\(s_{ij}^2\)&lt;/span&gt;, equal to &lt;code&gt;1/wtyld&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;wtyld&lt;/code&gt;: inverse-variance weight (&lt;span class=&#34;math inline&#34;&gt;\(1/s_{ij}^2\)&lt;/span&gt;, used in fitting)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cla&lt;/code&gt;: wheat marketing class (S = soft, W = white), a potential moderator&lt;/li&gt;
&lt;li&gt;&lt;code&gt;group&lt;/code&gt;: study classification based on treatment combinations (13 groups)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;pacman::p_load(
  here,       # find file
  janitor,    # clean column names
  tidyverse,  # data wrangling and visualization
  asreml      # mixed models via REML
)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## Online License checked out Sat May 30 01:02:19 2026&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;importing-and-preparing-the-data&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Importing and preparing the data&lt;/h4&gt;
&lt;p&gt;We import the trial data, standardize the column names, recode the treatment labels, and convert yield from bushels per acre to metric tons per hectare. Because yield is rescaled by a constant &lt;span class=&#34;math inline&#34;&gt;\(c = 0.0628\)&lt;/span&gt;, the sampling variance must be rescaled by &lt;span class=&#34;math inline&#34;&gt;\(c^2\)&lt;/span&gt; so that the weights stay on the correct scale. The weight is the inverse of the rescaled sampling variance.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;dat &amp;lt;- read_csv(here(&amp;quot;content&amp;quot;, &amp;quot;project&amp;quot;, &amp;quot;network meta asreml&amp;quot;, &amp;quot;madden_2016.csv&amp;quot;), show_col_types = FALSE) %&amp;gt;%
  janitor::clean_names() %&amp;gt;%
  mutate(across(c(trial, trt, cla, group), as_factor)) %&amp;gt;%
  mutate(
    trt = fct_recode(trt,
      &amp;quot;Teb&amp;quot;    = &amp;quot;2&amp;quot;,   # tebuconazole (Folicur)
      &amp;quot;Prop&amp;quot;   = &amp;quot;3&amp;quot;,   # propiconazole (Tilt)
      &amp;quot;Prothi&amp;quot; = &amp;quot;4&amp;quot;,   # prothioconazole (Proline)
      &amp;quot;ProTe&amp;quot;  = &amp;quot;5&amp;quot;,   # prothioconazole + tebuconazole (Prosaro)
      &amp;quot;Metc&amp;quot;   = &amp;quot;6&amp;quot;,   # metconazole (Caramba)
      &amp;quot;Chk&amp;quot;    = &amp;quot;10&amp;quot;   # no-fungicide control
    ),
    yield  = yield * 0.0628,            # bu/acre -&amp;gt; t/ha (scale by c)
    varyld = varyld * (0.0628^2),       # variance scales by c^2
    wtyld  = 1 / varyld                 # inverse-variance weight
  )

trt_levels &amp;lt;- levels(dat$trt)
n_trt &amp;lt;- length(trt_levels)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The six treatments are the control (&lt;code&gt;Chk&lt;/code&gt;) and five fungicides: tebuconazole (&lt;code&gt;Teb&lt;/code&gt;), propiconazole (&lt;code&gt;Prop&lt;/code&gt;), prothioconazole (&lt;code&gt;Prothi&lt;/code&gt;), prothioconazole plus tebuconazole (&lt;code&gt;ProTe&lt;/code&gt;), and metconazole (&lt;code&gt;Metc&lt;/code&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;fitting-weighted-second-stage-models-in-asreml-r&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Fitting weighted second-stage models in ASReml-R&lt;/h2&gt;
&lt;p&gt;Every model below shares the same machinery for the known within-study variance &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{R}_i\)&lt;/span&gt;. Two arguments work together:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;weights = &#34;wtyld&#34;&lt;/code&gt; tells ASReml-R that observation &lt;span class=&#34;math inline&#34;&gt;\(ij\)&lt;/span&gt; has weight &lt;span class=&#34;math inline&#34;&gt;\(w_{ij} = 1/s_{ij}^2\)&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;family = asr_gaussian(dispersion = 1)&lt;/code&gt; fixes the residual scale parameter at 1 rather than estimating it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Together these set the residual variance of &lt;span class=&#34;math inline&#34;&gt;\(y_{ij}\)&lt;/span&gt; to &lt;span class=&#34;math inline&#34;&gt;\(1/w_{ij} = s_{ij}^2\)&lt;/span&gt;, which is exactly &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{R}_i = \operatorname{diag}(s_{ij}^2)\)&lt;/span&gt;. This is the central trick of summary-level meta-analysis: the first-stage uncertainties enter as fixed, known quantities, and REML is left to estimate only the between-study variance components. Forgetting to fix the dispersion would let the model rescale the supplied weights, which would no longer reproduce a meta-analysis.&lt;/p&gt;
&lt;p&gt;ASReml-R fits all models by REML. The original manuscript gives the full model derivations and the corresponding SAS code; we reproduce a representative subset here and concentrate on the link between each formula, its covariance structure, and its R implementation.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;model-f1-fixed-study-and-treatment-effects-homogeneous-between-study-variance&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Model F1: fixed study and treatment effects, homogeneous between-study variance&lt;/h2&gt;
&lt;p&gt;This is Equation 5 of the original manuscript. Both treatment and study are fixed, and a random treatment-by-study interaction absorbs the between-study variability of treatment performance:&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
y_{ij} = \theta + \beta_i + \tau_j + u_{ij} + e_{ij},
\qquad u_{ij} \sim N\!\left(0,\ \sigma_u^2\right).
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here &lt;span class=&#34;math inline&#34;&gt;\(\theta\)&lt;/span&gt; is the intercept, &lt;span class=&#34;math inline&#34;&gt;\(\beta_i\)&lt;/span&gt; the fixed study main effect, &lt;span class=&#34;math inline&#34;&gt;\(\tau_j\)&lt;/span&gt; the fixed treatment main effect, and &lt;span class=&#34;math inline&#34;&gt;\(u_{ij}\)&lt;/span&gt; the random study-by-treatment deviation. “Homogeneous” means a single &lt;span class=&#34;math inline&#34;&gt;\(\sigma_u^2\)&lt;/span&gt; for all treatments, so the between-study covariance matrix is &lt;span class=&#34;math inline&#34;&gt;\(\boldsymbol{\Omega} = \sigma_u^2 \mathbf{I}_m\)&lt;/span&gt;, with no covariance among treatments. Because study is fixed, treatment contrasts are estimated from &lt;strong&gt;intrastudy information only&lt;/strong&gt;: each &lt;span class=&#34;math inline&#34;&gt;\(\tau_j - \tau_{j&amp;#39;}\)&lt;/span&gt; rests on comparisons made within the same trial, which respects the principle of concurrent control.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mod.f1 &amp;lt;- asreml(
  fixed  = yield ~ trt + trial,                 # fixed treatment and study
  random = ~ trial:trt,                          # random study-by-treatment, single variance
  weights = &amp;quot;wtyld&amp;quot;,                             # w_ij = 1 / s_ij^2
  data    = dat,
  family  = asr_gaussian(dispersion = 1),        # fix residual scale at 1 (R known)
  na.action = na.method(x = &amp;quot;omit&amp;quot;, y = &amp;quot;omit&amp;quot;),
  trace   = FALSE
)&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;variance-component-estimates&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Variance component estimates&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;summary(mod.f1)$varcomp&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##            component   std.error  z.ratio bound %ch
## trial:trt 0.02527846 0.003186638 7.932642     P   0
## units!R   1.00000000          NA       NA     F   0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The single between-study variance &lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma_u^2 \approx 0.025\)&lt;/span&gt; (in &lt;span class=&#34;math inline&#34;&gt;\(\text{t}^2/\text{ha}^2\)&lt;/span&gt;) indicates moderate heterogeneity in treatment performance across trials. This matches the value in the original manuscript and an independent SAS run on their code. Intuitively, &lt;span class=&#34;math inline&#34;&gt;\(\sigma_u^2\)&lt;/span&gt; measures how much a treatment’s advantage over the grand pattern moves from one environment to the next.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;wald-test-for-fixed-effects&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Wald test for fixed effects&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;wald(mod.f1)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [0;34mWald tests for fixed effects.[0m
## [0;34mResponse: yield[0m
## [0;34mTerms added sequentially; adjusted for those above.[0m
## 
##                Df Sum of Sq Wald statistic Pr(Chisq)    
## (Intercept)     1    167025         167025 &amp;lt; 2.2e-16 ***
## trt             5       619            619 &amp;lt; 2.2e-16 ***
## trial         135     17292          17292 &amp;lt; 2.2e-16 ***
## residual (MS)             1                             
## ---
## Signif. codes:  0 &amp;#39;***&amp;#39; 0.001 &amp;#39;**&amp;#39; 0.01 &amp;#39;*&amp;#39; 0.05 &amp;#39;.&amp;#39; 0.1 &amp;#39; &amp;#39; 1&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Both fixed effects (treatment and study) are highly significant (&lt;span class=&#34;math inline&#34;&gt;\(p &amp;lt; 0.001\)&lt;/span&gt;), so we omit the detailed Wald tables for the remaining models.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;treatment-predictions-and-standard-errors&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Treatment predictions and standard errors&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;predict(mod.f1, classify = &amp;quot;trt&amp;quot;, sed = TRUE, vcov = TRUE, trace = FALSE)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## $pvals
## 
## Notes:
## [0;34m- The predictions are obtained by averaging across the hypertable
##   calculated from model terms constructed solely from factors in
##   the averaging and classify sets.
## - Use &amp;#39;average&amp;#39; to move ignored factors into the averaging set.
## - The simple averaging set: trial
## [0m
##      trt predicted.value  std.error    status
## 1    Teb        3.809541 0.01271892 Estimable
## 2   Prop        3.733358 0.02835202 Estimable
## 3 Prothi        3.962010 0.02870707 Estimable
## 4  ProTe        3.966686 0.02071686 Estimable
## 5   Metc        3.969842 0.02108578 Estimable
## 6    Chk        3.535234 0.01271892 Estimable
## 
## $avsed
##        min       mean        max 
## 0.01734278 0.02959465 0.04025299 
## 
## $vcov
## 6 x 6 Matrix of class &amp;quot;dspMatrix&amp;quot;
##              [,1]         [,2]         [,3]         [,4]         [,5]
## [1,] 1.617709e-04 6.773120e-06 4.562681e-06 7.216567e-06 5.934914e-06
## [2,] 6.773120e-06 8.038373e-04 3.815260e-06 1.636587e-05 2.456766e-05
## [3,] 4.562681e-06 3.815260e-06 8.240960e-04 5.438035e-05 3.340544e-05
## [4,] 7.216567e-06 1.636587e-05 5.438035e-05 4.291882e-04 5.754453e-05
## [5,] 5.934914e-06 2.456766e-05 3.340544e-05 5.754453e-05 4.446103e-04
## [6,] 1.138491e-05 6.773120e-06 4.562681e-06 7.216567e-06 5.934914e-06
##              [,6]
## [1,] 1.138491e-05
## [2,] 6.773120e-06
## [3,] 4.562681e-06
## [4,] 7.216567e-06
## [5,] 5.934914e-06
## [6,] 1.617709e-04
## 
## $sed
## 6 x 6 Matrix of class &amp;quot;dspMatrix&amp;quot;
##            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
## [1,]         NA 0.03085550 0.03125286 0.02401095 0.02438260 0.01734278
## [2,] 0.03085550         NA 0.04025299 0.03464526 0.03463109 0.03085550
## [3,] 0.03125286 0.04025299         NA 0.03383081 0.03466836 0.03125286
## [4,] 0.02401095 0.03464526 0.03383081         NA 0.02754468 0.02401095
## [5,] 0.02438260 0.03463109 0.03466836 0.02754468         NA 0.02438260
## [6,] 0.01734278 0.03085550 0.03125286 0.02401095 0.02438260         NA&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Because treatment is a fixed effect, the predicted treatment means &lt;span class=&#34;math inline&#34;&gt;\(\hat\mu_j = \hat\theta + \hat\tau_j\)&lt;/span&gt; are BLUEs, not BLUPs: they are estimated, not shrunken. The output has four parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pvals&lt;/code&gt;: the predicted mean yield per treatment with its standard error. For &lt;code&gt;Teb&lt;/code&gt; the estimate is near 3.81 t/ha.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;avsed&lt;/code&gt;: minimum, mean, and maximum of the standard errors of differences (SEDs) between treatment means, a quick summary of comparison precision.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;vcov&lt;/code&gt;: the variance-covariance matrix of the treatment-mean estimates, with variances on the diagonal and covariances off it. This is the object used to build confidence intervals and custom contrasts.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sed&lt;/code&gt;: the full matrix of SEDs for every pair of treatments, which is what governs significance of pairwise differences.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These predictions reproduce the means reported in the original manuscript to within rounding. Small differences in standard errors relative to their SAS output reflect minor differences in implementation and parameterization.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;model-f2-treatment-specific-between-study-variances&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Model F2: treatment-specific between-study variances&lt;/h2&gt;
&lt;p&gt;Model F2 relaxes the single-variance assumption of F1 by giving each treatment its own between-study variance. Study remains fixed, but the interaction now follows a diagonal structure:&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
u_{ij} \sim N\!\left(0,\ \sigma_{u(j)}^2\right),
\qquad
\boldsymbol{\Omega} = \operatorname{diag}\!\left(\sigma_{u(1)}^2, \dots, \sigma_{u(m)}^2\right).
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This lets the model express that some treatments are stable across environments while others are not, while still assuming no covariance among treatments within a study. It is implemented with &lt;code&gt;diag(trt):trial&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mod.f2 &amp;lt;- asreml(
  fixed  = yield ~ trial + trt,
  random = ~ diag(trt):trial,                    # one variance per treatment, no covariances
  weights = &amp;quot;wtyld&amp;quot;,
  data    = dat,
  na.action = na.method(x = &amp;quot;omit&amp;quot;, y = &amp;quot;omit&amp;quot;),
  family  = asr_gaussian(dispersion = 1),
  maxiter = 100,
  trace   = FALSE
)

mod.f2 &amp;lt;- update.asreml(mod.f2)                   # one extra round of REML to reach convergence&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A single &lt;code&gt;update.asreml()&lt;/code&gt; call carries the REML iterations to convergence. The original manuscript notes that diagonal and unstructured models sometimes need different starting values for the non-residual variances before they converge.&lt;/p&gt;
&lt;div id=&#34;variance-component-estimates-1&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Variance component estimates&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;summary(mod.f2)$varcomp&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##                         component   std.error   z.ratio bound %ch
## trt:trial!trt_Teb    2.114026e-02 0.006998122 3.0208481     P 0.0
## trt:trial!trt_Prop   2.411790e-02 0.010655578 2.2634057     P 0.0
## trt:trial!trt_Prothi 6.295609e-08          NA        NA     B  NA
## trt:trial!trt_ProTe  1.831270e-02 0.007180807 2.5502286     P 0.0
## trt:trial!trt_Metc   1.598409e-03 0.004718168 0.3387775     P 0.2
## trt:trial!trt_Chk    6.203328e-02 0.011744836 5.2817497     P 0.0
## units!R              1.000000e+00          NA        NA     F 0.0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The estimates quantify treatment-specific heterogeneity on the yield scale. They range from near zero (for example &lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma_{u(\text{Prothi})}^2\)&lt;/span&gt;) to roughly 0.06 for the control (&lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma_{u(\text{Chk})}^2\)&lt;/span&gt;), with tebuconazole near 0.021. The control varies most across trials, while the fungicides show moderate heterogeneity. The practical reading is that treatments differ not only in average yield but also in how consistently they perform across environments, which is itself a disease management-relevant information.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;treatment-predictions-and-standard-errors-1&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Treatment predictions and standard errors&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;predict(mod.f2, classify = &amp;quot;trt&amp;quot;, sed = TRUE, vcov = TRUE, trace = FALSE)$pvals&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## 
## Notes:
## [0;34m- The predictions are obtained by averaging across the hypertable
##   calculated from model terms constructed solely from factors in
##   the averaging and classify sets.
## - Use &amp;#39;average&amp;#39; to move ignored factors into the averaging set.
## - The simple averaging set: trial
## [0m
##      trt predicted.value  std.error    status
## 1    Teb        3.810066 0.01266784 Estimable
## 2   Prop        3.740635 0.02792307 Estimable
## 3 Prothi        3.952945 0.02247957 Estimable
## 4  ProTe        3.968788 0.01992607 Estimable
## 5   Metc        3.977343 0.01781479 Estimable
## 6    Chk        3.536230 0.01300835 Estimable&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Predicted means barely move relative to F1 (changes below 0.01 t/ha). Standard errors generally shrink under F2 for treatments with small between-study variance (for example &lt;code&gt;Metc&lt;/code&gt; and &lt;code&gt;Prothi&lt;/code&gt;), because the model no longer inflates their precision to match the most variable treatment.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;comparing-model-f1-and-model-f2&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Comparing Model F1 and Model F2&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mods.asr &amp;lt;- list(mod.f1, mod.f2)
asremlPlus::infoCriteria(mods.asr)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##   fixedDF varDF NBound       AIC       BIC   loglik
## 1       0     1      1 -615.9944 -611.9613 308.9972
## 2       0     5      2 -637.0880 -616.9226 323.5440&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;F2 has the smaller AIC and is preferred. The comparison is valid because F1 and F2 share the same fixed-effects structure (&lt;code&gt;yield ~ trial + trt&lt;/code&gt;). This is the key rule for REML-based model selection: &lt;strong&gt;AIC and likelihood ratio tests are meaningful only among models with identical fixed effects&lt;/strong&gt;, because REML conditions the likelihood on the fixed-effects design. The fixed-study models (F1, F2) and the random-study models (R1 through R5) therefore cannot be compared by AIC (there are other approximations that enable AIC-based model comparison with different fixed-effects; not discussed here), since they differ in whether study is fixed or random.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;model-r1-random-study-effects-compound-symmetry&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Model R1: random study effects, compound symmetry&lt;/h2&gt;
&lt;p&gt;Model R1 makes the study main effect random, &lt;span class=&#34;math inline&#34;&gt;\(\beta_i \sim N(0, \sigma_\beta^2)\)&lt;/span&gt;, in addition to the random interaction &lt;span class=&#34;math inline&#34;&gt;\(u_{ij} \sim N(0, \sigma_u^2)\)&lt;/span&gt;. This is the meta-analytic analogue of an incomplete block design with random blocks. Making study random has one decisive consequence: treatment contrasts now recover &lt;strong&gt;both intrastudy and interstudy information&lt;/strong&gt;, because a treatment that appears in many trials borrows strength from the random study effects it shares with other treatments. The cost is the assumption that studies behave like draws from a population, which is reasonable for coordinated multi-site programs like this one but is debated when studies are heterogeneous in origin.&lt;/p&gt;
&lt;p&gt;Following the original manuscript, we combine the two random effects into &lt;span class=&#34;math inline&#34;&gt;\(h_{ij} = \beta_i + u_{ij}\)&lt;/span&gt; so that the linear predictor is&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
y_{ij} = \theta + \tau_j + h_{ij} + e_{ij},
\qquad \mathbf{h}_i \sim N(\mathbf{0}, \mathbf{G}).
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Under compound symmetry (CS), every treatment within a study shares the same random study effect, so all treatments are equally correlated:&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
\operatorname{var}(h_{ij}) = \sigma_\beta^2 + \sigma_u^2,
\qquad
\operatorname{cov}(h_{ij}, h_{ij&amp;#39;}) = \sigma_\beta^2,
\qquad
\rho = \frac{\sigma_\beta^2}{\sigma_\beta^2 + \sigma_u^2}.
\]&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mod.r1 &amp;lt;- asreml(
  fixed  = yield ~ trt,                           # only treatment is fixed now
  random = ~ trial + trt:trial,                   # random study + random interaction = CS
  weights = &amp;quot;wtyld&amp;quot;,
  data    = dat,
  family  = asr_gaussian(dispersion = 1),
  maxiter = 100,
  na.action = na.method(x = &amp;quot;omit&amp;quot;, y = &amp;quot;omit&amp;quot;),
  trace = FALSE
)&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;variance-component-estimates-2&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Variance component estimates&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;sum.r1 &amp;lt;- summary(mod.r1)$varcomp; sum.r1&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##            component   std.error  z.ratio bound %ch
## trial     1.53821099 0.188845455 8.145343     P   0
## trt:trial 0.02528859 0.003187579 7.933479     P   0
## units!R   1.00000000          NA       NA     F   0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The random statement specifies the covariance structure of &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{h}_i\)&lt;/span&gt;, which is &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt;. The model estimates three quantities: the between-study (study main effect) variance &lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma_\beta^2\)&lt;/span&gt;, the treatment-by-study interaction variance &lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma_u^2\)&lt;/span&gt;, and the within-study residual variance, which is held at 1. Under CS the off-diagonal of &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt; equals &lt;span class=&#34;math inline&#34;&gt;\(\sigma_\beta^2\)&lt;/span&gt;; in the more general compound-symmetry parameterization this covariance may be negative, although here it is a genuine variance and is therefore non-negative.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;the-g-matrix&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;The G matrix&lt;/h4&gt;
&lt;p&gt;We assemble &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt; from the two variance components. The CS structure is &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G} = \sigma_\beta^2 \mathbf{J}_m + \sigma_u^2 \mathbf{I}_m\)&lt;/span&gt;, where &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{J}_m\)&lt;/span&gt; is the all-ones matrix and &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{I}_m\)&lt;/span&gt; the identity.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;var_beta &amp;lt;- sum.r1[&amp;quot;trial&amp;quot;,     &amp;quot;component&amp;quot;]      # sigma_beta^2 (off-diagonal)
var_u    &amp;lt;- sum.r1[&amp;quot;trt:trial&amp;quot;, &amp;quot;component&amp;quot;]      # sigma_u^2 (adds to diagonal)
I_mat &amp;lt;- diag(n_trt)
J_mat &amp;lt;- matrix(1, n_trt, n_trt)
G &amp;lt;- var_beta * J_mat + var_u * I_mat
rownames(G) &amp;lt;- colnames(G) &amp;lt;- trt_levels&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;https://agprophet.netlify.app/project/network-meta-asreml/index.en_files/figure-html/r1-gplot-1.png&#34; alt=&#34;&#34; width=&#34;672&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;The matrix has equal diagonal entries &lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma_\beta^2 + \hat\sigma_u^2\)&lt;/span&gt; and equal off-diagonal entries &lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma_\beta^2\)&lt;/span&gt;. The decomposition separates a shared component (&lt;span class=&#34;math inline&#34;&gt;\(\sigma_\beta^2\)&lt;/span&gt;, common to all treatments in a study) from a treatment-specific deviation (&lt;span class=&#34;math inline&#34;&gt;\(\sigma_u^2\)&lt;/span&gt;). Constant variance plus constant covariance is the signature of compound symmetry.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;treatment-predictions-and-standard-errors-2&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Treatment predictions and standard errors&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;predict(mod.r1, classify = &amp;quot;trt&amp;quot;, sed = TRUE, vcov = TRUE, trace = FALSE)$pvals&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## 
## Notes:
## [0;34m- The predictions are obtained by averaging across the hypertable
##   calculated from model terms constructed solely from factors in
##   the averaging and classify sets.
## - Use &amp;#39;average&amp;#39; to move ignored factors into the averaging set.
## - The ignored set: trial
## [0m
##      trt predicted.value std.error    status
## 1    Teb        3.807871 0.1079718 Estimable
## 2   Prop        3.732877 0.1108996 Estimable
## 3 Prothi        3.962304 0.1109909 Estimable
## 4  ProTe        3.966229 0.1092001 Estimable
## 5   Metc        3.969550 0.1092708 Estimable
## 6    Chk        3.533565 0.1079718 Estimable&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These reproduce the SAS results. Note that the treatment means remain BLUEs (treatment is fixed), but the study and interaction effects &lt;span class=&#34;math inline&#34;&gt;\(h_{ij}\)&lt;/span&gt; are now BLUPs: shrunken predictions whose contribution to the treatment means recovers interstudy information.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;model-r2-heterogeneous-compound-symmetry&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Model R2: heterogeneous compound symmetry&lt;/h2&gt;
&lt;p&gt;Model R2 keeps the single correlation of CS but lets each treatment have its own variance. This is heterogeneous compound symmetry (CSH):&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
\operatorname{var}(h_{ij}) = \sigma_{\tau(j)}^2,
\qquad
\operatorname{cov}(h_{ij}, h_{ij&amp;#39;}) = \rho\,\sigma_{\tau(j)}\,\sigma_{\tau(j&amp;#39;)}.
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;A single correlation &lt;span class=&#34;math inline&#34;&gt;\(\rho\)&lt;/span&gt; links all treatments, but the diagonal is now free. It is implemented with &lt;code&gt;corh(trt):trial&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mod.r2 &amp;lt;- asreml(
  fixed  = yield ~ trt,
  random = ~ corh(trt):trial,                     # heterogeneous CS: free variances, one rho
  weights = &amp;quot;wtyld&amp;quot;,
  data    = dat,
  family  = asr_gaussian(dispersion = 1),
  maxiter = 200,
  na.action = na.method(x = &amp;quot;omit&amp;quot;, y = &amp;quot;omit&amp;quot;),
  trace   = FALSE
)&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;variance-component-estimates-3&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Variance component estimates&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;sum.r2 &amp;lt;- summary(mod.r2)$varcomp; sum.r2&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##                      component   std.error    z.ratio bound %ch
## trt:trial!trt!cor    0.9845368 0.002722033 361.691658     U 0.0
## trt:trial!trt_Teb    1.5430249 0.190560380   8.097302     P 0.0
## trt:trial!trt_Prop   1.5353601 0.200817650   7.645543     P 0.0
## trt:trial!trt_Prothi 1.5423651 0.204580806   7.539149     P 0.1
## trt:trial!trt_ProTe  1.5165437 0.192193963   7.890694     P 0.1
## trt:trial!trt_Metc   1.4375122 0.183292345   7.842729     P 0.1
## trt:trial!trt_Chk    1.6763459 0.207330711   8.085372     P 0.0
## units!R              1.0000000          NA         NA     F 0.0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With six treatments the model estimates six treatment-specific variances (rows ending in &lt;code&gt;trt_...&lt;/code&gt;), one shared correlation &lt;span class=&#34;math inline&#34;&gt;\(\hat\rho\)&lt;/span&gt; (the row ending in &lt;code&gt;cor&lt;/code&gt;), and the fixed residual variance. CSH generalizes the equal-variance assumption of CS while retaining a single, interpretable correlation across treatments, so it adds &lt;span class=&#34;math inline&#34;&gt;\(m - 1\)&lt;/span&gt; parameters relative to CS (seven non-residual parameters here versus two).&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;the-g-matrix-1&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;The G matrix&lt;/h4&gt;
&lt;p&gt;We rebuild &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt; from the variances and the shared correlation, &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G} = \mathbf{D}^{1/2}\mathbf{C}\mathbf{D}^{1/2}\)&lt;/span&gt;, where &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{D} = \operatorname{diag}(\sigma_{\tau(j)}^2)\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{C}\)&lt;/span&gt; is a correlation matrix with &lt;span class=&#34;math inline&#34;&gt;\(\rho\)&lt;/span&gt; off the diagonal.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;variances &amp;lt;- sum.r2[!grepl(&amp;quot;(cor|R)$&amp;quot;, rownames(sum.r2)), 1]
rho       &amp;lt;- sum.r2[grepl(&amp;quot;cor$&amp;quot;, rownames(sum.r2)), 1]
G &amp;lt;- diag(1, n_trt)
G[upper.tri(G)] &amp;lt;- rho
G[lower.tri(G)] &amp;lt;- t(G)[lower.tri(G)]
G &amp;lt;- diag(sqrt(variances)) %*% G %*% diag(sqrt(variances))
rownames(G) &amp;lt;- colnames(G) &amp;lt;- trt_levels&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;https://agprophet.netlify.app/project/network-meta-asreml/index.en_files/figure-html/r2-gplot-1.png&#34; alt=&#34;&#34; width=&#34;672&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;The diagonal now varies by treatment, while the correlation that ties treatments together is constant. CSH is the natural step up from CS when treatments differ in stability but their pairwise relationships are roughly uniform.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;treatment-predictions-and-standard-errors-3&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Treatment predictions and standard errors&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;predict(mod.r2, classify = &amp;quot;trt&amp;quot;, sed = TRUE, vcov = TRUE, trace = FALSE)$pvals&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## 
## Notes:
## [0;34m- The predictions are obtained by averaging across the hypertable
##   calculated from model terms constructed solely from factors in
##   the averaging and classify sets.
## - Use &amp;#39;average&amp;#39; to move ignored factors into the averaging set.
## - The ignored set: trial
## [0m
##      trt predicted.value std.error    status
## 1    Teb        3.806563 0.1072693 Estimable
## 2   Prop        3.732439 0.1098537 Estimable
## 3 Prothi        3.964428 0.1102102 Estimable
## 4  ProTe        3.966996 0.1075672 Estimable
## 5   Metc        3.971398 0.1048453 Estimable
## 6    Chk        3.537911 0.1117421 Estimable&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These again match the SAS output.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;model-r3-unstructured-covariance&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Model R3: unstructured covariance&lt;/h2&gt;
&lt;p&gt;Model R3 places no constraints on &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt;. Every treatment has its own variance and every pair its own covariance:&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
\mathbf{G} = \boldsymbol{\Sigma}_{\text{UN}}, \qquad
g_{jj&amp;#39;} \text{ free for all } j \le j&amp;#39;.
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This unstructured (UN) form is the most flexible and the most demanding, with &lt;span class=&#34;math inline&#34;&gt;\(m(m+1)/2 = 21\)&lt;/span&gt; free covariance parameters for six treatments. It is implemented with &lt;code&gt;us(trt):trial&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mod.r3 &amp;lt;- asreml(
  fixed  = yield ~ trt,
  random = ~ us(trt):trial,                        # unstructured: every variance and covariance free
  weights = &amp;quot;wtyld&amp;quot;,
  data    = dat,
  family  = asr_gaussian(dispersion = 1),
  maxiter = 100,
  na.action = na.method(x = &amp;quot;omit&amp;quot;, y = &amp;quot;omit&amp;quot;),
  trace = FALSE
)

mod.r3 &amp;lt;- update.asreml(mod.r3)                   # one extra round of REML to reach convergence
mod.r3 &amp;lt;- update.asreml(mod.r3)                   
mod.r3 &amp;lt;- update.asreml(mod.r3)                   &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The unstructured model converges slowly on this network and can be sensitive to starting values (which we did not specify here, but could naturally be the case).&lt;/p&gt;
&lt;div id=&#34;variance-component-estimates-4&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Variance component estimates&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;sum.r3 &amp;lt;- summary(mod.r3)$varcomp; sum.r3&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##                             component std.error  z.ratio bound %ch
## trt:trial!trt_Teb:Teb        1.534299 0.1894087 8.100465     ?   0
## trt:trial!trt_Prop:Teb       1.522754 0.1897824 8.023683     ?   0
## trt:trial!trt_Prop:Prop      1.540293 0.1983300 7.766314     ?   0
## trt:trial!trt_Prothi:Teb     1.511777 0.1892854 7.986761     ?   0
## trt:trial!trt_Prothi:Prop    1.512370 0.1919324 7.879702     ?   0
## trt:trial!trt_Prothi:Prothi  1.528648 0.1989188 7.684782     ?   0
## trt:trial!trt_ProTe:Teb      1.514823 0.1880823 8.054048     ?   0
## trt:trial!trt_ProTe:Prop     1.503421 0.1897357 7.923764     ?   0
## trt:trial!trt_ProTe:Prothi   1.525460 0.1919241 7.948247     ?   0
## trt:trial!trt_ProTe:ProTe    1.533252 0.1937005 7.915582     ?   0
## trt:trial!trt_Metc:Teb       1.472498 0.1826934 8.059945     ?   0
## trt:trial!trt_Metc:Prop      1.476620 0.1854098 7.964088     ?   0
## trt:trial!trt_Metc:Prothi    1.486025 0.1862295 7.979533     ?   0
## trt:trial!trt_Metc:ProTe     1.480920 0.1854530 7.985419     ?   0
## trt:trial!trt_Metc:Metc      1.446315 0.1828574 7.909525     ?   0
## trt:trial!trt_Chk:Teb        1.580484 0.1952287 8.095554     ?   0
## trt:trial!trt_Chk:Prop       1.587587 0.1979974 8.018223     ?   0
## trt:trial!trt_Chk:Prothi     1.556287 0.1964013 7.924017     ?   0
## trt:trial!trt_Chk:ProTe      1.540363 0.1938824 7.944832     ?   0
## trt:trial!trt_Chk:Metc       1.518949 0.1897416 8.005355     ?   0
## trt:trial!trt_Chk:Chk        1.674339 0.2065604 8.105809     ?   0
## units!R                      1.000000        NA       NA     F   0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The unstructured model estimates 6 treatment variances, 15 treatment-by-treatment covariances, and the fixed residual, for 21 free covariance parameters. It is the saturated covariance model and imposes no assumptions on &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt;, which makes it a useful upper reference for how much structure the data can support.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;the-g-matrix-2&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;The G matrix&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;G &amp;lt;- matrix(0, n_trt, n_trt)
G[upper.tri(G, diag = TRUE)] &amp;lt;- sum.r3[grep(&amp;quot;trt&amp;quot;, rownames(sum.r3)), 1]
G[lower.tri(G, diag = FALSE)] &amp;lt;- t(G)[lower.tri(t(G), diag = FALSE)]
rownames(G) &amp;lt;- colnames(G) &amp;lt;- trt_levels&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;https://agprophet.netlify.app/project/network-meta-asreml/index.en_files/figure-html/r3-gplot-1.png&#34; alt=&#34;&#34; width=&#34;672&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;The estimated &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt; closely matches the SAS output from the original manuscript.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;treatment-predictions-and-standard-errors-4&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Treatment predictions and standard errors&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;predict(mod.r3, classify = &amp;quot;trt&amp;quot;, sed = TRUE, vcov = TRUE, trace = FALSE)$pvals&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## 
## Notes:
## [0;34m- The predictions are obtained by averaging across the hypertable
##   calculated from model terms constructed solely from factors in
##   the averaging and classify sets.
## - Use &amp;#39;average&amp;#39; to move ignored factors into the averaging set.
## - The ignored set: trial
## [0m
##      trt predicted.value std.error    status
## 1    Teb        3.807709 0.1069374 Estimable
## 2   Prop        3.734442 0.1093408 Estimable
## 3 Prothi        3.954652 0.1087683 Estimable
## 4  ProTe        3.979865 0.1080307 Estimable
## 5   Metc        3.985435 0.1048532 Estimable
## 6    Chk        3.535294 0.1116977 Estimable&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Treatment means and standard errors are very close to the SAS-based analysis, with small numerical differences from implementation details.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;model-r4-first-order-factor-analytic-fa1&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Model R4: first-order factor analytic (FA1)&lt;/h2&gt;
&lt;p&gt;The simple structures (R1, R2) may underfit, while the unstructured model (R3) spends 21 parameters and can overfit a sparse network. Factor-analytic (FA) models occupy the middle ground. They approximate &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt; with a low-rank term plus a diagonal, which captures the dominant covariance pattern with far fewer parameters. The FA approach was introduced for genotype-by-environment data by &lt;a href=&#34;#&#34;&gt;Piepho (1997)&lt;/a&gt; and developed by Smith, Cullis, and Thompson and others; the original manuscript applies it to NMA.&lt;/p&gt;
&lt;p&gt;A first-order factor analytic structure writes&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
\mathbf{G} = \boldsymbol{\lambda}\boldsymbol{\lambda}^\top + \boldsymbol{\Psi},
\qquad
g_{jj} = \lambda_j^2 + \psi_j,
\qquad
g_{jj&amp;#39;} = \lambda_j \lambda_{j&amp;#39;},
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;where &lt;span class=&#34;math inline&#34;&gt;\(\boldsymbol{\lambda} = (\lambda_1, \dots, \lambda_m)^\top\)&lt;/span&gt; are the treatment loadings on a single latent factor, and &lt;span class=&#34;math inline&#34;&gt;\(\boldsymbol{\Psi} = \operatorname{diag}(\psi_1, \dots, \psi_m)\)&lt;/span&gt; holds the treatment-specific (uniqueness) variances. The shared latent factor generates all covariances, so a treatment’s behavior across studies is summarized by how strongly it loads on one common dimension. It is implemented with &lt;code&gt;fa(trt, 1):trial&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mod.r4 &amp;lt;- asreml(
  fixed  = yield ~ trt,
  random = ~ fa(trt, 1):trial,                     # one latent factor + diagonal uniqueness
  weights = &amp;quot;wtyld&amp;quot;,
  family  = asr_gaussian(dispersion = 1),
  data    = dat,
  na.action = na.method(x = &amp;quot;omit&amp;quot;, y = &amp;quot;omit&amp;quot;),
  trace   = FALSE
)
mod.r4 &amp;lt;- update.asreml(mod.r4)                     # extra REML round for convergence&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;variance-component-estimates-5&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Variance component estimates&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;sum.r4 &amp;lt;- summary(mod.r4)$varcomp; sum.r4&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##                                component   std.error    z.ratio bound %ch
## fa(trt, 1):trial!Teb!var    0.0207547924 0.006873262  3.0196421     P 0.0
## fa(trt, 1):trial!Prop!var   0.0234861593 0.010488692  2.2391886     P 0.0
## fa(trt, 1):trial!Prothi!var 0.0000000000          NA         NA     F  NA
## fa(trt, 1):trial!ProTe!var  0.0190031077 0.007254230  2.6195898     P 0.0
## fa(trt, 1):trial!Metc!var   0.0007040128 0.004456461  0.1579758     P 0.2
## fa(trt, 1):trial!Chk!var    0.0596499167 0.011548078  5.1653547     P 0.0
## fa(trt, 1):trial!Teb!fa1    1.2332963001 0.046228188 26.6784478     P 0.0
## fa(trt, 1):trial!Prop!fa1   1.2330379064 0.051543839 23.9221203     P 0.0
## fa(trt, 1):trial!Prothi!fa1 1.2452533930 0.047978708 25.9542919     P 0.0
## fa(trt, 1):trial!ProTe!fa1  1.2266131750 0.046834790 26.1902140     P 0.0
## fa(trt, 1):trial!Metc!fa1   1.2045660630 0.043815020 27.4920809     P 0.0
## fa(trt, 1):trial!Chk!fa1    1.2669038469 0.048731932 25.9974067     P 0.0
## units!R                     1.0000000000          NA         NA     F 0.0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The model reports six factor loadings (rows ending in &lt;code&gt;fa1&lt;/code&gt;), six treatment-specific uniqueness variances (rows ending in &lt;code&gt;var&lt;/code&gt;), and the fixed residual. That is &lt;span class=&#34;math inline&#34;&gt;\(2m = 12\)&lt;/span&gt; covariance parameters: fewer than the 21 of the unstructured model, and more than the seven of CSH, which places FA1 squarely between the two in flexibility.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;the-g-matrix-3&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;The G matrix&lt;/h4&gt;
&lt;p&gt;We reconstruct &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G}\)&lt;/span&gt; from the loadings and uniquenesses. A singular value decomposition rotates the loadings to a canonical orientation (the sign flip makes the dominant loading positive), then &lt;span class=&#34;math inline&#34;&gt;\(\mathbf{G} = \boldsymbol{\lambda}^\star \boldsymbol{\lambda}^{\star\top} + \boldsymbol{\Psi}\)&lt;/span&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;fa1.loadings &amp;lt;- sum.r4[endsWith(rownames(sum.r4), &amp;quot;fa1&amp;quot;), 1]
mat.loadings &amp;lt;- as.matrix(cbind(fa1.loadings))
svd.mat.loadings &amp;lt;- svd(mat.loadings)
mat.loadings.star &amp;lt;- mat.loadings %*% svd.mat.loadings$v * -1   # rotate to canonical sign
colnames(mat.loadings.star) &amp;lt;- c(&amp;quot;fa1&amp;quot;)
psi &amp;lt;- as.matrix(diag(sum.r4[endsWith(rownames(sum.r4), &amp;quot;var&amp;quot;), 1]))
lamb_lamb_t &amp;lt;- mat.loadings.star %*% t(mat.loadings.star)
G &amp;lt;- lamb_lamb_t + psi
rownames(G) &amp;lt;- colnames(G) &amp;lt;- trt_levels&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;https://agprophet.netlify.app/project/network-meta-asreml/index.en_files/figure-html/r4-gplot-1.png&#34; alt=&#34;&#34; width=&#34;672&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;Diagonal entries are total variances (&lt;span class=&#34;math inline&#34;&gt;\(\lambda_j^2 + \psi_j\)&lt;/span&gt;); off-diagonals are the covariances implied by shared loading on the single latent dimension (&lt;span class=&#34;math inline&#34;&gt;\(\lambda_j \lambda_{j&amp;#39;}\)&lt;/span&gt;). The whole covariance pattern is thus generated by one factor plus treatment-specific noise.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;treatment-predictions-and-standard-errors-5&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Treatment predictions and standard errors&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;predict(mod.r4, classify = &amp;quot;trt&amp;quot;, sed = TRUE, vcov = TRUE, trace = FALSE)$pvals&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## 
## Notes:
## [0;34m- The predictions are obtained by averaging across the hypertable
##   calculated from model terms constructed solely from factors in
##   the averaging and classify sets.
## - Use &amp;#39;average&amp;#39; to move ignored factors into the averaging set.
## - The ignored set: trial
## [0m
##      trt predicted.value std.error    status
## 1    Teb        3.807798 0.1072221 Estimable
## 2   Prop        3.738126 0.1100908 Estimable
## 3 Prothi        3.955384 0.1091113 Estimable
## 4  ProTe        3.968101 0.1077004 Estimable
## 5   Metc        3.976248 0.1047761 Estimable
## 6    Chk        3.537135 0.1113974 Estimable&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The FA1 means and standard errors are close to the SAS-based analysis, with small numerical differences.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;model-r5-second-order-factor-analytic-fa2&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Model R5: second-order factor analytic (FA2)&lt;/h2&gt;
&lt;p&gt;Model R5 adds a second latent factor:&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
\mathbf{G} = \boldsymbol{\Lambda}\boldsymbol{\Lambda}^\top + \boldsymbol{\Psi},
\qquad
\boldsymbol{\Lambda} = [\boldsymbol{\lambda}_1\ \boldsymbol{\lambda}_2],
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;where &lt;span class=&#34;math inline&#34;&gt;\(\boldsymbol{\Lambda}\)&lt;/span&gt; is &lt;span class=&#34;math inline&#34;&gt;\(m \times 2\)&lt;/span&gt;. A second dimension captures covariance patterns that a single factor cannot, while still costing fewer parameters than the unstructured model. It is implemented with &lt;code&gt;fa(trt, 2):trial&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mod.r5 &amp;lt;- asreml(
  fixed  = yield ~ trt,
  random = ~ fa(trt, 2):trial,                     # two latent factors + diagonal uniqueness
  weights = &amp;quot;wtyld&amp;quot;,
  family  = asr_gaussian(dispersion = 1),
  data    = dat,
  na.action = na.method(x = &amp;quot;omit&amp;quot;, y = &amp;quot;omit&amp;quot;),
  trace   = FALSE
)
mod.r5 &amp;lt;- update.asreml(mod.r5)&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;variance-component-estimates-6&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Variance component estimates&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;sum.r5 &amp;lt;- summary(mod.r5)$varcomp; sum.r5&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##                                component   std.error     z.ratio bound %ch
## fa(trt, 2):trial!Teb!var     0.014399834 0.006010461  2.39579513     P 0.0
## fa(trt, 2):trial!Prop!var    0.016230094 0.009689854  1.67495756     P 0.0
## fa(trt, 2):trial!Prothi!var  0.000000000          NA          NA     F  NA
## fa(trt, 2):trial!ProTe!var   0.002392063 0.006898018  0.34677540     P 0.1
## fa(trt, 2):trial!Metc!var    0.003520856 0.004823912  0.72987564     P 0.0
## fa(trt, 2):trial!Chk!var     0.001379427 0.018633980  0.07402753     P 0.3
## fa(trt, 2):trial!Teb!fa1     1.232504245 0.044682189 27.58379304     P 0.0
## fa(trt, 2):trial!Prop!fa1    1.231837892 0.049159320 25.05807449     P 0.0
## fa(trt, 2):trial!Prothi!fa1  1.231338194 0.048496754 25.39011583     P 0.0
## fa(trt, 2):trial!ProTe!fa1   1.222544048 0.046465128 26.31100149     P 0.0
## fa(trt, 2):trial!Metc!fa1    1.199053959 0.043428730 27.60969417     P 0.0
## fa(trt, 2):trial!Chk!fa1     1.281841982 0.047645383 26.90380244     P 0.0
## fa(trt, 2):trial!Teb!fa2     0.000000000          NA          NA     F  NA
## fa(trt, 2):trial!Prop!fa2   -0.036711099 0.038797425 -0.94622515     P 0.0
## fa(trt, 2):trial!Prothi!fa2  0.124818564 0.032007761  3.89963434     P 0.0
## fa(trt, 2):trial!ProTe!fa2   0.173897080 0.034970372  4.97269753     P 0.0
## fa(trt, 2):trial!Metc!fa2    0.090695492 0.027525036  3.29501812     P 0.0
## fa(trt, 2):trial!Chk!fa2    -0.172290283 0.047570236 -3.62180850     P 0.0
## units!R                      1.000000000          NA          NA     F 0.0&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;length(sum.r5$component)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [1] 19&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The model reports six first-order loadings (&lt;code&gt;fa1&lt;/code&gt;), six second-order loadings (&lt;code&gt;fa2&lt;/code&gt;), six uniqueness variances (&lt;code&gt;var&lt;/code&gt;), and the fixed residual. The second factor explains additional treatment-by-study structure that one dimension misses, while remaining more parsimonious than the unstructured model. The printed &lt;code&gt;length()&lt;/code&gt; gives the exact parameter count for this fit.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;the-g-matrix-4&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;The G matrix&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;fa1.loadings &amp;lt;- sum.r5[endsWith(rownames(sum.r5), &amp;quot;fa1&amp;quot;), 1]
fa2.loadings &amp;lt;- sum.r5[endsWith(rownames(sum.r5), &amp;quot;fa2&amp;quot;), 1]
mat.loadings &amp;lt;- as.matrix(cbind(fa1.loadings, fa2.loadings))
svd.mat.loadings &amp;lt;- svd(mat.loadings)
mat.loadings.star &amp;lt;- mat.loadings %*% svd.mat.loadings$v * -1
colnames(mat.loadings.star) &amp;lt;- c(&amp;quot;fa1&amp;quot;, &amp;quot;fa2&amp;quot;)
psi &amp;lt;- as.matrix(diag(sum.r5[endsWith(rownames(sum.r5), &amp;quot;var&amp;quot;), 1]))
lamb_lamb_t &amp;lt;- mat.loadings.star %*% t(mat.loadings.star)
G &amp;lt;- lamb_lamb_t + psi
rownames(G) &amp;lt;- colnames(G) &amp;lt;- trt_levels&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;https://agprophet.netlify.app/project/network-meta-asreml/index.en_files/figure-html/r5-gplot-1.png&#34; alt=&#34;&#34; width=&#34;672&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;treatment-predictions-and-standard-errors-6&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Treatment predictions and standard errors&lt;/h4&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;predict(mod.r5, classify = &amp;quot;trt&amp;quot;, sed = TRUE, vcov = TRUE, trace = FALSE)$pvals&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## 
## Notes:
## [0;34m- The predictions are obtained by averaging across the hypertable
##   calculated from model terms constructed solely from factors in
##   the averaging and classify sets.
## - Use &amp;#39;average&amp;#39; to move ignored factors into the averaging set.
## - The ignored set: trial
## [0m
##      trt predicted.value std.error    status
## 1    Teb        3.807799 0.1069134 Estimable
## 2   Prop        3.731821 0.1092218 Estimable
## 3 Prothi        3.955729 0.1087187 Estimable
## 4  ProTe        3.978682 0.1079482 Estimable
## 5   Metc        3.984402 0.1048775 Estimable
## 6    Chk        3.535239 0.1116943 Estimable&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;comparing-models-r1-through-r5&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Comparing Models R1 through R5&lt;/h3&gt;
&lt;p&gt;All five random-study models share the same fixed effects (&lt;code&gt;yield ~ trt&lt;/code&gt;), so their REML log-likelihoods and AIC values are directly comparable.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;mods.asr &amp;lt;- list(mod.r1, mod.r2, mod.r3, mod.r4, mod.r5)
asremlPlus::infoCriteria(mods.asr)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;##   fixedDF varDF NBound       AIC       BIC   loglik
## 1       0     2      1 -414.6803 -406.0532 209.3401
## 2       0     7      1 -414.8112 -384.6163 214.4056
## 3       0    21      1 -457.8641 -367.2796 249.9321
## 4       0    11      2 -431.6603 -384.2113 226.8301
## 5       0    16      3 -460.6783 -391.6616 246.3392&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Model R5 (FA2) attains the lowest AIC. It matches or exceeds the log-likelihood of the unstructured model while estimating fewer parameters, which is the parsimony that AIC rewards. The AIC and log-likelihood values differ slightly from the original manuscript because their figures use ML estimation for some comparisons while these use REML; the two scales are not directly comparable. Both approaches nonetheless select R5 as the best random-effects model, which says the treatment-by-study covariance in this network is well summarized by two latent dimensions.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;final-remarks&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Final remarks&lt;/h2&gt;
&lt;p&gt;This post walked through a graded sequence of NMA models for multi-treatment trial data. The fixed-study models start from a single between-study variance (F1) and then allow treatment-specific variances (F2). The random-study models recover interstudy information and build up covariance structure: compound symmetry (R1), heterogeneous compound symmetry (R2), the unstructured form (R3), and the factor-analytic forms (R4 and R5).&lt;/p&gt;
&lt;p&gt;The pattern across the random-study models is the familiar bias-variance trade in covariance modeling. CS and CSH are stable but rigid. The unstructured model is maximally flexible but parameter-hungry and unstable on a sparse network. The factor-analytic models capture most of the between-study covariance with a handful of latent dimensions, and FA2 gave the best fit here by AIC. Latent factors are an effective way to describe treatment-by-study interaction in networked agronomic data, just as they are for genotype-by-environment data.&lt;/p&gt;
&lt;p&gt;This framework suits agricultural research where treatments are replicated unevenly across locations and where borrowing strength across a network sharpens inference. Open-source packages such as &lt;code&gt;metafor&lt;/code&gt;, &lt;code&gt;nlme&lt;/code&gt;, and &lt;code&gt;lme4breeding&lt;/code&gt; can fit related models, with the residual-scale caveat noted above for the &lt;code&gt;lme4&lt;/code&gt;-based engines; a later post will compare them directly. All models here used summary-level data, which mirrors what published field trials typically report. A future post will extend these methods to individual plot-level data, which opens the door to spatial structure, trial-specific errors, and plot-level covariates.&lt;/p&gt;
&lt;/div&gt;
</description>
    </item>
    
  </channel>
</rss>
