Skip to content

108 update plotting#111

Merged
arcaldwell49 merged 13 commits intomasterfrom
108-update-plotting
Jan 27, 2026
Merged

108 update plotting#111
arcaldwell49 merged 13 commits intomasterfrom
108-update-plotting

Conversation

@arcaldwell49
Copy link
Collaborator

Update plotting options

  • Add plot_htest_est function for plotting outputs of htest objects with estimates and confidence intervals
  • Updated simple plot for plot.TOSTt
  • Updated tnull plot for `plot.TOSTt

arcaldwell49 and others added 7 commits January 23, 2026 17:12
- plot.TOSTt type='simple' improvements:
  - Raw estimate plot now appears on top (was on bottom)
  - Decision text and equivalence bounds displayed at top
  - Added 'layout' parameter: "stacked" (default) or "combined"
- Added plot_htest_est() for plotting estimates from any htest object
  - Displays point estimate with confidence interval
  - Handles null values as reference lines
  - Auto-converts two-sample t-test to mean difference
- Added tests for new functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add facet_label to df_plot and use inherit.aes = FALSE for geom_vline
to prevent faceting issues when null values are plotted.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
changing vignettes. Making requested changes to plotting functions.
When describe=TRUE (default), the plot now includes:
- Title: the test method name
- Subtitle: test statistic, p-value, estimate, and CI on two lines

Also removed unnecessary inherit.aes parameter from geom_vline calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… plot_htest_est

- Improve plot.TOSTt for type="tnull" to show one-sided rejection regions
  - Equivalence tests: lower bound shows right tail, upper bound shows left tail
  - MET tests: lower bound shows left tail, upper bound shows right tail
  - Fix hypothesis detection to use grepl instead of exact match
- Add null hypothesis line to plot_htest_est describe subtitle
  - Shows null hypothesis statement based on alternative type
  - Handles single null values and equivalence bounds

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 27, 2026 12:35
@arcaldwell49 arcaldwell49 linked an issue Jan 27, 2026 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances plotting capabilities for TOST (Two One-Sided Tests) analysis in the TOSTER package. The changes focus on improving visualization options and adding new plotting functionality for hypothesis test objects.

Changes:

  • Enhanced plot.TOSTt for "simple" type plots with improved layout (raw estimates now on top, decision text displayed, new "combined" layout option)
  • Improved plot.TOSTt for "tnull" type plots to correctly show one-sided rejection regions based on test type (equivalence vs. minimal effect tests)
  • Added new plot_htest_est() function to create estimate plots from any htest object with confidence intervals

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
R/methods.TOSTt.R Updated plot.TOSTt method with new layout parameter and improved tnull plot logic for one-sided rejection regions
R/htest_helpers.R Added new plot_htest_est function for generic htest plotting with estimate and confidence intervals
tests/testthat/test-tTOST.R Added comprehensive tests for new layout parameter and plot options
tests/testthat/test-htest.R Added comprehensive tests for plot_htest_est function covering various test types and edge cases
man/*.Rd Updated documentation files for new function and parameter
vignettes/IntroTOSTt.Rmd Updated examples to demonstrate new layout parameter
NEWS.md Detailed changelog documenting all plotting improvements
NAMESPACE Exported new plot_htest_est function

arcaldwell49 and others added 6 commits January 27, 2026 10:07
Should fix Check error. fingers crossed.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@arcaldwell49 arcaldwell49 merged commit dabf53f into master Jan 27, 2026
3 of 4 checks passed
@arcaldwell49 arcaldwell49 deleted the 108-update-plotting branch January 27, 2026 17:45
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.

Update plotting

2 participants