Add pooling argument to analyse_mi_data() for unknown imputation methods - #52
Open
bailliem wants to merge 15 commits into
Open
Add pooling argument to analyse_mi_data() for unknown imputation methods#52bailliem wants to merge 15 commits into
bailliem wants to merge 15 commits into
Conversation
Tags the constructed stand-in method with class rbmiUtils_standin so print.analysis()/summary.analysis() report it as "<not supplied; pooling = "...">" instead of fabricating Bayesian/condmean provenance (F1). Adds coverage for the bootstrap pooling-only path and folds a rbmi::pool() success assertion into the jackknife test (F2). Guards make_standin_method() against bootstrap with fewer than 2 imputations, which previously built n_samples = 0 and pooled to NAs silently (F3), and adds a default switch() arm that aborts informatively on an unrecognized pooling string (F4). Also removes a stray double blank line, documents the condmean else-branch assumption in get_pooling(), and notes in analyse_mi_data()'s @param pooling that the returned method element is a constructed stand-in, not the true method (F5, F6).
compute_rubin_diagnostics() is @nord so no help topic exists; roxygen link syntax [compute_rubin_diagnostics()] emitted unresolved-link warnings on document(). Includes RoxygenNote bump to 7.3.3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #50
Summary
analyse_mi_data()can now analyse an already-imputed (ADMI) dataset when the imputation method is unknown, via a newpoolingargument — addressing the scenario raised in #50 where themethodobject is unavailable.poolingargument ("rubin","bootstrap","jackknife","bmlmi"): supply eithermethod(unchanged behaviour, fully backward compatible) orpoolingdirectly. Both together must agree; neither errors informatively.get_pooling(method)— the single source of truth mapping rbmi method objects to pooling strategies (as proposed in analyse_mi_data() when the exact imputation method is unknown. #50).poolingis supplied, the data defines the number of imputations (non_samplescheck) and an internal stand-in method object sized to the data is constructed sorbmi::pool()validation passes.print()/summary()label these objects<not supplied; pooling = "rubin">rather than claiming a method that was never given.pooling = "rubin"is the documented recommendation for data of unknown provenance;"bmlmi"alone errors (D not inferable from data);"bootstrap"with < 2 imputations errors rather than silently pooling to NAs.docs/superpowers/; also fixes pre-existing roxygen unresolved-link warnings for@noRdinternals inard_conversion.R.The
pooling/get_pooling()design is deliberately shaped to be liftable into rbmi core per openpharma/rbmi#589.Test plan
test-analyse_mi_data.R(34 new): validation error paths, method/pooling conflict, path-equivalence (pooling-only vsmethodproduce identical pooled results), end-to-endrbmi::pool()for rubin/bootstrap/jackknife stand-ins, provenance labelling, guards.test-get_pooling.Rcovering all four method classes and error paths.test-utils.Rfailures are a local rstan/Rcpp toolchain issue unrelated to this change.