Dear Noah, thanks for writing this great package. When estimating a model with 100 times more treated than controls, I get warnings:
Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: fitted probabilities numerically 0 or 1 occurred
3: Some extreme weights were generated. Examine them with summary() and maybe trim them with trim().
I generally understand why that might happen. However, when I run the exact same model outside weightit just with glm, this does not happen. The self-contained code given below replicates my problem.
Dear Noah, thanks for writing this great package. When estimating a model with 100 times more treated than controls, I get warnings:
Warning messages: 1: glm.fit: algorithm did not converge 2: glm.fit: fitted probabilities numerically 0 or 1 occurred 3: Some extreme weights were generated. Examine them with summary() and maybe trim them with trim().
I generally understand why that might happen. However, when I run the exact same model outside weightit just with glm, this does not happen. The self-contained code given below replicates my problem.
Kind regards Hendrik
library(tidyverse) library(WeightIt)
data("nsw_mixtape", package = "causaldata") data("cps_mixtape", package = "causaldata")
df <- nsw_mixtape |> filter(treat==1) |> bind_rows(cps_mixtape) |> mutate(delta_Y=re78-re75)
W = weightit(treat ~ age + educ + black + hisp + marr + nodegree + re74, data = df, estimand = "ATT", method = "ps", include.obj = TRUE)
summary(W$ps)
df$pscore <- predict( glm(treat ~ age + educ + black + hisp + marr + nodegree + re74, family=binomial(), data = df), type="response")
summary(df$pscore)