% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fastglm-methods.R
\name{fastglm-sandwich}
\alias{fastglm-sandwich}
\alias{estfun.fastglm}
\alias{estfun.fastglmFit}
\alias{bread.fastglm}
\alias{bread.fastglmFit}
\title{Empirical estimating-function and bread methods for `fastglm` objects}
\usage{
estfun.fastglm(x, ...)

estfun.fastglmFit(x, ...)

bread.fastglm(x, ...)

bread.fastglmFit(x, ...)
}
\arguments{
\item{x}{a fitted object of class `"fastglm"` or `"fastglmFit"`.}

\item{...}{not used.}
}
\value{
`estfun()` returns an `n x p` matrix; `bread()` returns a
  `p x p` matrix.
}
\description{
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.
}
\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()`.
}
