Add ESS extensions#48
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds Effective Sample Size (ESS) extensions to the halfmoon package, including a new check_ess() function for computing ESS metrics and a plot_ess() function for visualizing them. The PR extends the package's balance diagnostics functionality to help users assess weight variability and potential instability in weighted estimates.
- Added
check_ess()function to compute effective sample size for different weighting schemes - Added
plot_ess()function to create bar plot visualizations of ESS values - Enhanced
ess()function to handle missing values withna.rmparameter
Reviewed Changes
Copilot reviewed 31 out of 50 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| R/check_ess.R | New function to compute ESS metrics with optional grouping support |
| R/plot_ess.R | New function to create bar chart visualizations of ESS values |
| R/ess.R | Enhanced existing ESS function to handle NA values |
| tests/testthat/test-check_ess.R | Comprehensive test suite for the new check_ess function |
| tests/testthat/test-plot_ess.R | Test suite for the plot_ess visualization function |
| man/*.Rd | Documentation files for the new functions and updated cross-references |
| NAMESPACE | Export declarations for the new functions |
| DESCRIPTION | Added scales dependency for plot formatting |
Comments suppressed due to low confidence (1)
tests/testthat/test-plot_ess.R:128
- The snapshot tests use
expect_doppelganger()which suggests visual regression testing, but this function is not commonly available in standard testthat. Ensure this function is properly available in your testing environment or consider using standard plot testing approaches.
test_that("plot_ess snapshot tests", {
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.
No description provided.