Merged
Conversation
- 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>
Closed
Contributor
There was a problem hiding this comment.
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.TOSTtfor "simple" type plots with improved layout (raw estimates now on top, decision text displayed, new "combined" layout option) - Improved
plot.TOSTtfor "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 |
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>
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.
Update plotting options
plot_htest_estfunction for plotting outputs ofhtestobjects with estimates and confidence intervalsplot.TOSTt