Skip to content

ci = NULL suppresses confidence intervals and SE#640

Merged
strengejacke merged 1 commit into
mainfrom
suppress_ci
Jul 1, 2026
Merged

ci = NULL suppresses confidence intervals and SE#640
strengejacke merged 1 commit into
mainfrom
suppress_ci

Conversation

@strengejacke

Copy link
Copy Markdown
Member

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds support for suppressing standard error and confidence interval calculations by setting the ci parameter to NULL or NA. The implementation updates get_marginalmeans and get_marginaltrends to handle these values, updates documentation across multiple functions, and adds relevant unit tests. The package version is bumped to 0.16.0.1 and the changes are documented in NEWS.md. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the marginaleffects backend integration so that setting ci = NULL (and ci = NA) suppresses computation of standard errors and confidence intervals, aligning with the intent of improving performance/memory usage for large models (ref. #639).

Changes:

  • Suppress SE/CI computation for marginaleffects calls by setting vcov = FALSE when conf_level is NULL/NA.
  • Add test coverage to ensure ci = NULL/NA suppresses CI output for means and slopes.
  • Update documentation/NEWS and bump package version.

Reviewed changes

Copilot reviewed 7 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
R/get_marginaltrends.R Disables variance-covariance computation when CI level is NULL/NA to suppress SE/CI for slopes.
R/get_marginalmeans.R Disables variance-covariance computation when CI level is NULL/NA to suppress SE/CI for means.
R/estimate_means.R Updates ci parameter documentation to describe suppression behavior.
tests/testthat/test-estimate_slopes.R Adds tests asserting ci = NULL/NA suppresses CI output for slopes.
tests/testthat/test-estimate_means_ci.R Adds tests asserting ci = NULL/NA suppresses CI output for means; also reformats existing assertions.
man/get_emmeans.Rd Documents ci suppression behavior.
man/estimate_slopes.Rd Documents ci suppression behavior.
man/estimate_means.Rd Documents ci suppression behavior.
man/estimate_expectation.Rd Documents ci suppression behavior.
man/estimate_contrasts.Rd Documents ci suppression behavior.
NEWS.md Notes behavior change for ci = NULL.
DESCRIPTION Bumps version to 0.16.0.1.
Files not reviewed (5)
  • man/estimate_contrasts.Rd: Generated file
  • man/estimate_expectation.Rd: Generated file
  • man/estimate_means.Rd: Generated file
  • man/estimate_slopes.Rd: Generated file
  • man/get_emmeans.Rd: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/estimate_means.R
Comment on lines +118 to +120
#' @param ci Confidence Interval (CI) level. Must be numeric between 0 and 1.
#' Defaults to `0.95`. Use `NULL` to suppress calculation of standard errors and
#' confidence intervals.
Comment thread man/get_emmeans.Rd
Comment on lines +251 to +253
\item{ci}{Confidence Interval (CI) level. Must be numeric between 0 and 1.
Defaults to \code{0.95}. Use \code{NULL} to suppress calculation of standard errors and
confidence intervals.}
Comment on lines +92 to +95
out <- suppressMessages(estimate_slopes(model, ci = NULL))
expect_named(out, "Slope")
out <- suppressMessages(estimate_slopes(model, ci = NA))
expect_named(out, "Slope")
@strengejacke strengejacke merged commit 700b17a into main Jul 1, 2026
14 of 21 checks passed
@strengejacke strengejacke deleted the suppress_ci branch July 1, 2026 18:40
@DominiqueMakowski

Copy link
Copy Markdown
Member

nice one!

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