Description Usage Arguments Value Author(s) References See Also Examples
The plot
method for objects of class hnp.
1 2 3 |
x |
object of class |
cex |
character expansion size. |
pch |
character string or vector of one character or integer for plotting characters, see |
colour |
vector of colours. |
lty |
vector of line types. |
lwd |
vector of line widths. |
type |
type of plot for each envelope band and points. Default is |
xlab |
title for x axis, as in |
ylab |
title for y axis, as in |
main |
plot title. |
legpos |
if |
legcex |
if |
... |
extra graphical arguments passed to |
None.
Rafael A. Moral <rafael_moral@yahoo.com.br>, John Hinde and Clarice G. B. Demétrio
Moral, R. A., Hinde, J. and Demétrio, C. G. B. (2017) Half-normal plots and overdispersed models in R: the hnp package. Journal of Statistical Software 81(10):1-23.
Demétrio, C. G. B. and Hinde, J. (1997) Half-normal plots and overdispersion. GLIM Newsletter 27:19-26.
Hinde, J. and Demétrio, C. G. B. (1998) Overdispersion: models and estimation. Computational Statistics and Data Analysis 27:151-170.
Demétrio, C. G. B., Hinde, J. and Moral, R. A. (2014) Models for overdispersed data in entomology. In Godoy, W. A. C. and Ferreira, C. P. (Eds.) Ecological modelling applied to entomology. Springer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Simple Poisson regression
set.seed(100)
counts <- c(rpois(5, 2), rpois(5, 4), rpois(5, 6), rpois(5, 8))
treatment <- gl(4, 5)
fit <- glm(counts ~ treatment, family=poisson)
anova(fit, test="Chisq")
## half-normal plot
hnp(fit)
## or save it in an object and then use the plot method
my.hnp <- hnp(fit, print.on=TRUE, plot=FALSE)
plot(my.hnp)
## changing graphical parameters
plot(my.hnp, lty=2, pch=4, cex=1.2)
plot(my.hnp, lty=c(2,3,2), pch=4, cex=1.2, col=c(2,2,2,1))
plot(my.hnp, main="Half-normal plot", xlab="Half-normal scores",
ylab="Deviance residuals", legpos="bottomright")
|
Loading required package: MASS
Analysis of Deviance Table
Model: poisson, link: log
Response: counts
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev Pr(>Chi)
NULL 19 39.752
treatment 3 30.43 16 9.323 1.121e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Poisson model
Poisson model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.