Use a common intercept and laboratory-specific slopes in the normal linear model. With denoting days and the indicator variables for laboratories B and C, the design matrix has row , andThe interaction terms change slopes, without introducing laboratory-specific intercepts. Thus the estimated daily growth rates arein millimetres per day, with fitted common intercept mm. The residual degrees of freedom are . The usual unbiased error variance estimate is the square of the residual standard error:The small difference from arises from rounding the standard error to two decimal places; the latter uses the more precise residual sum of squares supplied later. A maximum-likelihood estimate would instead divide that residual sum of squares by .
Let , , , and . The horizontal axis of the residual-versus-fitted plot is , the fitted values, and the vertical axis is , the regression residual, in millimetres. Under the normal linear model, , where is the regression leverage.
In the quantile-quantile plot, the vertical values are the ordered standardized regression residualsand the horizontal values are corresponding theoretical quantiles of the standard normal distribution, with plotting positions such as . The exact plotting-position convention has little practical effect here. Under Gaussian errors these points should approximately follow a straight line; they are not independent because fitting induces residual correlations.
The main visible concern is curvature in the conditional mean. The red smooth in the residual-versus-fitted plot descends from positive residuals at low fitted values, becomes negative in the middle, and rises again at high fitted values. This suggests the strictly linear time effects may be inadequate. There is no clear monotone widening of the residual scatter, so strong heteroscedasticity is not apparent. The quantile-quantile plot has modest tail deviations and a few labelled observations, but does not show a dramatic departure from normality. These plots cannot establish independence across days or laboratories; check residuals against day, laboratory, and sampling order as well. A large coefficient of determination does not remove the visible mean-model concern.
For a new independent tumour grown for ten days in B, use . Its fitted mean isWrite . The prediction interval in a normal linear model iswhere and is the indicated Student's t-distribution quantile. The design information needed to evaluate is not supplied, so a fully numerical interval cannot be recovered from the coefficient standard errors alone: the coefficient covariances are also needed.
To prove coverage, write , with independent of the original sample. The error has a normal distribution with mean zero and variance . By the joint distribution of least-squares and variance estimators, and is independent of ; it is also independent of . Hence the pivotal quantityConsequently , which is exactly the claimed prediction interval coverage. This is repeated-sampling coverage conditional on the design, assuming the model; it need not hold conditional on the particular observed training responses. The extra represents new-observation noise and must not be omitted as in a mean confidence interval.
In the larger normal linear model, add laboratory intercept offsets to the mean in part (a). The nested-model F-test comparesThe smaller and larger models fit four and six mean coefficients respectively. Under , independent Gaussian errors with common variance give independent quantities and . Thus the test statistic isThe p-value is the upper-tail probability . At the conventional 5% significance level, do not reject the common-intercept restriction. Prefer the simpler model
tumour1 on this comparison. This does not prove the intercepts coincide, nor address the curvature identified in part (b); the exact F-test calibration assumes the underlying error and mean assumptions. The one-decimal RSS values give when subtracted, whereas the table's difference uses unrounded values.The fitted formula and coefficient table describe a random-slope linear mixed model:with random effects independent of the errors. There is a common fixed intercept, a population slope , and a laboratory random slope deviation . In
tumour1, the three laboratory slopes are unrelated unknown fixed coefficients. Here they are modelled as draws from a common normal distribution; estimated laboratory deviations are shrunk toward zero. After integrating out , observations in laboratory have covariance , so they are marginally dependent even when their conditional errors are independent.The displayed command contains a source inconsistency:
size ~ 1 + (0 + days | lab) would impose zero population slope and could not produce the displayed fixed days coefficient. The output corresponds to size ~ days + (0 + days | lab). Its estimates are , and . The estimated daily increase averaged over the laboratory population isbecause .A random slope is appropriate if these laboratories can reasonably be viewed as exchangeable representatives of a larger population and the goal includes population inference or predictions for other laboratories. If these particular three laboratories are the whole set of interest, or have systematic differences incompatible with exchangeability, laboratory-specific fixed slopes are preferable. Only three groups give weak information about between-laboratory variance; the mixed model does not itself resolve possible nonlinear growth. Its population mean is distinct from a realized finite-group average .
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.