x <- as.factor(c(1:5,1:5,1:5));x
atc(x, c("1","2"))
## how to use the theta and thetaC arguments:
# data(DT_example)
# DT <- DT_example
# theta <- diag(2)*2; theta # initial VCs
# thetaC <- diag(2)*3; thetaC # fixed VCs
# ans1 <- mmec(Yield~Env,
# random= ~ vsc( atc(Env, levs=c("CA.2013", "CA.2011"),
# theta = theta,thetaC = thetaC),isc(Name) ),
# rcov= ~ units, nIters = 1,
# data=DT)
# summary(ans1)$varcomp
Run the code above in your browser using DataLab