Methods for `sandwich::estfun()` and `sandwich::bread()`, which let `sandwich::vcovCL()`, `sandwich::vcovBS()`, and the rest of the *sandwich* machinery work directly on `fastglm` and `fastglmFit` objects. Load `sandwich` (`library(sandwich)`) before calling them.

estfun.fastglm(x, ...)

estfun.fastglmFit(x, ...)

bread.fastglm(x, ...)

bread.fastglmFit(x, ...)

Arguments

x

a fitted object of class `"fastglm"` or `"fastglmFit"`.

...

not used.

Value

`estfun()` returns an `n x p` matrix; `bread()` returns a `p x p` matrix.

Details

`estfun(x)` returns the per-observation empirical estimating-function contributions, an `n x p` matrix whose `i`-th row is `(y_i - mu_i) * mu.eta_i / variance(mu_i) * x_i / dispersion`. `bread(x)` returns `(X' W X)^(-1) * n * dispersion` (the *sandwich* convention). For poisson, binomial, and negative-binomial families the dispersion is fixed at 1, exactly matching `sandwich::estfun.glm()` / `sandwich::bread.glm()`.