qvcalc {qvcalc}R Documentation

Quasi-variances for Model Coefficients

Description

Computes a set of `quasi-variances' (and corresponding `quasi standard errors') for estimated model coefficients relating to the levels of a categorical (i.e., factor) explanatory variable. For details of the method see Firth (2000) or Firth and Menezes (2002).

Usage

qvcalc(object, factorname=NULL, labels = NULL, dispersion = NULL,
      estimates=NULL,  modelcall=NULL)

Arguments

object A model (of class lm, glm, etc.), or the covariance (sub)matrix for the estimates of interest
factorname If object is a model, the name of the factor of interest
labels An optional vector of row names for the qvframe component of the result (redundant if object is a model)
dispersion an optional scalar multiplier for the covariance matrix, to cope with overdispersion for example
estimates an optional vector of estimated coefficients (redundant if object is a model)
modelcall optional, the call expression for the model of interest (redundant if object is a model)

Value

A list of class qv, with components

covmat the full variance-covariance matrix for the estimated coefficients corresponding to the factor of interest
qvframe a data frame with variables estimate, SE, quasiSE and quasiVar, the last two being a quasi standard error and quasi-variance for each level of the factor of interest
relerrs relative errors for approximating the standard errors of all simple contrasts
factorname the factor name if given
modelcall if object is a model, object$call; otherwise NULL

Author(s)

David Firth, david.firth@nuffield.ox.ac.uk

References

Firth, D. (2000) Quasi-variances in Xlisp-Stat and on the web. Journal of Statistical Software 5.4, 1–13. At http://www.jstatsoft.org

Firth, D. and Mezezes, R. X. de (2002) Quasi-variances. Submitted for publication. At http://www.stats.ox.ac.uk/~firth/papers/.

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

worstErrors

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)
plot(shiptype.qvs)

[Package Contents]