An S3method for sandwich::estfun
for producing a matrix
of contributions to the direct adjustment estimating equations.
Value
An \(n\times 2\) matrix of empirical estimating equations for the direct adjustment model fit. See Details for definition of \(n\).
Details
If a prior covariance adjustment model has been passed to the
offset
argument of the teeMod
model using cov_adj()
,
estfun.teeMod()
incorporates contributions to the estimating
equations of the covariance adjustment model.
The covariance
adjustment sample may not fully overlap with the direct adjustment sample,
in which case estfun.teeMod()
returns a matrix with the same number
of rows as the number of unique units of observation used to fit the two
models. Uniqueness is determined by matching units of assignment used to
fit the covariance adjustment model to units of assignment in the
teeMod
model's StudySpecification
slot; units of observation
within units of assignment that do not match are additional units that add
to the row count.
Theby
argument in cov_adj()
can
provide a column or a pair of columns (a named vector where the name
specifies a column in the direct adjustment sample and the value a column
in the covariance adjustment sample) that uniquely specifies units of
observation in each sample. This information can be used to align each
unit of observation's contributions to the two sets of estimating
equations. If no by
argument is provided and units of observation
cannot be uniquely specified, contributions are aligned up to the unit of
assignment level. If standard errors are clustered no finer than that,
they will provide the same result as if each unit of observation's
contributions were aligned exactly.