This page documents methods for objects returned by
glm_weightit(), lm_weightit(), ordinal_weightit(),
multinom_weightit(), and coxph_weightit(). predict() methods are
described at predict.glm_weightit() and anova() methods are described at
anova.glm_weightit().
Usage
# S3 method for class 'glm_weightit'
summary(object, ci = FALSE, level = 0.95, transform = NULL, vcov = NULL, ...)
# S3 method for class 'multinom_weightit'
summary(object, ci = FALSE, level = 0.95, transform = NULL, vcov = NULL, ...)
# S3 method for class 'ordinal_weightit'
summary(
object,
ci = FALSE,
level = 0.95,
transform = NULL,
thresholds = TRUE,
vcov = NULL,
...
)
# S3 method for class 'coxph_weightit'
summary(object, ci = FALSE, level = 0.95, transform = NULL, vcov = NULL, ...)
# S3 method for class 'glm_weightit'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
# S3 method for class 'glm_weightit'
vcov(object, complete = TRUE, vcov = NULL, ...)
# S3 method for class 'glm_weightit'
estfun(x, asympt = TRUE, ...)
# S3 method for class 'glm_weightit'
update(object, formula. = NULL, ..., evaluate = TRUE)Arguments
- object, x
an output from one of the above modeling functions.
- ci
logical; whether to display Wald confidence intervals for estimated coefficients. Default isFALSE. (Note: this argument can also be supplied asconf.int.)- level
when
ci = TRUE, the desired confidence level.- transform
the function used to transform the coefficients, e.g.,
exp(which can also be supplied as a string, e.g.,"exp"); passed tomatch.fun()before being used on the coefficients. Whenci = TRUE, this is also applied to the confidence interval bounds. If specified, the standard error will be omitted from the output. Default is no transformation.- vcov
either a string indicating the method used to compute the variance of the estimated parameters for
object, a function used to extract the variance, or the variance matrix itself. Default is to use the variance matrix already present inobject. If a string or function, arguments passed to...are supplied to the method or function. (Note: forvcov(), can also be supplied astype.)- ...
for
vcov()orsummary()orconfint()withvcovsupplied, other arguments used to compute the variance matrix depending on the method supplied tovcov, e.g.,cluster,R, orfwb.args. Forupdate(), additional arguments to the call or arguments with changed values. Seeglm_weightit()for details.- thresholds
logical; whether to include thresholds in thesummary()output forordinal_weightitobjects. Default isTRUE.- digits
the number of significant digits to be passed to
format(coef(x), .)whenprint()ing.- complete
logical; whether the full variance-covariance matrix should be returned also in case of an over-determined system where some coefficients are undefined andcoef(.)containsNAs correspondingly. Whencomplete = TRUE,vcov()is compatible withcoef()also in this singular case.- asympt
logical; forestfun(), whether to use the asymptotic empirical estimating functions that account for estimation of the weights (whenMpartsis available). Default isTRUE. Set toFALSEto ignore estimation of the weights. Ignored whenMpartsis not available or no argument was supplied toweightitin the fitting function.- formula.
changes to the model formula, passed to the
newargument ofupdate.formula().- evaluate
logical; whether to evaluate the call (TRUE, the default) or just return it.
Value
summary() returns a summary.glm_weightit() object, which has its
own print() method. For coxph_weightit() objects, the print() and
summary() methods are more like those for glm objects than for coxph
objects.
Otherwise, all methods return the same type of object as their generics.
Details
vcov() by default extracts the parameter covariance matrix already
computed by the fitting function, and summary() and confint() uses this
covariance matrix to compute standard errors and Wald confidence intervals
(internally calling confint.lm()), respectively. Supplying arguments to
vcov or ... will compute a new covariance matrix. If cluster was
supplied to the original fitting function, it will be incorporated into any
newly computed covariance matrix unless cluster = NULL is specified in
vcov(), summary(), or confint(). For other arguments (e.g., R and
fwb.args), the defaults are those used by glm_weightit(). Note that for
vcov = "BS" and vcov = "FWB" (and vcov = "const" for
multinom_weightit or ordinal_weightit objects), the environment for the
fitting function is used, so any changes to that environment may affect
calculation. It is always safer to simply recompute the fitted object with a
new covariance matrix than to modify it with the vcov argument, but it can
be quicker to just request a new covariance matrix when refitting the model
is slow.
update() updates a fitted model object with new arguments, e.g., a new
model formula, dataset, or variance matrix. When only arguments that control
the computation of the variance are supplied, only the variance will be
recalculated (i.e., the parameters will not be re-estimated). When data is
supplied, weightit is not supplied, and a weightit object was originally
passed to the model fitting function, the weightit object will be re-fit
with the new dataset before the model is refit using the new weights and new
data. That is, calling update(obj, data = d) is equivalent to calling
update(obj, data = d, weightit = update(obj$weightit, data = d)) when a
weightit object was supplied to the model fitting function. Similarly,
supplying s.weights or weights passes the argument through to
weightit() to be refit. When s.weights or weights are supplied and no
weightit object is present, a fake one containing just the supplied weights
will be created.
estfun() extracts the empirical estimating functions for the fitted model, optionally accounting for the estimation of the weights (if available). This, along with bread(), is used by sandwich::sandwich() to compute the robust covariance matrix of the estimated coefficients. See glm_weightit() and vcov() above for more details.
See also
glm_weightit() for the page documenting glm_weightit(),
lm_weightit(), ordinal_weightit(), multinom_weightit(), and
coxph_weightit(). summary.glm(), vcov(), confint() for the relevant
methods pages. predict.glm_weightit() for computing predictions from the
models. anova.glm_weightit() for comparing models using a Wald test.
sandwich::estfun() and sandwich::bread() for the estfun() and bread() generics.
