Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

qvar

Quasi-variances Extraction Function


Description

Takes a rcim fit of the appropriate format and returns either the quasi-variances or quasi-standard errors.

Usage

qvar(object, se = FALSE, ...)

Arguments

object

A rcim object that has family function uninormal with the explink link. See below for an example.

se

Logical. If FALSE then the quasi-variances are returned, else the square root of them, called quasi-standard errors.

...

Currently unused.

Details

This simple function is ad hoc and simply is equivalent to computing the quasi-variances by diag(predict(fit1)[, c(TRUE, FALSE)]) / 2. This function is for convenience only. Serious users of quasi-variances ought to understand why and how this function works.

Value

A vector of quasi-variances or quasi-standard errors.

Author(s)

T. W. Yee.

See Also

Examples

data("ships", package = "MASS")
Shipmodel <- vglm(incidents ~ type + year + period,
                  poissonff, offset = log(service),
                  data = ships, subset = (service > 0))

# Easiest form of input
fit1 <- rcim(Qvar(Shipmodel, "type"), uninormal("explink"), maxit = 99)
qvar(fit1)             # Quasi-variances
qvar(fit1, se = TRUE)  # Quasi-standard errors

# Manually compute them:
(quasiVar <- exp(diag(fitted(fit1))) / 2)                 # Version 1
(quasiVar <- diag(predict(fit1)[, c(TRUE, FALSE)]) / 2)   # Version 2
(quasiSE  <- sqrt(quasiVar))

## Not run:  qvplot(fit1, col = "green", lwd = 3, scol = "blue", slwd = 2, las = 1)

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.