ps_trim_meta() returns the metadata list attached to a
ps_trim object by ps_trim().
Value
A named list with elements:
methodCharacter string indicating the trimming method used.
keep_idxInteger vector of retained observation indices.
trimmed_idxInteger vector of trimmed observation indices.
n_obsThe number of observations those indices describe.
lower,upperNumeric cutoffs, when applicable.
refitLogical,
TRUEif the model was refit viaps_refit().focal_invertedFor a vector of scores, logical,
TRUEif the scores are one minus the probability the fitted model reports, whichps_refit()reads to predict the same level.
Additional method-specific elements (e.g. cutoff, delta, lambda) may
also be present.
keep_idx, trimmed_idx, and n_obs are absent when an operation that
changed the number of observations dropped the record; see ps_trim().
See also
ps_trim() for trimming propensity scores, is_ps_trimmed() and
is_unit_trimmed() for predicate queries.
Examples
ps <- c(0.05, 0.3, 0.6, 0.95)
trimmed <- ps_trim(ps, method = "ps", lower = 0.1, upper = 0.9)
ps_trim_meta(trimmed)
#> $method
#> [1] "ps"
#>
#> $lower
#> [1] 0.1
#>
#> $upper
#> [1] 0.9
#>
#> $focal_inverted
#> [1] FALSE
#>
#> $keep_idx
#> [1] 2 3
#>
#> $trimmed_idx
#> [1] 1 4
#>
#> $n_obs
#> [1] 4
#>
