Fit a logistic model for one bootstrap replicate
Value
Named numeric vector of kept coefficients, or NULL if the fit
errored or did not converge. Warnings - notably "fitted probabilities
numerically 0 or 1" on a quasi-separated replicate - do not discard a
converged fit.
Details
Under select = "stepwise", entry tests the score chi-square and removal
tests Wald, matching PROC LOGISTIC SELECTION=STEPWISE.
Examples
set.seed(1)
n <- 200
x1 <- rnorm(n)
df <- data.frame(y = as.integer(x1 + rnorm(n) > 0), x1 = x1,
noise = rnorm(n))
fit_logistic(df, y ~ x1 + noise,
list(method = "stepwise", sle = 0.10, sls = 0.05,
max_steps = 0))
#> (Intercept) x1
#> 0.05094849 1.38932194