| is_refit | R Documentation |
is_refit() tests whether x is a ps_trim object whose propensity
model has been refit on the retained (non-trimmed) observations via
ps_refit().
is_refit(x)
x |
An object to test (typically a ps_trim vector). |
A single TRUE or FALSE.
ps_refit() to refit a propensity model after trimming,
ps_trim() to trim propensity scores.
set.seed(2)
n <- 30
x <- rnorm(n)
z <- rbinom(n, 1, plogis(0.4 * x))
fit <- glm(z ~ x, family = binomial)
ps <- predict(fit, type = "response")
trimmed <- ps_trim(ps, lower = 0.2, upper = 0.8)
is_refit(trimmed)
refit <- ps_refit(trimmed, fit)
is_refit(refit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.