residuals.gcmr {gcmr} | R Documentation |
Quantile Residuals for Gaussian Copula Marginal Regression
Description
Computes various type of quantile residuals for validation of a fitted Gaussian copula marginal regression model, as described in Masarotto and Varin (2012; 2017).
Usage
## S3 method for class 'gcmr'
residuals(object, type=c("conditional","marginal"),
method=c("random","mid"),...)
Arguments
object |
an object of class |
type |
the type of quantile residuals which should be returned.
The alternatives are: |
method |
different methods available for quantile residuals in case of discrete responses:
|
... |
further arguments passed to or from other methods. |
Details
Quantile residuals are defined in Dunn and Smyth (1996). Two different types are available:
conditional | quantile residuals that account for the dependence. |
marginal | quantile residuals that do not account for the dependence. |
Conditional quantile residuals are normal quantiles of Rosenblatt (1952) transformations and they are appropriate for validation of the marginal regression models discussed in Masarotto and Varin (2012; 2017). If the responses are discrete, then the conditional quantile residuals are not well defined. This difficulty is overcame by randomized quantile residuals available through option method="random"
. Alternatively, Zucchini and MacDonald (2009) suggest the use of mid interval quantile residuals (method="mid"
).
Note
Differently from randomized quantile residuals, mid quantile residuals are not realizations of incorrelated standard normal variables under model conditions.
It is appropriate to inspect several sets of randomized quantile residuals before to take a decision about the model.
See Masarotto and Varin (2012; 2017) for more details.
Author(s)
Guido Masarotto and Cristiano Varin.
References
Dunn, P.K. and Smyth, G.K. (1996). Randomized quantile residuals. Journal of Computational and Graphical Statistics 5, 236–244.
Masarotto, G. and Varin, C. (2012). Gaussian copula marginal regression. Electronic Journal of Statistics 6, 1517–1549.
Masarotto, G. and Varin C. (2017). Gaussian Copula Regression in R. Journal of Statistical Software, 77(8), 1–26.
Rosenblatt, M. (1952). Remarks on a multivariate transformation. The Annals of Mathematical Statistics 23, 470–472.
Zucchini, W. and MacDonald, I.L. (2009). Hidden Markov Models for Time Series. Chapman and Hall/CRC.
See Also
Examples
## spatial binomial data
## Not run:
data(malaria)
D <- sp::spDists(cbind(malaria$x, malaria$y))/1000
m <- gcmr(cbind(cases, size-cases) ~ netuse+I(green/100)+phc, data=malaria,
marginal=binomial.marg, cormat=matern.cormat(D))
res <- residuals(m)
## normal probability plot
qqnorm(res)
qqline(res)
## or better via plot.gcmr
plot(m, which = 3)
## End(Not run)