Add multiple imputation functions for response output#408
Merged
Conversation
munoztd0
reviewed
Jul 13, 2026
| insightsengineering/tern@main, | ||
| insightsengineering/rtables@main, | ||
| insightsengineering/rtables.officer@main | ||
| Config/roxygen2/version: 8.0.0 |
Collaborator
There was a problem hiding this comment.
This is why you have a lot of diffs in your document() you have update to roxygen 8.0.0 FYI.
I will update it in a separate PR
There was a problem hiding this comment.
Pull request overview
This PR adds support utilities to generate multiple-imputation outputs for binary response analyses, including pooling helpers and p-value categorization, and wires them into package exports/documentation.
Changes:
- Added
resp_multiple_imputation()/h_impute_analyze_resp()for scenario-based binary response imputation + CMH risk-difference/p-value aggregation. - Added
pool_rubin_scalar(),pool_z_stat(), andcategorize_pval()(plus tests and docs) to support pooling and p-value labeling. - Updated exports, pkgdown reference, NEWS, and a snapshot to reflect the new outputs.
Reviewed changes
Copilot reviewed 11 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-resp_imputation.R | Adds tests for imputation-per-scenario and pooled outputs. |
| tests/testthat/test-pval_cat.R | Adds tests for p-value category normalization and assignment. |
| tests/testthat/test-pool_funs.R | Adds tests for Rubin and z-stat pooling helpers. |
| tests/testthat/_snaps/estimate_proportion_diff.md | Updates snapshot to include se_diff output. |
| R/resp_imputation.R | Implements impute+analyze helper and scenario-level multiple imputation wrapper. |
| R/pval_cat.R | Implements p-value category validation and categorization. |
| R/pool_funs.R | Implements pooling helpers for scalar estimates and z statistics. |
| NEWS.md | Documents newly added functions. |
| NAMESPACE | Exports new public functions. |
| man/resp_multiple_imputation.Rd | Adds generated documentation for resp_multiple_imputation(). |
| man/pool_z_stat.Rd | Adds generated documentation for pool_z_stat(). |
| man/pool_rubin_scalar.Rd | Adds generated documentation for pool_rubin_scalar(). |
| man/h_normalize_pvalcat.Rd | Adds generated documentation for h_normalize_pvalcat(). |
| man/h_impute_analyze_resp.Rd | Adds generated documentation for h_impute_analyze_resp(). |
| man/categorize_pval.Rd | Adds generated documentation for categorize_pval(). |
| DESCRIPTION | Updates roxygen metadata field(s). |
| .gitignore | Ignores .Renviron. |
| _pkgdown.yml | Adds new functions to pkgdown reference index. |
Files not reviewed (6)
- man/categorize_pval.Rd: Generated file
- man/h_impute_analyze_resp.Rd: Generated file
- man/h_normalize_pvalcat.Rd: Generated file
- man/pool_rubin_scalar.Rd: Generated file
- man/pool_z_stat.Rd: Generated file
- man/resp_multiple_imputation.Rd: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
munoztd0
requested changes
Jul 13, 2026
munoztd0
force-pushed
the
imputation_functions
branch
from
July 14, 2026 13:17
0c2a5e4 to
00cfa82
Compare
munoztd0
self-requested a review
July 14, 2026 13:33
munoztd0
approved these changes
Jul 14, 2026
munoztd0
left a comment
Collaborator
There was a problem hiding this comment.
@danielinteractive rebase on the new roxygen2 8.0.0 dev branch so you have a clean PR. otherwise lgtm!
munoztd0
added a commit
that referenced
this pull request
Jul 15, 2026
* add draft imputation functions * add pval category functions * add pooling functions * add imputation/analysis functions * add to NEWS, refresh docs * fix assertion * ignore .Renviron * update snapshot * Update WORDLIST Hilferty * rewrite namespace with roxygen 8.0.0 --------- Co-authored-by: David Muñoz Tord <david.munoz@mailbox.org> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: munoztd0 <dtord@its.jnj.com>
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.
Please see NEWS.md for the updates.
This is needed for binary response multiple imputation outputs.
Notes:
This depends on 1490: additional stats insightsengineering/tern#1491
I did not run a full
devtools::document()because there are many unrelated updates. Maybe worth to run this on thedevbranch to clean it up?