Normal QQ-plot with simulated envelope of model residuals
Produces a normal QQ-plot with simulated envelope of residuals obtained from the fit of a negative binomial or beta-binomial regression model.
## S3 method for class 'overglm' envelope( object, rep = 100, conf = 0.95, type = c("quantile", "response", "standardized"), plot.it = TRUE, identify, ... )
object |
an object of the class overglm which is obtained from the fit of a negative binomial or beta-binomial model. |
rep |
an (optional) positive integer indicating the number of replicates which should be used to build the simulated envelope. By default, |
conf |
an (optional) value in the interval (0,1) indicating the confidence level which should be used to build the pointwise confidence intervals, which form the envelope. By default, |
type |
a character string indicating the type of residuals which should be used. The available options are: (1) the difference between the observed response
and the fitted mean ("response"); (2) the standardized difference between the
observed response and the fitted mean ("standardized"); (3) the randomized quantile
residuals ("quantile"). By default, |
plot.it |
an (optional) logical switch indicating if the normal QQ-plot with simulated envelope of residuals is required or just the data matrix in which it is based. By default, |
identify |
an (optional) positive integer value indicating the number of individuals to identify on the QQ-plot with simulated envelope of residuals. This is only appropriate if |
... |
further arguments passed to or from other methods. If |
The simulated envelope is builded by simulating rep independent realizations of the response variable for each individual, which is accomplished taking into account the following: (1) the model assumption about the distribution of the response variable; (2) the estimates of the parameters in the linear predictor; and (3) the estimate of the dispersion parameter. The interest model is re-fitted rep
times, as each time the vector of observed responses is replaced by one of the simulated samples. The residuals type type
are computed and then ordered for each replicate, so that for each i=1,2,...,n, where n is the number of individuals in the sample, there is a random sample of size rep
of the i-th order statistic of the residuals type type
. Therefore, the simulated envelope is composed of the quantiles (1-conf
)/2 and (1+conf
)/2 of the random sample of size rep
of the i-th order statistic of the residuals type type
for i=1,2,...,n.
A matrix with n rows and four columns: the first three (Lower limit, Median, and Upper limit) describe the simulated envelope, that is, each row corresponds to the quantiles (1-conf
)/2, 0.5 and (1+conf
)/2 of the random sample of size rep
of the i-th order statistic of the residuals type type
for i=1,2,...,n; and the last one column (Residuals) contains the observed type type
residuals.
Atkinson A.C. (1985) Plots, Transformations and Regression. Oxford University Press, Oxford.
Dunn P.K. and Smyth G.K. (1996) Randomized Quantile Residuals. Journal of Computational and Graphical Statistics 5, 236-244.
## Example 1 fit1 <- overglm(infections ~ frequency + location, family="nb1(log)", data=swimmers) envelope(fit1,rep=100,conf=0.95,type="quantile",col="red", pch=20,col.lab="blue", col.axis="blue",col.main="black",family="mono",cex=0.8) ## Example 2 fit2 <- overglm(cbind(fetuses,litter-fetuses) ~ tcpo + pht, family="bb(logit)", data=ossification) envelope(fit2,rep=100,conf=0.95,type="quantile",col="red", pch=20,col.lab="blue", col.axis="blue",col.main="black",family="mono",cex=0.8)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.