Description Usage Arguments Details Value Author(s) References Examples
Quantile-Quantile plot of the randomised quantile residuals of a DW regression fitted model with 95% simulated envelope.
1 | res.dw(obj,k)
|
obj |
An object of class "dw.reg": the output of the dw.reg function. |
k |
The number of iterations for the simulated envelope. |
Diagnostic check for a DW regression model. The randomised quantile residuals should follow a standard normal distribution.
A q-q plot of the residuals with 95% simulated envelope
Veronica Vinciotti, Hadeel Kalktawi
Kalktawi, Vinciotti and Yu (2016) A simple and adaptive dispersion regression model for count data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #simulated example (para.q2=TRUE, beta constant)
theta0 <- -2
theta1 <- -0.5
beta<-0.5
n<-500
x <- runif(n=n, min=0, max=1.5)
logq<--exp(theta0 + theta1 * x)
y<-unlist(lapply(logq,function(x,beta) rdw(1,q=exp(x),beta),beta=beta))
data.sim<-data.frame(x,y) #simulated data
fit<-dw.reg(y~x,data=data.sim,para.q2=TRUE)
res.dw(fit,k=5)
ks.test(fit$residuals,"pnorm")
#real example
library(Ecdat)
data(StrikeNb)
fit<-dw.reg(strikes~output,data=StrikeNb,para.q2=TRUE)
res.dw(fit,k=5)
ks.test(fit$residuals,"pnorm")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.