I'm fitting a logistic model after using both multiple imputation and covariate balancing. With standard logistic regression, the basic structure of my code (which works properly) looks something like this:
weighted_pool_model <- with(weighted_pool_data,
glm(outcome ~ mainpredictor + abunchofcovariates,
family = "binomial"))
weighted_pool_results <- pool(weighted_pool_model)
summary(weighted_pool_results, conf.int = TRUE)
I've been trying to see if this is compatible with logistf
which makes Firth's penalized logit fairly easy (at least outside of the context of MI and CBPS). The first step seems to work:
weighted_pool_firth <- with(weighted_pool_data,
logistf(outcome ~ mainpredictor + abunchofcovariates))
But then the pooling throws an error:
weighted_pool_results <- pool(weighted_pool_firth)
Error: No tidy method for objects of class logistf
In addition: Warning message:
In get.dfcom(object, dfcom) : Infinite sample size assumed.
Any ideas for problem solving or alternative workarounds would be appreciated!
I assume you're using MatchThem::weightthem()
to perform weighting across multiply imputed datasets. To fit a weighted outcome model, you can use with(., glm_weightit())
, which correctly computes standard errors that account for estimation of the weights. To request Firth's correction, you can specify br = TRUE
in the glm_weightit()
call. So, your final code should look like the following:
weighted_pool_model <- with(weighted_pool_data,
glm_weightit(outcome ~ mainpredictor + abunchofcovariates,
family = "binomial", br = TRUE))
When using MatchThem
, with()
is only compatible with function calls from survey
, survival
, and WeightIt
regression models and glm()
and lm()
calls. logistf
models are not supported.