library(predictmeans)
data(Oats, package="nlme")
# fm <- lmer(yield ~ nitro*Variety+(1|Block/Variety), data=Oats)
fm <- lme(yield ~ nitro*Variety, random=~1|Block/Variety, data=Oats)
Kmatrix(fm, "Variety", prtnum=TRUE)$K
Kmatrix(fm, "Variety", 0.5, prtnum=TRUE)$K
# Kmatrix(fm, "Variety", "nitro")$K
Kmatrix(fm, "Variety", "nitro", covariateV=seq(0, 0.6, 0.1))$K
Run the code above in your browser using DataLab