| is_unit_trimmed | R Documentation |
is_unit_trimmed() returns a logical vector indicating which
observations were removed by trimming. This is a per-unit query, as opposed
to is_ps_trimmed(), which tests whether the object has been trimmed at
all.
is_unit_trimmed(x)
x |
A |
A logical vector the same length as x, where TRUE marks a
trimmed unit.
ps_trim() for trimming propensity scores, is_ps_trimmed() to
test whether an object has been trimmed, ps_trim_meta() to retrieve full
trimming metadata.
ps <- c(0.05, 0.3, 0.6, 0.95)
trimmed <- ps_trim(ps, method = "ps", lower = 0.1, upper = 0.9)
is_unit_trimmed(trimmed)
# Use to subset data to retained observations
kept <- !is_unit_trimmed(trimmed)
ps[kept]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.