Popis: |
Residual plots are often used to interrogate regression model assumptions, but interpreting them requires an understanding of how much sampling variation to expect when assumptions are satisfied. In this paper, we propose constructing global envelopes around data (or around trends fitted to data) on residual plots, exploiting recent advances that enable construction of global envelopes around functions by simulation. While the proposed tools are primarily intended as a graphical aid, they can be interpreted as formal tests of model assumptions, which enables the study of their properties via simulation experiments. We considered three model scenarios -- fitting a linear model, generalized linear model or generalized linear mixed model -- and explored the power of global simulation envelope tests constructed around data on quantile-quantile plots, or around trend lines on residual vs fits plots or scale-location plots. Global envelope tests compared favorably to commonly used tests of assumptions at detecting violations of distributional and linearity assumptions. Freely available \texttt{R} software (\texttt{ecostats::plotenvelope}) enables application of these tools to any fitted model that has methods for the \texttt{simulate}, \texttt{residuals} and \texttt{predict} functions. |