Skip to contents

is_ps_trimmed() returns TRUE if x is a ps_trim object or a psw object created from trimmed propensity scores, and FALSE otherwise. This tests whether the object carries trimming information, not which individual units were trimmed; see is_unit_trimmed() for that.

Usage

is_ps_trimmed(x)

Arguments

x

An object to test.

Value

A logical scalar (TRUE or FALSE).

See also

ps_trim() for trimming propensity scores, is_unit_trimmed() to identify which units were trimmed, ps_trim_meta() to retrieve full trimming metadata.

Examples

ps <- c(0.05, 0.3, 0.6, 0.95)
trimmed <- ps_trim(ps, method = "ps", lower = 0.1, upper = 0.9)

is_ps_trimmed(trimmed)
#> [1] TRUE
is_ps_trimmed(ps)
#> [1] FALSE