Skip to content

Add multiple imputation functions for response output#408

Merged
munoztd0 merged 13 commits into
devfrom
imputation_functions
Jul 14, 2026
Merged

Add multiple imputation functions for response output#408
munoztd0 merged 13 commits into
devfrom
imputation_functions

Conversation

@danielinteractive

@danielinteractive danielinteractive commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Please see NEWS.md for the updates.
This is needed for binary response multiple imputation outputs.

Notes:

Comment thread DESCRIPTION
insightsengineering/tern@main,
insightsengineering/rtables@main,
insightsengineering/rtables.officer@main
Config/roxygen2/version: 8.0.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(), and categorize_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.

Comment thread R/resp_imputation.R
Comment thread R/resp_imputation.R
Comment thread R/pool_funs.R
Comment thread R/pool_funs.R
munoztd0 and others added 3 commits July 13, 2026 01:43
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@munoztd0
munoztd0 force-pushed the imputation_functions branch from 0c2a5e4 to 00cfa82 Compare July 14, 2026 13:17
@munoztd0
munoztd0 self-requested a review July 14, 2026 13:33

@munoztd0 munoztd0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielinteractive rebase on the new roxygen2 8.0.0 dev branch so you have a clean PR. otherwise lgtm!

@munoztd0
munoztd0 merged commit 2003001 into dev Jul 14, 2026
18 checks passed
@munoztd0
munoztd0 deleted the imputation_functions branch July 14, 2026 13:35
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>
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 this pull request may close these issues.

3 participants