-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discrepancy between weighit() and glm() #73
Comments
Thank you for the kind words! Is there any way you could provide the dataset for me to examine this, or can you replicate it is using |
Thanks for the lightning quick response! I had also thought missingness may be an issue too, but getting the same issue with complete case analysis. Sorry, I realize the no data component makes this more annoying on your end. I will take a stab with Just to confirm, my understanding of my above call to |
Are you able to reproduce the problem with a small subset of your data and send me an anonymized version (e.g., with variable labels removed, factor levels recoded, and numeric variables rescaled)? That way I could take a look at what's going on. Otherwise I can only speculate. |
Hi Noah,
Love your R packages, and thankful for all the work you've put into making them usable and well documented.
I have what I hope is a simple question. Apologies that I cannot produce the example explicitly here as the data is restricted. I am trying to run
weightit()
as follows:weightit(treatment ~ covariates, method = 'ps', link = 'logit', estimand = 'ATE', data = my_data)
I get the following error message:
glm.fit: algorithm did not converge, glm.fit: fitted probabilities 0 or 1 occured
I expected this was due to sparsity in some covariates within one or both levels of the treatment, but on inspection of the raw data this does not seem to be the case, and when I run:
lr_mod <- glm(treatment ~ covariates, family = 'binomial, data = my_data)
and generate the propensity scores by hand:
predict(lr_mod, type = 'response')
I get no convergence warnings, and a reasonable looking distribution of propensity scores. I can easily take these values and do the PS weighting myself by hand, but I am curious if you have any idea what is causing the discrepancy betweenweightit
andglm
Any thoughts much appreciated!
The text was updated successfully, but these errors were encountered: