if (FALSE) {
library(agridat)
data(byers.apple)
dat <- byers.apple
libs(lattice)
xyplot(diameter ~ time | factor(appleid), data=dat, type=c('p','l'),
strip=strip.custom(par.strip.text=list(cex=.7)),
main="byers.apple")
# Overall fixed linear trend, plus random intercept/slope deviations
# for each apple. Observations within each apple are correlated.
libs(nlme)
libs(lucid)
m1 <- lme(diameter ~ 1 + time, data=dat,
random = ~ time|appleid, method='ML',
cor = corAR1(0, form=~ time|appleid),
na.action=na.omit)
vc(m1)
## effect variance stddev corr
## (Intercept) 0.007354 0.08575 NA
## time 0.00003632 0.006027 0.83
## Residual 0.0004555 0.02134 NA
}
Run the code above in your browser using DataLab