Retain the random-slope linear mixed model of part (e), but replace the within-laboratory independent error covariance by continuous-time autoregressive residual correlation:Errors from different laboratories remain independent and are independent of the random slopes. The resulting marginal covariance within laboratory isThe exponential decay applies to the conditional errors, not the entire marginal correlation, which also contains the shared random slope.
Use Here
nlme, since lme4::lmer does not fit this general residual correlation structure. With a data frame containing the observed variables, suitable code islibrary(nlme)
dat <- data.frame(size = size, days = days, lab = lab)
dat <- dat[order(dat$lab, dat$days), ]
tumour_cor <- lme(size ~ days,
random = ~ 0 + days | lab,
correlation = corCAR1(form = ~ days | lab),
data = dat, method = "REML")corCAR1 estimates , the error correlation one day apart; correlation at separation is . This works for noninteger or unequally spaced days. At equally spaced integer days, corAR1(form = ~ days | lab) gives the corresponding discrete-time construction when its parameter is positive. Distinct times within each error series are required: separate tumours with repeated day values should have separate series identifiers or an additional independent-error component, rather than being assigned perfectly correlated errors. The continuous-time autoregressive residual correlation documentation describes the grouping and continuous-time conventions: stat.ethz.ch/R-manual/R-patched/library/nlme/html/corCAR1.html. The fixed days term here follows the fitted output rather than the inconsistent command in part (e). Articles by others on the same topic
There are currently no matching articles.