Skip to contents

Computes the worst relative error, among all contrasts, for the standard error as derived from a set of quasi variances. For details of the method see Menezes (1999) or Firth and Menezes (2004).

Usage

worstErrors(qv.object)

Arguments

qv.object

An object of class qv

Value

A numeric vector of length 2, the worst negative relative error and the worst positive relative error.

References

Firth, D. and Mezezes, R. X. de (2004) Quasi-variances. Biometrika 91, 69--80. c("\Sexpr[results=rd]tools:::Rd_expr_doi(\"#1\")", "10.1093/biomet/91.1.65")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.

See also

Author

David Firth, d.firth@warwick.ac.uk

Examples


##  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))
shiptype.qvs <- qvcalc(shipmodel, "type")
summary(shiptype.qvs, digits = 4)
#> Model call:  glm(formula = incidents ~ type + year + period, family = quasipoisson,      data = ships, subset = (service > 0), offset = log(service)) 
#> Factor name:  type 
#>       estimate     SE quasiSE quasiVar
#>     A  0.00000 0.0000  0.2010  0.04039
#>     B -0.54334 0.2309  0.1127  0.01270
#>     C -0.68740 0.4279  0.3753  0.14081
#>     D -0.07596 0.3779  0.3239  0.10491
#>     E  0.32558 0.3067  0.2322  0.05390
#> Worst relative errors in SEs of simple contrasts (%):  -0.7 0.9 
#> Worst relative errors over *all* contrasts (%):  -2.1 1.6 
worstErrors(shiptype.qvs)
#> [1] -0.02099427  0.01563661