1

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!

2
  • If you want help with programming, you should provide a simple reproducible example with sample input that can be used to test and verify possible solutions. If you want statistical modeling advice, you should ask at Cross Validated instead.
    – MrFlick
    Commented Oct 7, 2024 at 15:29
  • All R coding questions should have unambiguous specifications of packages, generally best done with library calls at the beginning of the code blocks. You might also specify what is meant by “pooling”, since it’s not really a proper statistical or mathematical term. Do you mean to take the mean or some sort of precision weighted mean?
    – IRTFM
    Commented Oct 7, 2024 at 16:42

1 Answer 1

1

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.

1
  • Thanks, Noah. I don't get an error anymore, although my results seem completely identical regardless of whether I include br=TRUE or not. I'll need to do some more reading on the br option and on Firth's corrections.
    – user14212134
    Commented Oct 9, 2024 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.