Skip to contents

is_unit_truncated() returns a logical vector indicating which observations had their propensity scores modified by truncation. Use is_ps_truncated() to test whether an object has been truncated at all.

Usage

is_unit_truncated(x)

Arguments

x

A ps_trunc object created by ps_trunc().

Value

A logical vector the same length as x (or number of rows for matrix input). TRUE marks observations whose values were winsorized.

Examples

ps <- c(0.02, 0.3, 0.5, 0.7, 0.98)
ps_t <- ps_trunc(ps, method = "ps", lower = 0.05, upper = 0.95)
is_unit_truncated(ps_t)
#> [1]  TRUE FALSE FALSE FALSE  TRUE