Early generation lupin trial with 3 sites, 330 test lines, 6 check lines.

A data frame with 1236 observations on the following 5 variables.

`site`

a factor with levels

`S1`

`S2`

`S3`

`col`

a numeric vector

`row`

a numeric vector

`gen`

a numeric vector

`yield`

a numeric vector

An early-stage multi-environment trial, with 6 check lines and 300 test lines. The 6 check lines were replicated in each environment.

Multi-Environment Trials - Lupins. http://www.vsni.co.uk/software/asreml/htmlhelp/asreml/xlupin.htm

Used with permission of Arthur Gilmour, Brian Cullis, Robin Thompson.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | ```
data(vsn.lupin3)
dat <- vsn.lupin3
# Split gen into check/test, make factors
dat <- within(dat, {
check <- ifelse(gen>336, 0, gen)
check <- ifelse(check<7, check, 7)
check <- factor(check)
test <- factor(ifelse(gen>6 & gen<337, gen, 0))
gen=factor(gen)
})
desplot(yield~ col*row|site, dat, main="vsn.lupin3 - yield")
desplot(check~ col*row|site, dat,
main="vsn.lupin3: check plot placement") # Site 1 & 2 used same randomization
## Not run:
require(asreml)
# Single-site analyses suggested random row term for site 3, random column terms
# for all sites, AR1 was unnecessary for the col dimension of site 3
dat <- transform(dat, colf=factor(col), rowf=factor(row))
dat <- dat[order(dat$site, dat$colf, dat$rowf),] # Sort for asreml
m1 <- asreml(yield ~ site + check:site, data=dat,
random = ~ at(site):colf + at(site,3):rowf + test,
rcov = ~ at(site,c(1,2)):ar1(colf):ar1(rowf)
+ at(site,3):id(colf):ar1(rowf))
m1$loglik
## [1] -314.2616
require(lucid)
vc(m1)
## effect component std.error z.ratio constr
## at(site, S1):colf!colf.var 0.6228 0.4284 1.5 pos
## at(site, S2):colf!colf.var 0.159 0.1139 1.4 pos
## at(site, S3):colf!colf.var 0.04832 0.02618 1.8 pos
## at(site, S3):rowf!rowf.var 0.0235 0.008483 2.8 pos
## test!test.var 0.1031 0.01468 7 pos
## site_S1!variance 2.771 0.314 8.8 pos
## site_S1!colf.cor 0.1959 0.05375 3.6 uncon
## site_S1!rowf.cor 0.6503 0.03873 17 uncon
## site_S2!variance 0.9926 0.1079 9.2 pos
## site_S2!colf.cor 0.2868 0.05246 5.5 uncon
## site_S2!rowf.cor 0.5744 0.0421 14 uncon
## site_S3!variance 0.1205 0.01875 6.4 pos
## site_S3!rowf.cor 0.6394 0.06323 10 uncon
# Add site:test
m2 <- update(m1, random=~. + site:test)
m2$loglik
## [1] -310.8794
# CORUH structure on the site component of site:test
m3 <- asreml(yield ~ site + check:site, data=dat,
random = ~ at(site):colf + at(site,3):rowf + corh(site):test,
rcov = ~ at(site,c(1,2)):ar1(colf):ar1(rowf)
+ at(site,3):id(colf):ar1(rowf))
m3$loglik
## [1] -288.4837
# Unstructured genetic variance matrix
m4 <- asreml(yield ~ site + check:site, data=dat,
random = ~ at(site):colf + at(site,3):rowf + us(site):test,
rcov = ~ at(site,c(1,2)):ar1(colf):ar1(rowf)
+ at(site,3):id(colf):ar1(rowf))
m4$loglik
## [1] -286.8239
# Note that a 3x3 unstructured matrix can be written LL'+Psi with 1 factor L
# Explicitly fit the factor analytic model
m5 <- asreml(yield ~ site + check:site, data=dat,
random = ~ at(site):colf + at(site,3):rowf
+ fa(site,1, init=c(.7,.1,.1,.5,.3,.2)):test,
rcov = ~ at(site,c(1,2)):ar1(colf):ar1(rowf)
+ at(site,3):id(colf):ar1(rowf))
m5$loglik # Same as m4
## [1] -286.8484
# Model 4, Unstructured (symmetric) genetic variance matrix
un <- diag(3)
un[upper.tri(un,TRUE)] <- m4$gammas[5:10]
round(un+t(un)-diag(diag(un)),3)
## [,1] [,2] [,3]
## [1,] 0.992 0.158 0.132
## [2,] 0.158 0.073 0.078
## [3,] 0.132 0.078 0.122
# Model 5, FA matrix = LL'+Psi. Not quite the same as unstructured,
# since the FA model fixes site 2 variance at 0.
psi <- diag(m5$gammas[5:7])
lam <- matrix(m5$gammas[8:10], ncol=1)
round(tcrossprod(lam,lam)+psi,3)
## [,1] [,2] [,3]
## [1,] 0.991 0.156 0.133
## [2,] 0.156 0.092 0.078
## [3,] 0.133 0.078 0.122
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.