View source: R/summary.weightit.R
| summary.weightit | R Documentation |
summary() generates a summary of the weightit or
weightitMSM object to evaluate the properties of the estimated weights.
plot() plots the distribution of the weights. nobs() extracts the number
of observations.
## S3 method for class 'weightit'
summary(object, top = 5L, ignore.s.weights = FALSE, weight.range = TRUE, ...)
## S3 method for class 'summary.weightit'
plot(x, binwidth = NULL, bins = NULL, ...)
## S3 method for class 'weightitMSM'
summary(object, top = 5L, ignore.s.weights = FALSE, weight.range = TRUE, ...)
## S3 method for class 'summary.weightitMSM'
plot(x, binwidth = NULL, bins = NULL, time = 1L, ...)
object |
a |
top |
how many of the largest and smallest weights to display. Default
is 5. Ignored when |
ignore.s.weights |
|
weight.range |
|
... |
For |
x |
a |
binwidth, bins |
arguments passed to |
time |
|
For point treatments (i.e., weightit objects), summary() returns
a summary.weightit object with the following elements:
weight.range |
The range (minimum and maximum) weight for each treatment group. |
weight.top |
The units with the greatest weights in each treatment group; how many are included is determined by |
coef.of.var (Coef of Var) |
The coefficient of variation (standard deviation divided by mean) of the weights in each treatment group and overall. |
scaled.mad (MAD) |
The mean absolute deviation of the weights in each treatment group and overall divided by the mean of the weights in the corresponding group. |
negative entropy (Entropy) |
The negative entropy ( |
num.zeros |
The number of weights equal to zero. |
effective.sample.size |
The effective sample size for each treatment group before and after weighting. See |
For longitudinal treatments (i.e., weightitMSM objects), summary()
returns a list of the above elements for each treatment period.
plot() returns a ggplot object with a histogram displaying the
distribution of the estimated weights. If the estimand is the ATT or ATC,
only the weights for the non-focal group(s) will be displayed (since the
weights for the focal group are all 1). A dotted line is displayed at the
mean of the weights.
nobs() returns a single number. Note that even units with weights or
s.weights of 0 are included.
weightit(), weightitMSM(), summary()
# See example at ?weightit or ?weightitMSM
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.