yield | gen | col | row |
---|---|---|---|

3.37917 | G01 | 1 | 1 |

3.58748 | G02 | 1 | 2 |

4.32812 | G03 | 1 | 3 |

4.53642 | G04 | 1 | 4 |

2.59224 | G05 | 1 | 5 |

2.40708 | G06 | 1 | 6 |

# ASR002. LMM for a randomized complete block design with covariates - Wheat varieties

The complete script for this example can be downloaded here:

### Dataset

In this example we will use the D001 dataset, and the first few rows are presented below:

### Model

The LMM that we will fit in this example is an extension of the ASR001 model by including covariates. This model’s equation is:

\[ y = \mu + col + row + gen + e\ \]

where,\(y\) is the grain yield,

\(\mu\) is the overall mean,

\(col\) is the fixed covariate effect of column,

\(row\) is the fixed covariate effect of row,

\(gen\) is the random effect of treatment (genotype), with \(gen \sim \mathcal{N}(0,\,\sigma^{2}_{g})\),

\(e\) is the random residual effect, with \(e \sim \mathcal{N}(0,\,\sigma^{2}_{\epsilon})\).Now, let’s take a look at how to write the model with ASReml-R. Note that before fitting the model, `gen`

needs to be defined as a factor, and `col`

and `row`

need to be set as (co)variates. This is shwown in the next few lines of code, followed by the model as defined in ASReml-R.

```
$gen <- as.factor(d001$gen)
d001$row <- as.numeric(d001$row)
d001$col <- as.numeric(d001$col) d001
```

```
<- asreml(
asr002 fixed = yield ~ col + row,
random = ~gen,
residual = ~units,
data = d001
)
```

### Exploring output

Evaluate the statistical significance of fixed effects:

`wald(asr002, denDF = 'numeric')$Wald`

```
Df denDF F.inc Pr
(Intercept) 1 48.8 1318.000 0.00000000
col 1 98.1 4.855 0.02990027
row 1 127.4 129.600 0.00000000
```

We report below the fixed effects (BLUEs):

`summary(asr002, coef = TRUE)$coef.fixed`

```
solution std error z.ratio
(Intercept) 3.57713516 0.143371942 24.950036
col -0.10808700 0.049053064 -2.203471
row -0.03563415 0.003129811 -11.385402
```

From the table above, negative slopes are associated with increases in both column and row numbers.

And the variance component estimates are:

`summary(asr002)$varcomp`

```
component std.error z.ratio bound %ch
gen 0.1478455 0.04754391 3.109662 P 0
units!R 0.2406203 0.03434901 7.005160 P 0
```

Finaly, we can estimate the heritability as:

`vpredict(asr002, h2 ~ V1/(V1+V2))`

```
Estimate SE
h2 0.3805882 0.09004703
```