plot.qv | R Documentation |
Provides visualization of estimated contrasts using intervals based on quasi standard errors.
## S3 method for class 'qv'
plot(x, intervalWidth = 2, ylab = "estimate",
xlab = "", ylim = NULL,
main = "Intervals based on quasi standard errors",
levelNames = NULL, ...)
x |
an object of class |
intervalWidth |
the half-width, in quasi standard errors, of the plotted intervals |
ylab |
as for |
xlab |
as for |
ylim |
as for |
main |
as for |
levelNames |
labels to be used on the x axis for the levels of the factor whose effect is plotted |
... |
other arguments understood by |
If levelNames
is unspecified, the row names of x$qvframe
will be used.
invisible(x)
David Firth, d.firth@warwick.ac.uk
Easton, D. F, Peto, J. and Babiker, A. G. A. G. (1991) Floating absolute risk: an alternative to relative risk in survival and case-control analysis avoiding an arbitrary reference group. Statistics in Medicine 10, 1025–1035.
Firth, D. (2000) Quasi-variances in Xlisp-Stat and on the web. Journal of Statistical Software 5.4, 1–13. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v005.i04")}
Firth, D. (2003) Overcoming the reference category problem in the presentation of statistical models. Sociological Methodology 33, 1–18. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.0081-1750.2003.t01-1-00125.x")}
Firth, D. and Mezezes, R. X. de (2004) Quasi-variances. Biometrika 91, 65–80. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/91.1.65")}
McCullagh, P. and Nelder, J. A. (1989) Generalized Linear Models. London: Chapman and Hall.
Menezes, R. X. (1999) More useful standard errors for group and factor effects in generalized linear models. D.Phil. Thesis, Department of Statistics, University of Oxford.
qvcalc
## Overdispersed Poisson loglinear model for ship damage data
## from McCullagh and Nelder (1989), Sec 6.3.2
library(MASS)
data(ships)
ships$year <- as.factor(ships$year)
ships$period <- as.factor(ships$period)
shipmodel <- glm(formula = incidents ~ type + year + period,
family = quasipoisson,
data = ships, subset = (service > 0), offset = log(service))
qvs <- qvcalc(shipmodel, "type")
summary(qvs, digits = 4)
plot(qvs, col = c(rep("red", 4), "blue"))
## if we want to plot in decreasing order (of estimates):
est <- qvs$qvframe$estimate
qvs2 <- qvs
qvs2$qvframe <- qvs$qvframe[order(est, decreasing = TRUE), , drop = FALSE]
plot(qvs2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.