Skip to content
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

Correct Multiple Imputation Standard Error Estimation #30

Closed
jackmwolf opened this issue Jul 28, 2024 · 6 comments · Fixed by #31
Closed

Correct Multiple Imputation Standard Error Estimation #30

jackmwolf opened this issue Jul 28, 2024 · 6 comments · Fixed by #31

Comments

@jackmwolf
Copy link
Contributor

Both adjustedsurv and adjustedcif support multiple imputation via mids objects. However, the current variance estimator is not consistent and does not use Rubin's rules. Both functions currently estimate the standard error of the survival function as the average of the within imputation standard error estimates

se=mean(se, na.rm=mi_extrapolation)

This does not account for variance in point estimates between imputations and is not averaged on the variance scale. Instead, the variance should be estimated as
$$\hat{V} = \hat{V}_W + \hat{V}_B + \frac{\hat{V}_B}m$$
where $\hat{V}_W$ is an estimate of the within imputation variance (the average of the variance estimates), $\hat{V}_B$ is an estimate of the between imputation variance (the variance of the imputed point estimates), and $m$ is the number of imputations. (See Chapter 9 of Applied Missing Data Analysis by Heymans and Eekhout.)

@RobinDenz1
Copy link
Owner

Thank you very much for finding and fixing this error. I will admit that I was ignorant of the correct way to do this. May I ask, how did you notice?

@jackmwolf
Copy link
Contributor Author

Happy to contribute! I've been using the package a lot lately and really appreciate all the functionality! As for finding the issue, I was digging through the adjustedcif source trying to make sense of an error I was getting with multiple imputations plus bootstrapping and happened to notice the issue. Thanks for the super quick turnaround!

jackmwolf added a commit to jackmwolf/adjustedCurves that referenced this issue Jul 29, 2024
- Resovles RobinDenz1#30
- In PR RobinDenz1#31, I had corrected pooling for asymptotic standard errors but had forgotten to do so for bootstrapped results. This PR implements the fix for the bootstrap.
@jackmwolf
Copy link
Contributor Author

@RobinDenz1 I was digging throuhg my old code trying to recall the error I was investigating and realized that my PR did not address using Rubin's rules with bootstrapped data. I've made a new PR (#32) with this fix included. Sorry for not catching this before you prepared for (and submitted?) to CRAN!

@RobinDenz1
Copy link
Owner

I see. If you can show me a reproducible example of your error I might be able to help you with that.

Sadly I have already submitted the changes to CRAN, but thats not a big deal, I will include it in the next update. Should have checked it as well before submitting, so its more on me than on you.

@jackmwolf
Copy link
Contributor Author

Revisiting that project, it looks like it was a misunderstanding of the documentation on my part. I had specified conf_int = TRUE and bootstrap = TRUE for a method that didn't support asymptotic standard errors assuming that I needed both arguments to be specified as true for bootstrapped CI's. The documentation is clear on this so I think all is good here!

Thanks again!

@RobinDenz1
Copy link
Owner

Don't worry, you are not the first person to make that mistake. It is documented, yes, but it is surely not the best design choice. I have some major refactoring of internal code planned, because (as you might have noticed) it is kinda messy right now. I may change how this works in future versions to make it more intuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants