box.cork.Rd
The cork data gives the weights of cork borings of the trunk for 28 trees on the north (N), east (E), south (S) and west (W) directions.
Data frame with 28 observations on the following 5 variables.
tree
tree number
dir
direction N,E,S,W
y
weight of cork deposit (centigrams), north direction
C.R. Rao (1948). Tests of significance in multivariate analysis. Biometrika, 35, 58-79. https://doi.org/10.2307/2332629
K.V. Mardia, J.T. Kent and J.M. Bibby (1979) Multivariate Analysis, Academic Press.
Russell D Wolfinger, (1996). Heterogeneous Variance: Covariance Structures for Repeated Measures. Journal of Agricultural, Biological, and Environmental Statistics, 1, 205-230.
# \dontrun{ library(agridat) data(box.cork) dat <- box.cork libs(reshape2, lattice) dat2 <- acast(dat, tree ~ dir, value.var='y') splom(dat2, pscales=3, prepanel.limits = function(x) c(25,100), main="box.cork", xlab="Cork yield on side of tree", panel=function(x,y,...){ panel.splom(x,y,...) panel.abline(0,1,col="gray80") })## Radial star plot, each tree is one line libs(plotrix) libs(reshape2) dat2 <- acast(dat, tree ~ dir, value.var='y') radial.plot(dat2, start=pi/2, rp.type='p', clockwise=TRUE, radial.lim=c(0,100), main="box.cork", lwd=2, labels=c('North','East','South','West'), line.col=rep(c("royalblue","red","#009900","dark orange", "#999999","#a6761d","deep pink"), length=nrow(dat2)))# asreml 4 libs(asreml) # Unstructured covariance dat$dir <- factor(dat$dir) dat$tree <- factor(dat$tree) dat <- dat[order(dat$tree, dat$dir), ] # Unstructured covariance matrix m1 <- asreml(y~dir, data=dat, residual = ~ tree:us(dir))#> Model fitted using the sigma parameterization. #> ASReml 4.1.0 Fri Dec 11 17:31:56 2020 #> LogLik Sigma2 DF wall cpu #> 1 -307.529 1.0 108 17:31:56 0.0 #> 2 -300.714 1.0 108 17:31:56 0.0 #> 3 -294.337 1.0 108 17:31:56 0.0 #> 4 -291.522 1.0 108 17:31:56 0.0 #> 5 -290.967 1.0 108 17:31:56 0.0 #> 6 -290.959 1.0 108 17:31:56 0.0#> effect component std.error z.ratio bound %ch #> tree:dir!R 1 NA NA F 0 #> tree:dir!dir_E:E 219.9 59.83 3.7 P 0 #> tree:dir!dir_N:E 223.8 64.93 3.4 P 0 #> tree:dir!dir_N:N 290.4 79 3.7 P 0 #> tree:dir!dir_S:E 229.1 69.21 3.3 P 0 #> tree:dir!dir_S:N 288.4 82.7 3.5 P 0 #> tree:dir!dir_S:S 350 95.22 3.7 P 0 #> tree:dir!dir_W:E 171.4 54.09 3.2 P 0 #> tree:dir!dir_W:N 226.3 65.75 3.4 P 0 #> tree:dir!dir_W:S 259.5 73.62 3.5 P 0 #> tree:dir!dir_W:W 226 61.48 3.7 P 0# Note: 'rcor' is a personal function to extract the correlations # into a matrix format # round(kw::rcor(m1)$dir, 2) # E N S W # E 219.93 223.75 229.06 171.37 # N 223.75 290.41 288.44 226.27 # S 229.06 288.44 350.00 259.54 # W 171.37 226.27 259.54 226.00 # Note: Wolfinger used a common diagonal variance # Factor Analytic with different specific variances # fixme: does not work with asreml4 # m2 <- update(m1, residual = ~tree:facv(dir,1)) # round(kw::rcor(m2)$dir, 2) # E N S W # E 219.94 209.46 232.85 182.27 # N 209.46 290.41 291.82 228.43 # S 232.85 291.82 349.99 253.94 # W 182.27 228.43 253.94 225.99 # }